I/O pin to sense/control light bulb from PIC

Status
Not open for further replies.

drkidd22

Member
So I have a PIC 18 and I'm looking to use a single pin to control/sense the state of an external light bulb.
I figure the I/O pin would need to be set as an input to sense the state of the bulb and the it would also need to be set in software as an output to control it, or would it be easier to get done using external components?
 
Since the light bulb likely takes many 100;s of mA to drive it, and the PIC pin can source/sink a max of 25mA, you will definitely need an external transistor to switch the lamp on/off.

Where does the requirement to sense the state of the lamp using the same PIC pin stem from? Are you trying to detect if the bulb is burned out?
 
The requirement is that I want to save some pins, but this might just make my project a little complex. I might just see how it works with 5 pins as inputs and 5 pins as outputs. Might make my life easier.

I have the circuit to turn the light on/off and sense the state and if the bulb is burnt, but I'll have to be using two pins per bulb; one to sense and one for control.
 
What is the supply voltage for the PIC?

What is the supply voltage for the Lamp?

How much current (or how many Watts) is the lamp?
 
5V Pic

120V Lamp x 5 (using relay to drive it from pic)

13W Lamp x 5

This is the circuit, someone from this forum helped me with it, but I wanted to use only one pin per light bulb, that is my issue.
 

Attachments

  • 1833-35950d1259768063-i-need-ideas-suggestions-piclightswitch02.gif
    18 KB · Views: 194
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…