noise 4-20 ma output transducers, question about capacitors, (added schematic)


Im trying to build this livestock cattle scale from farmhack: livestock weigh scales | Farm Hack. For this project it is necessary to read signals from 4 pressure transducers that support a weight deck before and after putting some object on top of it to calculate the weight by transforming the analogread values of pressure into weight with the ohms law, etc, before digressing further...

According to my transducers manual (626 dwyer series), the sensors require "An external power supply delivering 13-30 VDC with minimum current capability of 40 mA DC (per transmitter) is required to power the control loop." however I am using two nine 9 volts rechargeable batteries in series (the project requires 1 but with 1 battery I got absurd values from the analogread)
Problem is:
My signals are not stable for any reasonable lenght of time, analogreads tend to shift up and down around a certain value and stay there only to shift up or down around another value for no reason and it is impossible to calibrate the scale: if I leave a 40 pound object on top of the deck, I start getting readings of around 13 pounds for the first 15 minutes, and after an hour or so I start to get values around 45pounds! For my needs precision is not super important, even a 10 pounds error or so is ok, but this behavior is too unrealible to even calibrate.

I suspect that 1) the lack of power supply is making the 4-20 loop behave unreliably, 2) that I dont wait enough delay time between readings and that somewhat messes up the values or 3) some error when Im soldering and and wiring everything (first project, and much more complex than I thought). I am using 180 ohm resistors and using a moteino (which works with 3.3v)

Im debugging everything right now, but since I have no idea about power supplies I though to ask before exploring furter possibilities.

I would really appreciate any advice on this subject (analogread values where some precision is required or with 4-20 current output sensors in diy electronic projects, etc) Thanks in advance!


Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.,148850.0.html

How are you reading the 4-20mA loop?
What controller are you using?
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Can you please show a schematic of your circuit?


I am using a moteino, which has a ATmega328p microcontroller and has an operating voltage of 3.3 instaed of 5V (Specifications | All about Moteino | LowPowerLab)

This is the schematic I used from farmhack:

I followed everything failry closely, except that I used 3 batteries instead of 2, and used 180 ohm resistors instead of 200 for the transducers loop. Also, I soldered both the negative wires of the batteries to the last row (negative) of the perfboard and the schematic shows only the transducers batterys wire soldered there, does it affect where I solder the batteries black wire to the readings of the transmitters? Sorry Im a newbie in diy electronics, I was a python developer then I became a farmer hehe :slight_smile:


Couple of things 180 ohm and 20mA gives 3.6 volts , this is too high for a 3.3v board.

I would look at the voltage across this resistor and measure the voltage - is it steady ? Is it stable ?
Run a simple example of reading the analog in to see if you get a stable value . This will tell you where the probkem lies.

If it is noisy have a look at taking averages to smooth stuff down : reading = 0.8x reading + 0.2x new reading.

thanks! I will do that, simplfy my test cases to isolate the problem better

Sorry, a circuit diagram please, not an image of component layout.
I see no bypass capacitors anywhere.
Place a 0.1uF cap from each analog input to gnd.
OP's image

Please post your code.
I would say you are reading your analog inputs consecutively like this?

val1 = analogRead(A1);
val2 = analogRead(A2);
val3 = analogRead(A3);
val4 = analogRead(A4);

try this;

val1 = analogRead(A1);
val1 = analogRead(A1);
val2 = analogRead(A2);
val2 = analogRead(A2);
val3 = analogRead(A3);
val3 = analogRead(A3);
val4 = analogRead(A4);
val4 = analogRead(A4);

The controller has only one AtoD, so it is switched from input to input, the AtoD has a capacitor on its input that is charged to the analog level it is switched too.
This change in level from one input to the other takes time, and consecutive switch and reads can be too quick.
By reading each input twice and using the last value, you make sure the capacitor and hence the AtoD input is following your input voltages.

Tom... :slight_smile:

ok! will place the resistors, not sure exactly where in the perfboard its best to place them but will do some research,

I will try to get resistors with better range of error, Im using some that I got from my local electronics shop but not sure about the precision.


Hehe I added the capacitors, averaged with 10 samples each signal and the results look much more stable! The discrepances now come from different cylinder heights which make the weight distribution not uniform across the deck

Thanks!!! 8)


You show two 9v batteries as your power supply.

If you're using 4 load cells they will require at up to at least 80mA.

Ordinary pp3 cells won't do this for long - perhaps a seperate mains supply would be a good idea?


Ahh, I had that same question myself, but I will be needing to be using this outdoors in my farm, which is "off the grid", was thinking about a power supply that connects to my trucks battery or something like that, but not sure


If you've got a truck battery to play with you've got loads of power! - look at 'boost convertors' on eg ebay to get the higher voltage you need.

Only a few quid/bucks

You may have to add some extra capacitors across this higher voltage supply's output as they can be quite noisy. Suggest 1000uF and 100nF in parallel.


I will certainly look into that! after I finish with this first try with 1 9v battery for the sensors, by the way, does it matter if I use inexpensive capacitors from my local electronics shop? and what is the reason to use 0.1uF in this case?

Large electrolytic capacitors stablise the voltage and absorb low-frequency ripple, but aren't much good for high frequency noise. A 0.1uF ceramic capacitor is , so a combination of the 2 provides wideband noise absorbtion.


Hello again, I made my first schematic! beacuse I would like to ask the optimal placement of a capacitor in the 4-20 ma sensor loops of this project Im wrking on. This is my first schematic, it should describe part of the component layout shown on the image above. If anybody sees any errors (or if it does not make sense at all haha) please any correction is more than appreciated!

The question is, should I place the capacitor closer to the analog pin and/or to ground, after or before the 280 ohm resistor? I dont have a lot of space left on each sensors column of the perfboard but if it will improve things, Im considering doing again some of the wiring when the precision resistors Ill order arrive.

Thanks again! this community is awesome 8)

Don't put your capacitor there! - it won't let ANY current through!

Put it in parallel with your load resistor ie between the arduino analog input and ground, close to the arduino pin. And a series 4k7 or so would be an even better noise filter - see enclosed.

A higher resistor value - eg 220 or 240, would make better use of the arduino's dynamic range.

EDIT - sorry - overlooked you were using a 3.3v Arduino. So that should be about 150 or 160 ohms. nedit.

You should calibrate against known weights ( and none!) to make sure......


420rec.pdf (18.9 KB)

@allanhurst diag.

Tom... :slight_smile:

great! thanks again


another 2 questions to add to the noobness of my thread to try to understand some things better:

Im trying to understand how the 4k7 resistor would (not) alter the analogread that corresponds with the current drawn by the transducer (I thought that for example when the transducer senses 0 psi, it would draw 4 ma of current from the battery, then because of the resistor in the circuit and ohms law, I will get a reading of .66 volts (with 165 ohm resistors) on the corresponding pin, etc but I must not be getting the real idea behind this reasoning fully

Im getting that the current will come from the capacitor instead of the battery, but the capacitor and the 4k7 are connected anyway, is it then that the capacitor and the 165 ohm resistor are connected to the battery ground directly but not the 4k7 resistor?

Also, I have read that the 4k7 resistor can protect the arduino in case I turn it off but not the power supply for the sensors, so in that case would a 4k7 resistor for each sensor be necessary?

thanks in advance have a nice monday,



The input impedance of an arduino analog input is effectively infinite.

The 4k7 and 100nF make a single pole low-pass filter which is 3dB down ( half power ) at about 340 Hz.

At dc it has no effect whatsoever.

So long as your signal doesn't vary significantly in <5mS ( 10 time-constants) , this will be fine. Unlikely in your application, unless your animal is leaping around a lot, in which case you will have more pressing problems!

The 4k7 does indeed protect the arduino from many transients. Internal diodes in the AT chip clamp the voltage to within about 0.7 volt of the rails if the current isn't too high. The 4k7 limits this current. Anything up to about 10k would be OK - it isn't critical.

If worried it may be worth adding a 4.7v zener in parallel with R1. I wouldn't bother.

My circuit is correct.

Repeat it ( using seperate analog inputs of course ) for each sensor.

165 ohms is theoretically the correct value for R1, but in practise because of the variations in the arduino's
3.3v regulator ( a few percent) you will have to calibrate anyway, so it's not too important. 150 or 160 would do.