reading 12 volt signal
Hello,
I am looking to read a 12 volt signal with an SX chip. All I need is a simple on/off. The 12v signal will either be on or off. Lets keep it simple and say I need to read when the brakes are applied in a car by reading the pos voltage signal going to the brake lights. The signal is either 12v or 0v.
I know an input port can only take 5v. Would a resistor work? I know that only limites the amperage, but the 12v would still get to the input port? or would limiting the amperage be OK?
I know I could probably us the 12v to signal a transistor which could swith a 5v source to signal the input port, but is there a simpler way?
Thanks for any help,
Alex
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When I go, I want to go peacefully in my sleep, like my grandfather, not screaming and yelling like the people who were in the car with him.
I am looking to read a 12 volt signal with an SX chip. All I need is a simple on/off. The 12v signal will either be on or off. Lets keep it simple and say I need to read when the brakes are applied in a car by reading the pos voltage signal going to the brake lights. The signal is either 12v or 0v.
I know an input port can only take 5v. Would a resistor work? I know that only limites the amperage, but the 12v would still get to the input port? or would limiting the amperage be OK?
I know I could probably us the 12v to signal a transistor which could swith a 5v source to signal the input port, but is there a simpler way?
Thanks for any help,
Alex
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When I go, I want to go peacefully in my sleep, like my grandfather, not screaming and yelling like the people who were in the car with him.
Comments
You could also use just a voltage divider with a 4.7K resistor between the SX pin and ground and a 10K resistor between the SX pin and the 12V input. This would give you a roughly 4V input on the SX pin when the signal light turns on.
Something like a 22K should work okay.
You'll have to determine if the input is REALLY 0volts or just floating. If it is floating, then you should add a pull-down resistor too.
Edit: Mike beat me to it, but the voltage divider would function as the pull-down too.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
Bean - thank you also, BTW thanks for the info you gave me a while back on using the hardware timers on the SX-48. The info got me to solve the problems I was having.
Alex
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When I go, I want to go peacefully in my sleep, like my grandfather, not screaming and yelling like the people who were in the car with him.