Maker Pro
Maker Pro

Analog to Digital Signal Block Diagram Confirmation

Good day to all,
Please i need your Support in helping me to confirm if the block diagram i attached to this thread is correct. I want to read an analog Signal from a sensor and convert it to a digital Signal with the help of an in-built ADC in a microcontroller. I am not sure if the resistor i connected to the ADC Input is all i need to get the ADC of the microcontroller to receive the accurate Signal from the sensor or if i still need other components.
The operating voltage of the microcontroller is 5V
The Output analog voltage Signal from the sensor is from 0V to 5V
The Output analog current Signal from the sensor is from 4mA to 20mA
If the sensor outputs for example 4mA,then the Input voltage to the ADC of the microcontroller will be 1V using the 250 Ohms resistor. I would be glad if somebody could help me confirm if this Arrangement is correct. Once again thank you for the Support. Best regards.

NOTE: All other Connections with respect to the microcontroller have been taken care of. The only part i need help is the ADC section.

Clipboard01.jpg
 
Last edited by a moderator:

Harald Kapp

Moderator
Moderator
If the sensor outputs for example 4mA,then the Input voltage to the ADC of the microcontroller will be 1V using the 250 Ohms resistor.
No it won't. V=R*I is correct, but you have to take into account where I flows. Can it flow through the 250Ω resistor in your schematic?

The Output analog voltage Signal from the sensor is from 0V to 5V
The Output analog current Signal from the sensor is from 4mA to 20mA
Either volts or milliamperes, not both simultaneously. If you have different sensors giving you eiterh voltage or current, you need different analog front ends.
You will also have to ensure that the input voltage to the ADC does not exceed the limits (see datasheet of the µC). A typical analog front end includes:
  • Scaling (ensure the signal is within the ADCs input limits).
  • Protection (ensure the input of the ADC will not see overvoltages/overcurrents)
  • Filtering (ensure the highest signal frequency is well below the ADCs sampling rate to stay within the limits of the Nyquist-Shannon sampling theorem)
The exact design of the analog front end depends on the parameters of your input signal, your ADC and your sampling SW.
 
It is almost correct. If the resistor is connected between the sensor output and ground, and the ADC input is connected to that junction it would convert a 4-20mA current to 0 to 5V, which is what I think you want.

Bob
 

hevans1944

Hop - AC8NS
It is almost correct. If the resistor is connected between the sensor output and ground, and the ADC input is connected to that junction it would convert a 4-20mA current to 0 to 5V, which is what I think you want.

Bob
Well, actually, it would convert a 4 to 20 mA current signal to a 1 to 5 VDC input to the ADC. This "wastes" one fifth of the ADC conversion range. Unless there is a strong reason to use the 4 to 20 mA current loop (long distance between sensor and ADC input being a valid reason) it is better to use the 0 to 5 VDC output mode. Also, a current-loop sensor output needs a power supply to provide the compliance voltage of the loop, which is sometimes built into the sensor but often requires an external power supply, voltage dependent on loop length.
 
Top