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.
CAN you send me The Arduino Code please?
ReplyDeleteEduardAguilar03@gmail.com
can u send me the code?
ReplyDeleteI want to code now , please.
ReplyDeleteautcharakham@gmail.com