Introduction: Bright Saver With Arduino Mega

About: Introducing Bright Saver!

Bright Saver displays accurate, up-to-date savings information and allows you to set a savings target. For example, once you set your target using the two buttons provided, you may observe the progression and how much more is needed to reach your goal.

Hardware Components Required

  • 1x Arduino Mega
  • 1x Breadboard (Large)
  • 1x Programmable Multi Coin Acceptor CH-924 (4 Coin Types)
  • 1x 12V AC Power Adapter
  • 1x Female DC Jack Barrel Adapter
  • 1x LCD 16x2
  • 1x 10K Potentiometer
  • 4x LEDs (Red, Yellow, Green and Multi-RGB)
  • 4x Resistors (220 ohms)
  • 2x Mini Push Buttons (Red and Blue)
  • Bunch of Singapore Third Series Coins
  • Bunch of Jumper Wires (Male-to-Male)
  • Bunch of Double-end Lead Alligator Clip Wires

This project is suitable for all, Arduino beginners included! Different types of Singapore coins are accepted through the multiple coin acceptor. After the coin is inserted, the LCD will display the updated savings information and your progress is updated. In order to set the target, buttons are connected to the Arduino and Bright Saver, allowing you to adjust your target.

Each time a coin is inserted, Bright Saver’s piggy bank will check your savings progress and light up with a specific colour to indicate if you have successfully reached a savings milestone. For example, Bright Saver will indicate a red light if your progress has reached 25 percent of your set target. Upon crossing 50 percent, the LED will turn yellow and green when you cross 75 percent of your target. Finally, once you hit your target, the LED lights will cycle between red, green and blue.

LED Colour Display for Target Savings

  • At 25th percentile → Red
  • At 50th percentile → Yellow
  • At 75th percentile → Green
  • At 100th percentile → Multi-RGB

Recommended Electronic Shops in Singapore

1. Carousell

2. Space Electronics Pte Ltd at Sim Lim Tower, #B1-07

3. Sgbotic

Reason for Bright Saver

The reason for choosing Bright Saver is related to my childhood experiences. During my childhood, I always had the interest to save up as much of my allowances using a piggy bank but had to ensure it was filled up before cracking it open. However, I was not able to tell how much I have saved simply through the weight of the piggy bank. Moreover, I found it exasperating to compute all of my savings in coins as I these coins were then later exchanged for cash notes with my parents. Hence, I thought it would be great to make use of this opportunity to have a customised and smart piggy bank that helps me count my coin savings for me.

Future Version of Bright Saver

The future version of Bright Saver plays a melody as a celebration when savings target is reached by using a Piezo Buzzer. Bright Saver could also be an interactive helper who communicates with you by greeting your name and provide target information automated by voice. Bright Saver can also make use of advanced technologies such as being connected to a Mobile App to allow tracking of your savings through your phone anytime and anywhere, preventing impulsive spending habits!

Credits
I was further inspired by a tutorial by Adafruit that utilises electronic devices such as an Arduino, a LCD and a single coin acceptor. However, the features were simple and I would like to challenge myself to add in features that are interactive, functional and personalized. The original codes have been modified substantially.



Bright Saver is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

Step 1: Calibrate Multi-Coin Acceptor

Hardware Components Required

1. Programmable Multi-Coin Acceptor CH-924 (4 Coin Types)

2. 1x 12V AC Power Adapter

3. 1x Female DC Jack Barrel Adapter


You may be wondering... how does the multi-coin acceptor work?

The sensors in this coin acceptor use the thickness, diameter and fall time of the coins to identify them and it’s fully programmable so you’re not limited to any particular type of currency. Besides using it as a bright saver, you could use it for vending machines and arcade games too!


Steps to Calibrate Multi Coin Acceptor

1. Before the coin acceptor could be set up, connect the Red and Black wires to the Female DC Barrel Jack Adapter. The terminals of the DC Barrel Jack Adapter are labelled as positive and negative and require a screwdriver to tighten the terminals, shown in the second picture.

o Red wire ⟹ Positive

o Black wire ⟹ Negative

2. Connect Female DC Barrel Jack Adapter to a 12V AC Power Adapter, shown in the third picture.

3. The white and grey wires will then be connected to the Arduino, mentioned in step 2.

4. Once the coin acceptor is powered, the red LED will light up and have ‘BEEP’ sound, shown in the fouth picture.

5. Prepare different coins of $0.10, $0.20, $0.50 and $1.00, shown in the fifth picture.

6. Set up the coin acceptor with the following steps:

  • Press and hold “ADD” and “MINUS” for few seconds and letter “A” will appear from the LED display.
  • Press “SET” button for few seconds and letter ‘E’ will appear.
  • Use the button “ADD” and “MINUS” to choose how many coins you want to use. In our case, we will select “4” ($0.10, $0.20, $0.50 and $1.00). Press “SET” for few seconds and letter “H1” will appear.
  • Letter “H1” refers to the first coin to be used for calibration. You may choose how many sample coins to sample. In my case, I will use 15 sample coins of $0.10 for better accuracy. Hold “SET” to confirm.
  • Next, letter “P1” will appear to select the amount of output’s pulses for each coin. Since the maximum pulse is 50, I selected pulses 1 to 10 for easier identification.

⮎ For example:

o $0.10 set as “1”;

o $0.20 set as “2”;

o $0.50 set as “5”;

o $1.00 set as “10

  • Press “SET” to confirm.
  • Letter “F1” will appear to set the accuracy level for the first coin. The value is from 1 to 30, 1 being the most accurate. If the same kind of coins is similar, the value should be more accurate. In my case, I selected 7. Use the button “ADD” and “MINUS” and press “SET” for few seconds.
  • Letter “H2” will appear and repeat the same process from step 4 to step 6. However, do take note that pulses are different for all the coins, mentioned in Step 5.
  • After the setup from H1 to H2, hold “SET” and letter “A” will appear to indicate and press “SET” again for letter “E” to appear to confirm the new settings. (IMPORTANT!)
  • Lastly, switch off and on the main power switch.
  • Press “SET” and letter “A1” will appear. You may start sampling the first coin: $0.10 with 15 samples. Press “SET” when you are done.
  • Next, letter “A2” will and repeat the same process and press “SET”. The system will restart automatically after the setup is completed.


Now, you’re ready to program the Coin Acceptor with Arduino! :D

Step 2: Connect Multi-Coin Acceptor to Arduino Mega

Hardware Components Required

1. Multi-Coin Acceptor

2. Arduino Mega

3. Double-end Lead Alligator Clip Wires

4. Female-to-female Jumpers


Steps to Connect Multi-Coin Acceptor to Arduino

Firstly, plug in the USB cable to your Arduino Mega and laptop.

As mentioned in Step 1, connect the White wire to Pin 2 and grey wire to Pin GND, illustrated in the diagram.

In my case, I used crocodile clips to female-to-female jumpers to insert the wire into Arduino pins.

Step 3: Connect LCD to Breadboard and Arduino Mega

Hardware Components Required

1. Breadboard

2. Arduino Mega

3. LCD

4. Female-to-female Jumper Wires


Steps to Connect LCD to Breadboard and Arduino Mega

1. Connect the soldered LCD screen on the side of the breadboard.

2. Connect negative rail to Pin GND of Arduino. This means anything that is connected to that row, will be considered Pin GND.

3. Connect positive rail to Pin 5V of Arduino.

4. Connect first (VSS) and last (K) pin of LCD to negative rail which indicates GND.

5. Connect supply pins, 2nd (VDD) and 15th (A) pin (support backlight of LCD) of LCD to the positive rail.

6. Connect the 1st pin of the potentiometer to the positive rail.

7. Connect the 3rd pin of potentiometer to the negative rail.

8. Connect the centre pin of potentiometer to 3rd (V0) pin which is the control and contrast pin.

9. Connect the 4th (Register Select – RS) pin of LCD to pin 3 of Arduino.

10. Connect the 5th (Read/Write – RW) pin of LCD to the negative rail. Since we are using the LCD for display, make it low which is to Write.

11. Connect the 6th (Enable – E) pin of LCD to pin 4 of Arduino.

12. Connect data pins of LCD.

o Connect 11th (D4) pin of LCD to pin 8 of Arduino

o Connect 12th (D5) pin of LCD to pin 9 of Arduino

o Connect 13th (D6) pin of LCD to pin 10 of Arduino

o Connect 14th (D7) pin of LCD to pin 11 of Arduino

Once connected, the LCD will light up and you may adjust the contrast of the display using the potentiometer.

Step 4: Connect LED Lights to Breadboard and Arduino Mega

Hardware Components Required

1. Breadboard

2. Arduino Mega

3. 4x Resistors (220 Ohm)

4. 4x LED (Red, Yellow, Green, Multi-RGB)

5. 8x Double-end Lead Alligator Clip Wires

6. Female-to-female Jumper Wires

Steps to Connect LED Lights to Breadboard and Arduino Mega

1. Establish a common ground by connecting the negative rate from breadboard to GND pin of Arduino.

2. Insert the resistors by connecting one leg to the negative rate.

3. Before connecting the LEDs to the breadboard and Arduino, you need to be aware of the LED pins. The short pin is negative lead and the long pin is positive lead.

4. Connect the jumper wires to each end of the resistors, parallel to one another.

5. Connect the other end of jumper wires with alligator clip wires.

6. Connect the other end of alligator clip wires to the shorter leads of LEDs.

7. Use a new alligator clip wires to connect the longer leads of LEDs with female-to-female jumper wires.

8. Connect the other end of female-to-female jumper wires to the Arduino.

⮎ For example:

o Red LED to pin 16 of Arduino

o Yellow LED to pin 14 of Arduino

o Green LED to pin 15 of Arduino

o Multi-RGB LED to pin 17 of Arduino

Step 5: Connect the Push Buttons

In this Bright Saver, we will be using two buttons, red and blue to set the target on the LCD screen. The red button is to increase the target and the blue button is to decrease the target.


Hardware Components Required

1. Arduino Mega

2. 2x Mini Push Buttons (Red and Blue)

3. 6x Double-end Lead Alligator Clip Wires

4. Female-to-female Jumper Wires

Starting from the blue button,

1. Connect 3 legs of the red button with 3 alligator clips.

2. Connect the other end of alligator clips to jumper wires.

3. Connect the other end of jumper wires to the breadboard as shown from the diagram.

4. Connect breadboard to Arduino Pin 20 by using a jumper wire.

5. Parallel to the red alligator clip’s jumper wire, connect to the positive rail.

6. Parallel to the yellow alligator clip’s jumper wire, connect to the negative rail.

Starting from the red button,

1. Connect 3 legs of the red button with 3 alligator clips.

2. Connect the other end of alligator clips to jumper wires.

3. Connect the other end of jumper wires to the breadboard as shown from the diagram.

4. Connect breadboard to Arduino Pin 21 by using a jumper wire.

5. Parallel to the green alligator clip’s jumper wire, connect to the positive rail.

6. Connect one side of the negative rail to the other side of the negative rail.

Step 6: Upload Bright Saver Sketch to Arduino

Step 7: Assemble the Bright Saver’s House

Tools Required

1. Cardboards

2. Hot Glue Gun

3. Screws

4. Evian Mineral Water Bottle, 750ml

5. Permanent Markers

6. Penknife


Steps to Construct the House

1. Firstly, I measured the coin acceptor’s interior in order to attach it to the front of the house and attached it with screws. Also, I have cut the bottom of the house to insert my coin bank.

2. Do remember to build an exterior with strong support inside of the house to make sure that the house is able to carry weight by preparing cardboards to act as a support for the coin acceptor and coin bank.

3. Insert your Arduino and Breadboard inside the house.

4. Place the LCD and buttons by cutting holes at the side of the house. Do take note that the LCD is still attached to the Breadboard.

And.... tada!!! Introducing.. Bright Saver!

LED Contest 2017

Participated in the
LED Contest 2017