VISIT PROJECT
#include
Servo myservo; // creating myservo object
int buttonPin = 11;//set button pin
int buttonState = 0; // set buttonState
void setup()
{
myservo.attach(12);// attach the 13 pin to servo
pinMode(buttonPin, INPUT); // set button to input
}
void loop()
{
buttonState = digitalRead(buttonPin); // read and save to the variable "buttonState" the actual state of button
if (buttonState == HIGH)
myservo.write(0);
else
myservo.write(95);
delay(1500);
// IF YOU LIKE THIS PROJECT PLEASE SUBSCRIBE ; https://www.youtube.com/channel/UCk9UflimfCIAv7kdAWBxyuA
}
EXPANDED TECHNICAL DETAILS
Interactive Mechanical Savings Hub
A fun and engaging project that turns saving money into a robotic show, where a character "eats" coins placed on its sensor.
- Force-Triggered Event Logic: Uses an IR break-beam or a small limit switch inside the "Coin Tray." When a coin is detected, the Arduino initiates a complex mechanical sequence.
- Servo-Driven Jaw Mechanism: Manages two SG90 servos to open the "Mouth" and tilt the tray into the bank. The firmware ensures the movement is comical and smooth, providing an interactive reward for saving.
Audio Feedback
- Seasonal Sound FX: Every time a coin is eaten, the Arduino plays a "Nom-Nom" sound or a celebratory chime via a piezo buzzer, further encouraging children to save money.