I have a pressure sensor working at 24V dc whose output is analog 0-10V for 0-10bar pressure. I am using this sensor with Arduino Uno. I know that the pressure value will never go beyond 4bar. So do I have to use a voltage divider in this case or not using it will still do the job?
using pressure sensor with 0-10v output for 0-10bar using arduino but pressure value won't cross 4bar. so is a voltage divider required in this case?
\$\begingroup\$ "I know that the pressure value will never go beyond 4bar." - How are you so sure? I recommend designing for the full sensor range anyway; that way you can actually measure overpressure if it ever happens, even if that's not expected under normal circumstances. \$\endgroup\$– marcelmMar 31, 2019 at 19:04
If we assume your Arduino Uno is powered from 5v, then what you appear to be asking is 'if my sensor voltage always stays within the range 0 to 4v, will it be OK to put it into and ADC that can accept 0 to 5v input?'
Under normal conditions, the answer is obviously yes.
The experienced designer designs things so that they work under 'normal' conditions, and don't break under possible but 'abnormal' conditions. Will your sensor output ever go above 5v? What about a brief blip when it's first switched on? What about water hammer in the pipes you're measuring?
It would be prudent to check how much current the Uno input can accept without damage when the voltage exceeds the rail, and use at least a series resistor between sensor and Uno to limit the current to less than this under fault conditions.
\$\begingroup\$ "It would be prudent to check how much current the Uno input can accept without damage when the voltage exceeds the rail..." - That's going to be very little; any overvoltage will be shunted by the ESD protection diodes to VCC, and those diodes are not very beefy. Abuse may render them shorted (as they are on one of the ATMEGA328Ps I have here), killing that pin and possibly the MCU. I recommend external clamping for good protection. I've never found an official figure for the current capabilities of those diodes, but an Atmel app note suggested staying below 1mA. \$\endgroup\$– marcelmMar 31, 2019 at 19:01
\$\begingroup\$ @marcelm thanks for checking. Looks like 1mA it is then. 20kohms should be enough to limit the maximu current to 1mA if we assume the input could blip to +24v. \$\endgroup\$– Neil_UKMar 31, 2019 at 19:37
\$\begingroup\$ The app note in question is Atmel AN2508 by the way. It should be noted that (unlike datasheets), app notes should be considered more of a suggestion, not an authority. But hey, it gives us a ballpark figure to work with. \$\endgroup\$– marcelmApr 1, 2019 at 12:40
You might not need a voltage divider considering the range in normal operation, but I recommend a series current limiting resistor to protect the sensor, a clamp diode to Vcc, possibly another series resistor after the clamp diode to protect the ADC, and possibly a smoothing capacitor on the ADC input pin.