Voltage fluctuating too much. How to fix?

When I power the whole thing up with a 5V 2A AC adapter, voltage on the 5V pin and the Vin pin is 4.55ish.

Whoa! Don't do that. You are supposed to power it from a DC adapter of between 7 to 12 V.

Sometimes I call 'em AC adapters too, but I really mean AC-to-DC adapter, sounds like that's what he has.

But yeah, 2A is way more than a circuit like that ought to need. Anything getting hot? Could the adapter (wall wart) be bad?

Oh wait. Are you plugging the 5V adapter into the Arduino's power jack? Or to the Vin pin? (Same thing really.) If so that's the trouble. Like Nick says, 7-12 volts are needed there.

If it's a decent, regulated 5V adapter, it can be connected to the Arduino's 5V pin. I've got some 5V wall warts around here, usually they run a little closer to 5V even open circuit, usually within 0.1V. So 5.39 sounds a bit high, but it could be ok.

And you probably want the Arduino's 5V pin hooked to the breadboard power rail, not Vin as shown in the picture.

How can I make the 5V deliver 5V so that I don't have to tweak the code every time I change the way it's powered?

As Jack says, run the peripherals from the Arduino 5V pin, not the Vin pin. I don't think Vin is even valid when the USB is active.

Plus, the ADC can reference an internal 1.1V reference. That would be more reliable probably than the fluctuation you might get on the 5V line. You might need a voltage divider so that you don't input more than 1.1V on the analog pin, if you choose to use that.

I changed the wire so the power rail is fed from the 5V.

I checked the power rail once fed from the 5V pin and it does output the same as Vin, that is to say around 4.55/4.65 depending on the USB/DC jack combinations stated in the first post.

Nothing gets hot and the wallwart is the one I got from Adafruit with the thermal printer. It works fine with the printer + ethernet shield.

Could you elaborate on that please?

Here: analogReference() - Arduino Reference

You can configure the ADC to have a different voltage reference. If you set it to 1.1V then you would need to ensure that you don't input more than 1.1V. However since that is an internal reference it shouldn't fluctuate.

hfp777:
I checked the power rail once fed from the 5V pin and it does output the same as Vin, that is to say around 4.55/4.65 depending on the USB/DC jack combinations stated in the first post.

If you are supplying 7+V to the power input jack you should have 5V on the 5V pin and not some other voltage.

When I power the whole thing up with a 5V 2A AC adapter ...

That doesn't sound like 7V to me.

I checked the output of the AC at the plug and it's 5.39V

It sounds like a poor regulation.

I would try to use a higher voltage adapter and allow the onboard regulator to regulator power to the chip / peripherals.

Ok so I bought a 9V 650mA adapter, I will update when I receive it

I received this 9V adapter, 650 mA. It outputs 9.21V without load.

The voltage is better (5.07V on 5V pin) but when I turn the LCD backlight on it still drops to 4.67V.

Is there a way at all to keep a constant 5V on the 5V pin?

but when I turn the LCD backlight on it still drops to 4.67V.

Have you got a resistor in series with the backlight? On most displays you have to fit one.

Is there a way at all to keep a constant 5V on the 5V pin?

Yes do not draw more current than the regulator can cope with. Also get a good quality supply.

My LCD has a resistor built in the backlight so I don't have to put one.

However, the Arduino is a cheap Chinese knock off. How can I know the regulator's specs? Is there a way to see just looking at it?
It says AMS 1117 on the regulator and outputs 5.15V without any load.

On my genuine Arduino it outputs 5.00V without load.

I was thinking that maybe I should make a separate power line for the buzzer and the LCD backlight as they are drawing too much current? Or maybe put the two sensors on their own 5V regulator and all the rest on a separate 5V regulator?

Would that solve the problem? What about the ground lines, does it matter if I power the sensors from a separate 5V regulator but ground them to the Arduino's pin?

I have read your comments as you mentioned that you put together to monitor the temperature of your fridge and freezer. It might seems that it may take so much power due to which voltage fluctuation is so high. If you are facing this issue continuous then you should contact to a residential HVAC system maintenance professional immediately to fix issue.

Both within +/- 5% - OK.

I'm surprised that with 9v on Vin that the 5v isn't more stable - the AMS1115 specs are very good.

And your stuff , even with backlight takes <<50mA - well within specs for both current and dissipation.

It might be worth adding a capacitor to smooth your +9 - say 100uF?

Allan

whitemechanical answered to a 5½ year old post.
Leo..