Ardunio Controlled Toy Piano, by Julia Duggan and Chae-Hee Park
by PHS_Engineering in Circuits > Arduino
295 Views, 0 Favorites, 0 Comments
Ardunio Controlled Toy Piano, by Julia Duggan and Chae-Hee Park
Every second, the Arduino turns on the piano, making a noise.
Supplies
Materials
- 8 male to male wires
- electrical tape
- 1 1k ohm resistor
- 1 transistor
- 1 relay
- 9v battery and snap-on connecter clip
- arduino uno board
- toy piano
- bread board
-screwdriver
- diode rectifier
- USB cable
Open Up the Piano
Using a screw driver, unscrew the screws that hold the front and back together, exposing the circuit.
Build the Relay Circuit
Follow the diagram as shown and build the relay circuit.
Connect Wires With Tape
Using electrical tape, connect the black and red wires to each side of the circle button on the circuit board. Make sure each side is connected to one wire.
Here's the Code!!
int RelayPin = 13; // the relay is connected to pin 13
void setup() { // put your setup code here, to run once:
pinMode (RelayPin, OUTPUT); // tne relay is an output }
void loop() { // put your main code here, to run repeatedly:
digitalWrite(RelayPin, HIGH); // power is going to pin 13
delay (1000); // there's a delay for 1 second
digitalWrite(RelayPin, LOW); // the power to pin 13 is turned off
delay (1000); // there is a delay for 1 second }