Electronics > Projects, Designs, and Technical Stuff

Detecting 8ch 0V/12V with 3.3v MCU

(1/2) > >>

okw:
Hello! I want to detect high/low on 7 or 8 signals. They can span from 8 to 15V, but ideally they should be 12V (I will put 12v-ish zeners on each signal). It's for automotive.
Is a ULN2803 or UDN2981 a good choice (inverted or not doesn't matter(?) as I'll take care of it in SW)? I was thinking individual transistors and resistors, but with it takes too much space / too much assembly.
How do I design it? Do I feed the 12V directly into the inputs and VCC, and voltage divide on the output? Or is there an easier way / less components / more reliable?
Any suggestions and tips are appreciated.

ledtester:
Here's a related thread:

https://www.eevblog.com/forum/beginners/circuit-to-convert-from-12v-automotive-into-a-microcontroller-voltage/

and also these:

https://www.eevblog.com/forum/beginners/how-to-detect-automotive-brake-12v-signal-for-feeding-into-microcontroller/

https://www.eevblog.com/forum/beginners/12v-arduino-digital-input/

Ian.M:
There's no avoiding the big(ish) individual resistors as tiny SMD resistor arrays simply don't have the pulse power or voltage ratings required to survive automotive transients.  Other elements of the circuit may be possible to combine e.g. rather than a Zener per input, it may be possible to use a TVS diode array to handle four or eight inputs in one part.

srb1954:

--- Quote from: okw on November 30, 2022, 03:11:36 pm ---Hello! I want to detect high/low on 7 or 8 signals. They can span from 8 to 15V, but ideally they should be 12V (I will put 12v-ish zeners on each signal). It's for automotive.
Is a ULN2803 or UDN2981 a good choice (inverted or not doesn't matter(?) as I'll take care of it in SW)? I was thinking individual transistors and resistors, but with it takes too much space / too much assembly.
How do I design it? Do I feed the 12V directly into the inputs and VCC, and voltage divide on the output? Or is there an easier way / less components / more reliable?
Any suggestions and tips are appreciated.

--- End quote ---
An ULN2803 has open collector outputs so you will need pull-up resistors to Vcc to provide the correct logic levels to your processor. The ULN2803 also has Darlington outputs so it will struggle to provide a sufficiently low logic low signal to your processor if you are using a 3.3V supply or lower. The UDN2981 has open emitter outputs and will require pull-down resistors. It is even worse for providing suitable logic levels to your processor.

Have you considered using RS-232 receivers for conditioning your 12V inputs to your logic levels?

These are generally specified to safely handle +/- 30V inputs and will therefore withstand the automotive environment better than most ICs. Some are rated for 5kV ESD transients as well and many have buit-in noise filtering so will reject some of the noise typically found in the automotive environment. If you are using a 5V logic supply the venerable 1489 quad receiver would do the job although if you are using a 3.3V logic supply the range of suitable devices shrinks considerably and you may need to look at the more modern CMOS devices that incorporate drivers as well as receivers.

Siwastaja:

--- Quote from: Ian.M on November 30, 2022, 04:03:40 pm ---There's no avoiding the big(ish) individual resistors

--- End quote ---

Of course there is - power is by U^2/R -> increase R to get power down!

There are consequences, of course - to prevent false triggering from noise, you must then add C, and with large R, comes long time constant. But OP did not specify the required bandwidth. Maybe detection within tens or even hundreds of milliseconds is OK, or such filtration even desirable? If yes, then relatively large C + large R provides decent EM immunity, ESD protection, protection against voltage surges - all within modest package size. 0603 resistors rated to 200V are available and will survive load dump voltage, as long as resistance is high enough to keep power dissipation down.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod