CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Using PIC to read 12V/0V Logic signal and switch on 12V Lamp

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

Using PIC to read 12V/0V Logic signal and switch on 12V Lamp
PostPosted: Sun Mar 13, 2005 5:55 pm     Reply with quote

I have a sealed system in place that contains a processor sourcing 12V a switch via a sense wire. When the switch is toggled, the system sees 0V on its own pullup/sense wire and acts accordingly

When this all happends I want to turn on a 12V bulb. I can not get to the ground on the lamp, just the source wire.

I was thinking of using a transistor as a switch, but I cant get on the ground side of the lamp so thats not going to work. And there would be a voltage drop if I rigged somthing up on the source side. I'm using 16F872 parts, but I guess this doesnt HAVE to run into the pic at all

I'm just looking for a low parts cound simple and reliable way to do this. I'm also not certain how much current the lamp draws, but its a very small lamp, the kind that is in switches of car dashboards.

Does anyone make somthing like a solid state switch for 12V ? I found lots of low voltage / super low mA for switching rs232 signals.

Oh, ofcourse I can not change the original switch or change the signal the other system is monitoring. Maybe there is a way to use an opAmp? Maybe a schmitt Inverter ? Confused
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: Using PIC to read 12V/0V Logic signal and switch on 12V
PostPosted: Sun Mar 13, 2005 7:22 pm     Reply with quote

iso9001 wrote:

I was thinking of using a transistor as a switch, but I cant get on the ground side of the lamp so thats not going to work.

Yeah it would. You can use a PNP.
http://www.kpsec.freeuk.com/trancirc.htm

Quote:

And there would be a voltage drop if I rigged somthing up on the source side.
No more so than on the ground side. Small current you aren't going to notice it.

Quote:

I'm using 16F872 parts, but I guess this doesnt HAVE to run into the pic at all
Beats me, I have no idea what you are trying to do.

Quote:

I'm just looking for a low parts cound simple and reliable way to do this.
Transistors, relays, driver chips, etc..

Quote:

I'm also not certain how much current the lamp draws, but its a very small lamp, the kind that is in switches of car dashboards.
Amp meter will tell you this.
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Mon Mar 14, 2005 3:23 am     Reply with quote

Thanks Mark. I didnt have the setup in front of me to test when I wrote that. But upon some inspection I find a problem.

The switch is not a toggle. Rather its a momentary. So the otheer processor is probably watching for a HI_to_LO transiton. Which I can do just fine.

But now I'll need to use an INT to watch for change on B0, thats pretty easy. But, I have no idea how I am going to get 12V from my board using a 5V output from the pic ... (?)

I tried a NPN but I saw that the emitter only put out a little over the base voltage. I'm looking for "analog switches" on mouser, but they all seem to say that they can source no more then 30mA. I'm not certain but I would almost bet that my little stupid lamp is right about there. (I need to test that)

Ideas for getting 12V to light the bulb using Pic for control, while keeping part number and cost to minimum ?
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Mar 14, 2005 9:56 am     Reply with quote

Um, yeah. I already told you a PNP transistor and gave you a link that show a schematic. I think it would do you some good to get a basic book on electronics or study something online. I am not going to teach electronics here but will give you a little something. Look at the symbols for the transistors. Generally you need about a 0.7V drop across the pins where the arrow is show. The arrow points to the lower voltage. For an NPN the Base needs to be higher and for a PNP the base needs to be lower. So for the PNP circuit you will have to pull that low. The problem will be turning it back off so you will have to use an NPN transistor also. This is much like driving a motor with an H-Bridge configuration, that is controlling the high side. That being said, take a look at page ten of this PDF. http://www.northcountryradio.com/PDFs/column006.pdf

Go get yourself SIMetrix http://www.catena.uk.com/ simulation program and you'll be set.
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Mon Mar 14, 2005 11:41 am     Reply with quote

Yea, I was hoping for somthing a little simpler then a push-pull set up. Thats at least 5 extra parts I need for each board. Plus at least 12 more solder joints to check, potentialy have a problem with etc.

I was thinking that maybe someone makes a lamp driver, or some low pin count SO package that would just take my 5V in and drive it up to 12V out.

I cant find anything on google, I'll try digikey and mouser again.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Mar 14, 2005 1:20 pm     Reply with quote

Well, this is the chip that you want but it has eight drivers

http://www.allegromicro.com/sf/2987/

The transistor approach is very cheap. I am a bit stunned at you not wanting to use them because you are afraid of bad solder joints. We're not talking about BGA's here! Want something simple, just use a relay.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 14, 2005 2:50 pm     Reply with quote

What you want is generically called a "high side switch", specifically
with a logic-level control input.

Go to digikey and search for "high side switch" (with the box for
"in stock" checked). The BSP742T from Infineon looks like a potential
candidate.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group