Tuesday 6 August 2013

Project 15 (Moderate): Digital Piggy Bank

Detecting a coin and its weight can be complicated and expensive. I came up with several solutions to this problem. One of which, I tried to create a switch out of aluminum foil. Whenever a coin is inserted, it will cause the aluminum foil to come in contact, and therefore completing the circuit. However, this switch is too big for my tiny piggy bank.












I decided to use a photoresistor as a "coin detector". When the arduino is powered up, it will go through a calibration state. During this phase, the arduino will be recording the light intensity for about 5 seconds and after that, it will calculate the average light intensity. Finally, the arduino will now accept coins. Once coin is inserted, the light intensity will change. This is a very basic way of detecting a coin. 









As of right now, I don't know how to create a simple and efficient way to detect what kind of coin is inserted. So instead, I'll create a user interface to record the deposit. This will consist of 5 buttons. Each button will represent a state (see picture on the left). The LED will indicate which state you are in. From left to right, the states are $0.05, $0.10, $0.25, $1.00 and $2.00.

Once the state has been determined, simply insert the coin and your deposit will be incremented by the amount specified.




features:
- 5 buttons (5 cent, 10 cent, 25 cent, 1 dollar, 2 dollar)
- 5 LED's will represent each button to identify the current state  
- current balance will be displayed on LCD
- savings will be recorded and saved (unless the power is turned off)
- a photoresistor will be used as a coin detector



Parts:
- 5x red LEDs
- 5x 330 ohm resistor
- 5x pushbuttons
- 6x 10k ohm resistor
- 1x photoresistor
- 1x RGB LCD (16 x 2)
- 1x 10k potentiometer


Using a photoreisstor as a coin detector can cause some problems. For example, suppose the arduino is running its calibration in a very bright room. When the calibration period is over, turning off the lights will confuse the arduino and it will think that a coin is constantly being inserted. This is because the arduino is comparing the average light intensity during the calibration period with the current light intensity. When there is a significant difference between these light intensities, the balance will be incremented. 

3 comments:

  1. CAN you send me The Arduino Code please?
    EduardAguilar03@gmail.com

    ReplyDelete
  2. I want to code now , please.
    autcharakham@gmail.com

    ReplyDelete