Shop OBEX P1 Docs P2 Docs Learn Events
Sensing 12V? — Parallax Forums

Sensing 12V?

HughHugh Posts: 362
edited 2011-07-06 20:19 in Propeller 1
Greetings,

I am looking at a potential new project based on a protoboard. Because it involves sensing the position of a switch or two on a vehicle, I need to be able to sense the presence (or not) of 12V DC.

Dare I go down some simple route involving resistors, or am I staring down the barrel of opto-isolators, etc.?

Advice, opinions and experiences (good or bad) gladly received,

Thanks in advance,

Hugh

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-06 13:54
    There's a recent thread in the Sensors forum on reading a rain gauge's switch closures with a Propeller in a 12V or 24V environment. The same suggestions apply in your case.

    Automobile electrical systems are very very noisy. Be sure to use adequate filtering and shielding if you want to run the Protoboard off the +13.8V power supply of the auto.
  • RaymanRayman Posts: 14,876
    edited 2011-07-06 13:56
    I'd just use a resistive divider to bring that 12V down to something like 2.5 V... You could use big value resistors to prevent damage to the Prop...
  • HughHugh Posts: 362
    edited 2011-07-06 14:09
    Thanks Gents,

    Onward and upward!

    Hugh
  • Mark_TMark_T Posts: 1,981
    edited 2011-07-06 18:05
    Rayman wrote: »
    I'd just use a resistive divider to bring that 12V down to something like 2.5 V... You could use big value resistors to prevent damage to the Prop...

    No, I don't reckon that's enough protection, expect big inductive spikes on the 12V line (I mean BIG) and use schottky diodes to prevent the pin going above 3V3 or below 0V Remember the 12V system is connected to many largish electric motors and inductors (the horn for instance). So perhaps 47k/10k divider and two schottky diodes per pin, then possibly a schmidt-trigger to condition the signal. And even then debouncing in software would be wise.
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-07-06 19:12
    With the potential for spikes, a cheap opto and two resistors would be simpler and safer, IMHO.
  • kwinnkwinn Posts: 8,697
    edited 2011-07-06 20:19
    Cluso99 wrote: »
    With the potential for spikes, a cheap opto and two resistors would be simpler and safer, IMHO.

    Ditto. Also with Mike's comment. A good choke ahead of the filter and PS caps helps a lot as well.
Sign In or Register to comment.