Author Topic: Detecting 8ch 0V/12V with 3.3v MCU  (Read 546 times)

0 Members and 1 Guest are viewing this topic.

Offline okwTopic starter

  • Regular Contributor
  • *
  • Posts: 244
  • Country: no
Detecting 8ch 0V/12V with 3.3v MCU
« 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.
 


Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Detecting 8ch 0V/12V with 3.3v MCU
« Reply #2 on: November 30, 2022, 04:03:40 pm »
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.
 

Offline srb1954

  • Super Contributor
  • ***
  • Posts: 1091
  • Country: nz
  • Retired Electronics Design Engineer
Re: Detecting 8ch 0V/12V with 3.3v MCU
« Reply #3 on: November 30, 2022, 08:15:40 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.
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.
 
The following users thanked this post: ledtester

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 8173
  • Country: fi
Re: Detecting 8ch 0V/12V with 3.3v MCU
« Reply #4 on: November 30, 2022, 08:53:54 pm »
There's no avoiding the big(ish) individual resistors

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.
 
The following users thanked this post: Someone, langwadt, Ian.M

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Detecting 8ch 0V/12V with 3.3v MCU
« Reply #5 on: November 30, 2022, 09:48:22 pm »
As you point out, it *can* be done with 0603 resistors at the top of the input attenuators, however for the O.P's eight channels, that's still a minimum of eight individual resistors and around 37 mm2 of board area even closely packed, before you even consider the area and parts count required for the lower resistors (possibly in tiny arrays of four as the lower resistors in a clamped divider don't have to withstand severe transients), filter capacitors and any input clamping required.

As the O.P. was concerned about the space and assembly work required and was looking for a single chip solution, I doubt they are going to be happy with our suggestions.
 

Offline okwTopic starter

  • Regular Contributor
  • *
  • Posts: 244
  • Country: no
Re: Detecting 8ch 0V/12V with 3.3v MCU
« Reply #6 on: November 30, 2022, 10:02:29 pm »
I'm actually happy about every suggestion here :) I'm currently reading all the posts suggested, and others.
I don't have space issues on the PCB, but no need to waste space, components, etc, unless it adds redundancy against the harsh automotive environment.
I would like a redundant, but it's a compromise between cost / assembly / bom count / etc.
I initially said 3.3V, but if 5V increases my options (e.g. MC1489) or more redundant solution I'm open to that.
« Last Edit: November 30, 2022, 10:08:34 pm by okw »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf