I am very new to Arduino and electronics and have some questions about using a 4-20 mA sensor with an Arduino UNO R4 Wi-Fi. My overall end goal is to send my data over Wi-Fi to some online database (tbd).
The sensor I am using is attached to a transmitter board with two-wire 4-20 mA output. The sensor can take 10 to 30 Vdc input. I was thinking of using the barrel plug connector on the board to power it with a 24Vdc power supply. From my understanding, if I then connect the positive wire of my sensor to the VIN pin, this external power supply will also power my sensor? I also know that it’s common to use a 250-ohm resistor to convert the current into a voltage that can be read.
At the moment, my understanding is that the following connections will allow me to read my data:
•Connect 24V DC power supply to barrel jack connector on board (blue)
•Connect positive (red) wire of sensor to VIN on board
•Connect negative (black) wire of sensor to analog pin on board
•Connect 250Ω resistor (red and white) between analog pin and ground
Can anyone tell me if this is feasible? I also have a picture of what I think I need to do. Any guidance/help would be much appreciated! Thank you in advance!
As far as I can follow you description, it looks correct.
But it would be much better generally to use 12V supply than 24V which is max for arduino.
Also I suggest to do resistor wiring outside of arduino pins.
Thanks for the response! I was thinking a 12V supply wouldn't be enough because my sensor needs at least 10V and the board also needs power? Can you also explain what you mean by doing the resistor wiring outside of arduino pins?
Don't worry, even 10V is enough. There is not a lot of current draw (if you presented actual setup), so the voltage drop is marginal.
My comment about wiring was about the image where you have resistor attached to arduino pins...
Okay, I think I understand for the power supply. For the wiring, do you mean I would attach one end of the resistor to the negative wire of the sensor and then attach the other end of the resistor to the analog pin?
True, but not the best way.
It is better to use a resistor value that matches the internal reference of the processor.
The potentially more stable internal reference of the Uno R4 is 1.5volt.
I would try a 75 ohm (2 * 150 in parallel) sense resistor, and switch to 1V5 Aref in setup().
You should also include a 10k resistor in series with the pin, and a 10-100n cap between pin and ground for noise reduction.
Powering with 12volt also becomes easier with 1.5volt Aref, because you only 'loose' up to 1.5volt instead of 5volt.
Leo..