Introduction: Playing With Time
The initial idea of this project was:
- make a present
- create an original electronic circuit
- use an old phone dial
- give a "steampunk" appearance
Step 1: Physical Presentation
- an ON-OFF switch
- a push button "Time"
- a vacuum tube iluminated in red or green from below
- a phone dial
- a wooden box (inside a small speaker, a processor and batteries)
Step 2: Course of the Game:
- Power on: Set the switch to "ON"
- The red LED lights up briefly.
- Wait ... a little music is played.
- The red LED is on.
- Press the "Time" button for a while (ie N seconds). Meanwhile, the green LED is on.
- Dial the number corresponding to the number N of seconds (between 3.0 and 3.9 seconds, N = 3).
- If the compound number is correct, a green light and nice music say "Bravo".
- If the compound number is wrong, a red light and some other music will say "Too bad".
- Wait for the red light and play again (go to 5.)
Attachments
Step 3: Materials List:
- 1 Digispark processor
- 5 Resistors: 220, 2x 2k2, 4k7, 47 ohms
- 1 on-off switch
- 1 push button
- 1 speaker 8 ohms 0.25W
- 1 old phone dial
- 1 RGB Led
- 1 transistor 2n2222
- Optional 1 vacuum tube
- 2 batteries 1,5v AA
Step 4: Schema :
For simplicity, we chose a power supply of the circuit by 3v (2 batteries of 1,5v).
The blue led is not in use.
Step 5: The Code of the Sketch
Attachments
Step 6: Production
I made a wooden box, with hinges and lock. Provide enough space for components and batteries. The top decoration is printed on paper, glued, and all was stained.
I took a Digispark. This is my first project with this component and I discovered its possibilities. You can adapt the project with an Arduino Uno or Nano, or more simply with an Atmega328.
I was inspired by the following instructable and I thank its author:
https://www.instructables.com/id/Interface-a-rotary-phone-dial-to-an-Arduino/
You will see that the game is easy if you press the button 1 or 2 seconds, but more difficult if you press 8 or 9 seconds.
Have fun,