Interactable Pet
In this Project, it is basically a robotic pet that when something is detected the LEDs change colours and the tail of it moves. I got this idea, from Hatchimals as I always wanted it growing up and thought this would be the perfect time to make it come true. Although there are many things I can fix, this is a tutorial on how to get started!
Tinkercad link: https://www.tinkercad.com/things/3DiUqAUMNtF-daring-duup/editel?returnTo=https%3A%2F%2Fwww.tinkercad.com%2Fdashboard
Supplies
This circuit uses the following:
1x Ultrasonic Sensor | Cost: $8.12
2x Servo Motor | Cost: $5.84 each
6x RGB LED's | Cost $9.99
1x Breadboard | Cost: $6.54
3x 330 Ohms Resistor | Cost: $0.16
4x Male/Female Wires | Cost: $1.99
Wires | Cost $16.99
Cardboard | Cost: $1.49
Wiring
Using the appropriate wires connect the following to the corresponding pin:
RGB (green) = pin 4
RGB (red) = pin 3
RGB (blue) = pin 2
RGB (anode) = Power/ Positive rail
Ultrasonic sensor (Trig) = pin 13
Ultrasonic sensor (echo) = pin 12
Servo motor = pin 5
The Code
Upload the following code to your Arduino:
This code makes it so that when the ultrasonic sensor detects something the servo motors turn 90 degree then to its original position. Afterwards the RGB changes to from its normal state to red, to green, then to blue, then changing back to original form, waiting until something is detected again.
Downloads
Prop
Create a animal of your choice using cardboard. Afterwards stick a piece of cardboard on each servo motor to create the illusion that its moving. Moreover make sure that your Ultrasonic sensor is visible so that it can work properly. The picture above is the final product of mine, although it isn't the best it still works as intended.