GUIDE: Electronic Piggy Bank How-to, Tabung Elektrik

CAUTION: I will not responsible for any damage that you faced. FYI, I not really an expert on calculating voltage value and electrical. So, please advise me for any parts that can be harmful.
In this tutorial, I just only show on electronically and programming parts. On the piggy bank’s designing, I leave it to you how to design it.

 

STEP 1: PARTS and TOOLS

Parts and Components:

Tools Used

  • Soldering Iron
  • Solder

STEP 2: Power up and Set Pulse for Coin Acceptor

Don’t forget, you need a 12v 1A to power up your coin acceptor. But, we need to cut the 2.1mm jack because we will use it later. So, loose some wire before cut it.

Make sure you know which +ve and –ve.

For how to set Pulse for the coin acceptor, you guys can follow this video;

 

My Pulse Setting;
Pulse 1 = 50 Cent [old coin]
Pulse 2 = 50 Cent [new coin]
Pulse 3 = 20 Cent [old coin]
Pulse 4 = 20 Cent [new coin]

 

STEP 3: Soldering
Well, I not really a pro on soldering part, but, what you guys need to do, is to solder the pins because we need to attach the LCD on the breadboard later.

STEP 4: Wiring the RGB LCD
To wiring up the RGB LCD, you guys can follow instruction from Adafruit Learn. I would like to rephrase the words in that instruction – “Do not proceed to next step unless you’ve got this figured out!”. So, make sure you get the correct result.

Don’t forget to test Hello World 🙂

STEP 5: Programming
Now we need to upload code for Arduino. I’m pretty sure you guys know how to compile it.

Generally, the code for Arduino is used to identify the value of Pulse from Coin Acceptor that will pass through. Then with the rules that we had made in the code, the Pulse will be converted to the value that we assign.

Thank you to craynerd for the video on youtube, because he wrote a code that allow Arduino detect the Pulse value from Coin Acceptor. [and of course to Ricky Fisher (rixter) because he re-wrote back the code on comment, make it easy for everybody to learn ].

I’ve use his code as basic to identify Pulse value and add some magic to make sure Arduino calculate the sum value of coins.

Download code Arduino by craynerd http://pastebin.com/ZYXNc5s7

From the craynerd’s code, I make some changes to localize it.
String OnePulse = “50 Sen”;
String TwoPulses = “50 Sen”;
String ThreePulses = “20 Sen”;
String FourPulses = “20 Sen”;

For the Five and Six Pulse, I not going to use it. So, let it be.
Let’s test the code. To wiring up Coin Acceptor and Arduino you may refer this diagram;

The white wire is pulse wire, attach it to pin number 3 on Arduino. Pin the Ground to the breadboard as well. Your Arduino is power up by USB cable, while Coin Acceptor is power adapter.

Use Serial Monitor to ensure Arduino detect Pulse value. At this moment, there are no text output displayed at LCD at the moment because we not set anything yet.

  • Already set Pulse Value for the Coin Acceptor, powered and attached to Arduino.
  • RGB LCD is attached and working, but no text output.
  • Code uploaded, and able to identify coin value in serial monitor, LCD no text output yet.

If there is nothing wrong with your project, you may compile the code below on Arduino. I already add some magic to sum up total coin and will display it on the LCD.

Download New Code http://pastebin.com/XS4SwwbU

Now, we need to merge it and do some housekeeping on it. So, cut off all power source and refer diagram below;

Once it done, test it.

STEP 7: DESIGN
At this step, it’s depends on your creativity to design your own piggy bank.

Thank you, please assist me if there are any errors in this tutorial.

9 Comments

9 Replies to “GUIDE: Electronic Piggy Bank How-to, Tabung Elektrik”
  1. Hey interesting project, I plan to do this project too. But may I ask, your adapter is 12v DC, for the coin acceptor, but the Arduino and the LCD uses less voltage than that isn’t it? Won’t 12v fries the Arduino and LCD

  2. Okay I got it now, actually the Arduino does provide 5v output for my LCD, but for now during my testing phrase I use the Serial Monitor for testing, do you know why am I keep getting delay / and even sometimes my coin inserted does not show up? I follow the youtube guide on your post for how to set-up the coin acceptor, except mine is printed with JY-926, I guess it’s all the same.

    1. Or is it had to do with the back panel switches. I tried to set to NO / NC and Fast / Med / Slow all gives the same result.

      1. Actually, mine also is JY-926 (4 coin). I have no idea what those switches are for. So, I let it default as what they was shipped to me. It was set on the NC and Slow. BTW make sure the coin acceptor is stable enough while you setting up the coin value so it not moving around.

Leave a Comment

Your email address will not be published. Required fields are marked *