Go Down

Topic: noise 4-20 ma output transducers, question about capacitors, (added schematic) (Read 506 times) previous topic - next topic

JoeJosefo

Hi,

Im trying to build this livestock cattle scale from farmhack: http://farmhack.org/tools/livestock-weigh-scales. 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!

Josefo
:)

TomGeorge

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,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.. :)
Everything runs on smoke, let the smoke out, it stops running....

JayMan


JoeJosefo

Hi!

I am using a moteino, which has a ATmega328p microcontroller and has an operating voltage of 3.3 instaed of 5V  (https://lowpowerlab.com/guide/moteino/specifications/)

This is the schematic I used from farmhack:

http://farmhack.org/sites/default/files/tools/image-gallery/transmitter_0.jpg

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 :)

Thanks!
:)

hammy

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.

JoeJosefo

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

TomGeorge

Hi,
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?
Code: [Select]

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


try this;

Code: [Select]

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... :)
Everything runs on smoke, let the smoke out, it stops running....

JoeJosefo

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.

Thanks
:)

JoeJosefo

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)

Josefo
:)

allanhurst

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?

Allan-

JoeJosefo

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

thanks!



:)

allanhurst

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.

Allan

JoeJosefo

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?
:)

allanhurst

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.

Allan

JoeJosefo

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) 
:)

Go Up