I am having an issue with a project, and I'm hoping someone here might be able to offer some guidance.
I have made a wireless temperature monitor to keep track of temperatures in my smoker. I've been working on it for several months, and just put it together in its enclosure when I noticed a problem. I am using an Arduino Mega with a WiFi shield. I have 6 large 4-digit LED displays (temps) and two small 4-digit LED displays (times). Five thermistor temperature probes (Thermoworks) are wired in to analog inputs using voltage dividers. One probe is a thermocouple. I have two 10K linear potentiometers, one controlling the brightness of the large displays, and one controlling the brightness of the smaller ones. The displays are using I2C. Potentiometers are wired in through separate analog inputs.
When I increase the brightness of the large displays, the temperatures displayed rise up to 8 degrees. The higher the brightness, the larger the temp change on the display. The display related to the thermocouple is not affected. I also notice visible flickering in the smaller displays as I increase the brightness of the larger displays. Increasing the brightness of the smaller displays has no adverse effects. If I disconnect all of the large displays except for one, increasing the brightness has no effect on the temperature displayed, and does not induce the flickering in the smaller displays. So it seems like with all displays connected, as the brightness increases, the current being drawn increases, and the small displays are affected as are the voltages being measured across the thermistors. If I unplug a temperature probe and measure the voltage across the jack, at low brightness the voltage is 4.7 volts. The voltage across the jack at max brightness is about 3.7 volts, so my suspicion was confirmed.
I switched the potentiometers to the 3.3v output of the Arduino and saw no change in the behavior.
If I remove the potentiometers from the circuit altogether and change the brightness of the large displays in the sketch, the behavior is the same. One final piece of info...at higher brightness levels, the unit seems to become unstable and will freeze in 5-10 minutes. At lower brightness, the unit will run at least 30 hours (the longest I've tried) without issue.
Does anyone have any ideas on what is causing this and how to solve this problem? Am I overloading the Mega driving the 6 displays at higher brightness?
The value returned by analogRead() is a value referenced to the Vcc of the arduino with a possible 0 - 1023 .
If Vcc = 5V, and temp probe voltage is 1V, (measured with a multimeter), then the value returned is
1V /0.00488=204 (5V /1023=0.004887585532746823069403714565 Volts per count)
When you load down the onboard regulator by turning up the brightness on your display (because you are not experienced enough to know that you should never run ANYTHING off your arduino regulator if you are taking analog measurements; EVERYTHING should be powered off a SEPARATE supply) what happens is that your Vcc is no longer 5V. It drops to maybe 4.7V or less.
so now to recalculate
4.7V/1023=0.0045943304007820136852394916911
and
1V /0.0045943304007820136852394916911 =217.65957446808510638297872340447
and so on.
So what is the moral of the story ? (YOU tell me)
What's the power source?
5V is coming from the 5V header pin?
The regulator is limited to 800mA.
It will be less if it has to regulate higher voltages down.
I don't use the barrel jack when I can - instead I use a 5V wallwart rated for 1 or 2 amps and power things that way. With a Mega, adding a diode from 5V (anode) to Vin (cathode) will prevent backdriving the regulator and damaging it.
That's all true but that doesn't change the fact that the OP is loading down the regulator with displays that should be powered from a separate supply , not to mention he could avoid this problem by using a digital temp sensor. As long as he is running his display from the arduino 5V, whether it's powered from USB or from the barrel jack, the load is going to lower the Vcc and it will not be 5V and his temp reading will go up as explained in previous post.
Thank you for the replies. The moral is get the displays off of the arduino 5V line. I am currently using a 9V/1A wall wart plugged into the barrel jack of the mega, and the 5V pin in the header is powering everything.
I am inferring what CrossRoads was getting at was to use the external power supply to not only drive the mega, but also the displays. The documentation for the mega mentions that when using an external power supply through the barrel jack, you can access the unregulated voltage through Vin on the mega. Can I use this to drive the displays, using a voltage divider to step the 9V down to about 5V, which is in the input voltage range for the displays?
BTW, the DS18B20 is inappropriate for this application. I need real "probes", capable of penetrating whatever I am cooking, and all wiring needs to be heat resistant, not to mention the temperature range of the DS18B20 is not large enough. I considered thermocouple probes and amplifiers, but this would increase the cost by about 7x.
Powering everything from the onboard 5V regulator is really pushing the limits of the regulator.
If you add a seperate heftier (1A to 1.5A) 5V regulator and bring 9V into that in parallel with 9V into the barrel jack, you would be much better off.
Or just a 5V, 2A wallwart to power everything. http://www.dipmicro.com/store/DCA-0520
I never saw the point of using 9V, 12V wallwarts and overburdening a little 800mA regulator when a 5V wallwart could be used instead.
Can use Vin, but the reverse polarity diode that is between the barrel jack and Vin is only rated for 1A, and you get less than that because the board itself uses some of that 1A.
It would be convenient to drive the displays from the Vin pin on the mega, but sounds like there would be some challenges. So I decided first to do a simple test using an Uno and one of the large displays. The idea is to use the Uno to control the display, but use a separate power supply to power the display. I hooked the display up to the Uno using the appropriate I2C pins. The Uno is powered by USB. For power to the display, I connected directly to a 4.6V (measured)/0.775A power supply. I used a simple sketch which just counts cycles. The display lights up (displays 1234), but it seems the Uno never takes control of it, and the display never changes from 1234. Letting the Uno power and control the display, the sketch runs fine. I tried a few other things, but the bottom line was the same....the arduino (uno or mega) I2C never seems to take control of the display when the display is powered by an external source....it just sits there at 1234. I have a feeling I am missing something obvious, but I'm currently stumped...it seems like this should work.
Yes, I have. This display, and all of the others have worked flawlessly without pullup resistors. After reading this, I figured I'd give that a try, but as I was wiring it up, I realized I hadn't connected the ground of the Uno to the display. I had only connected the (-) from the external power supply to the display. Connecting the ground from the Uno immediately fixed the problem.
When I came back to reply, I saw the response by CrossRoads asking about the grounds....yup, that was it!
Thank you both for all of your help. I will be buying the bits and pieces for a voltage regulator tomorrow so I can incorporate it into my current design. I will split the incoming voltage from the 9V wall wart between the soon-to-be-built regulator (which will send 5V to the displays) and the mega, so I don't have to use two wall warts. If that fails, I know I can fall back to the dual wall wart option.