Vending machine project: LCD blinking and lower contrast when plugged out of the computer, but is working normally when plugged in computer

So, I have this vending machine setup using a universal coin slot, keypad, and LCD system powered up using a 12 volt power supply. I am using a 4x3 keypad (the arduino version), a 16x2 LCD I2C, and a universal coin slot with all systems working properly.

However, when I unplug it from the computer, the orange light on the arduino starts to blink rapidly with the LCD screen, and it lowers contrast ridiculously (the text still shows in the LCD but its very low contrast). The only power source I use is a 12v battery pack and a 12v power supply for testing purposes.

Below is the schematic and also some pics

This is what happens when it's connected to the PC (all working normally and clear LCD screen)

However, this is what happens when I unplug it



Do note that the screen does light up with the text (it cannot be seen in the pic) but it's just a very low contrast version.

I have tested it with two LCD I2Cs (I have a spare) and it showed the same results, I have also tried to change wirings for everything, also same thing. It cannot be the Arduino itself because everything is working perfectly when I plug it in the computer (basic vending machine shenanigans are working, coin slot and keypad have no problems)

I am guessing it's with the battery/power supply I am using? I bought a new set a few hours ago and tested it and it's also the same result, and the batteries aren't lowbat yet. For further explanation, I am using a 12v battery pack with double AA batteries having 1.5 volts each, because circuit.io told me it works. The coinslot uses 12 volts and I think the LCD only uses 3-5 volts

It did work a few weeks ago, but when I disassembled and assembled it again using the same setup, it stopped working? I genuinely have no idea what's happening and would like some help.

Also, just wanna add that the 5v pin is quite loose, but it was working a few weeks ago though and nothing literally changed with the setup.

I see a couple of potential problems:
Don’t make power connections through a breadboard. Some of the cheap ones have poor and/or intermittent connections.
Use terminal strips like shown below.

Use good Alkaline batteries. The Everyready super heavy duty are carbon zinc and will not last as long. They also may not be able to supply enough current for everything you have connected.

Can it be the batteries I bought are defective? A couple of weeks ago, the whole system is working and is using the same brand of batteries until we had to disassemble it to clean the coinslot and the previous set of batteries ran out of power (checked the volts). It lasted for about a week which is enough for what I need.

Fast forward to a few days later, I bought new ones and is working completely fine. Then today it stopped working. So I bought a couple of new ones again and nothing. I just bought them a few hours ago and tested it a couple of times before making this post.

But what puzzles me is that the coinslot machine works perfectly since it uses 12 volts. It's just the LCD that doesn't.

Okay, so update, I just used a 12 volt power supply (although not a battery pack, and needs to be plugged) and it works, but for this project, at least for the presentation purposes, I must use a battery, I'm really guessing the batteries are the ones that are broken. Do I just go for a different battery and just buy new ones again?

Try using lithium AA batteries instead of those.

I can run my satnav on good alkaline batteries for a short period of time, but it lasts a long time with just 2 lithium AA batteries.

It's very possible. You don't know how long (maybe years) those batteries have been sitting in some warehouse somewhere or if they were exposed to high temperatures. The old carbon zinc batteries are cheap for a reason.

Hi, @mschvx

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Not a Fritzy image, make sure you show power supply and do it in black and white.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.