Introduction: Ghost to Arduino
This is a guide I made to show you step by step how to control the LED in a halloween ghost toy using Arduino.
Required tools and parts:
- Halloween ghost toy (pictured above)
- Solder wire
- Soldering iron
- USB to protosnap cable
- Computer with Arduino installed
- Frayed wires
Step 1: Step 1: Remove Battery and LED From Toy
When you remove the battery and LED from the halloween toy, it should look like this.
Step 2: Step 2: Detach LED and Wires From Battery
Now that we have figured out where the LED and battery are located, we can detach the parts of the wires that are connected to the battery. Once this step is completed, the results should look like the images shown. The green wire is positive, and the metal wire com the other side of the LED is negative.
Step 3: Step 3: Connect Positive and Negative Wires to Breadboard
Next, we must connect the LED to the breadboard, relay, and protosnap. This step requires multiple parts.
1: Attach protosnap to breadboard.
2: Attach the positive side to VCC, and the negative side to the far left side of the relay.
3: As for the inner two sections of the relay, connect one to GND and the other to the pin named A3.
4: Connect the other right end of the relay to GND as well.
The result should look like the pictures and schematic above.
Step 4: Step 4: Plug Into Computer
After everything is wired up, we have to plug the protosnap into the computer. Once we have plugged the prototype into the USB port, we have to upload code to the protosnap from Arduino.
To start, we can open the example blink. This file can be found by pressing:
file > examples > basics > blink.
Now we must change the pinMode in the code. After we change all the instances of 13 to A3, we can manipulate the code to change the amount of time the light turns on and off.
The final code should look like the picture attached.
We have a be nice policy.
Please be positive and constructive.