NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » weighscale problem - noise affects measurement

March 04, 2012
by karmmisht
karmmisht's Avatar

I'm hoping someone can help me with a problem I'm having with a variant on the Nerdkits weighscale tutorial. The goal of my project is to:

  1. Get a tare weight on a bowl.
  2. Activate a motor (using PORTC |= (1<<PC4) ...
  3. The motor is used to fill a bowl with food. As the bowl fills, the weight is monitored.
  4. Shut off the motor once a given weight increase is attained.

First, I got weighscale working with the weight shown on the LCD (thanks to the Nerdkits guys for the nice video and code). Instead of a motor, I'm testing the prototype out by lighting up an LED. Eventually, PC4 instead will be used to activate a relay that controls the motor. Everything works fine except for one thing - as soon as PC4 is turned on, the weight measurement varies significantly from one sample measurement to the next making it difficult to judge the weight. The weight measurement is pretty stable if PC4 is off. It appears that setting PC4 to high creates some additional noise. Ideas, suggestions?

Basically, the setup is the same as weighscale with the addition of turning on PC4. The idea is to improve my cat feeder so she get's a more accurate portion of food. Please let me know if you need more details. Thanks.

March 05, 2012
by hevans
(NerdKits Staff)

hevans's Avatar

Hi karmmisht,

This is most likely happening because the LED being driven directly from an MCU pin like that is causing the voltage at your rails to dip quite a bit. Since the voltage out of the 7805 is being used as your reference voltage for the ADC conversion it's causing your calculation to be off.

One quick "fix" that would alleviate this current issue is to put a current limiting resistor in series with the LED. This will drastically reduce the amount of current the battery has to source and hopefully the reading will remain steady enough.

In your real circuit this will likely be less of an issue because your MCU pin won't be pushing such a large current. Of course you might not have other noise issues once the cat feeder motor is running near your chip, and you have the relay spiking on and off, but that is a different problem and you won't really see those until you try it.

March 05, 2012
by mongo
mongo's Avatar

Another and maybe additional suggestion is to use a Zener diode for the reference voltage. That's the method I have used in similar circumstances. I even have used Analog Devices Precision reference chips. They cost a bit but very very stable. They come in a wide variety of ranges and output voltages. But a simple Zener will do nicely too.

March 05, 2012
by karmmisht
karmmisht's Avatar

hevans and mongo - Thanks very much for the suggestions. I don't have a diode available but the resistor did the trick. There is still a little more noise evident in the weight reading but it is small enough to be acceptable. If the final setup doesn't work quite right, I'll look into the suggestion of the zener diode or reference voltage chip.

Sound like the motor wires somehow should be routed to stay away from the the rest of the circuit. Or, maybe I can shield them.

Although my project breaks no new ground, I learned a little being a mechanical engineer who thought it would be nice to be an electrical engineer. If it turns out, I might post a picture or two. I know the cat will be happy.

March 06, 2012
by Ralphxyz
Ralphxyz's Avatar

karmmisht, you should post as Nerdkits Community Library project.

It would be nice to see a happy cat getting a (an) accurate portion of food.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that you can use printf and scanf functions to talk to your computer from your USB NerdKit? Learn more...