This assignment of this week is design and program a smart device that perform a certain function or solve a problem: program Arduino UNO to read signals from multiple input components (Sensor, Switch, or variable resistor) to control multiple action components (Motor, Buzzer, LED...etc) using Arduino C (Text Code).
I got my inspiration from my childhood piggy bank.
The idea is to create a box that senses when a coin is in the hole. After that, with movement, the hole opens, and the coin falls...
Smart Piggy Bank
After I decide the project idea I start to design the circuit on Tinker Cad.
It is consist of:
Input: IR sensor - Potentiometer
Output: Servo Motor - Buzzer - LCD I2C
Circuit Link on Tinker CAD: https://www.tinkercad.com/things/ieREegEqIkU-piggy-bank
1- The LCD screen displays the total saved amount → (lcd.print("Amount: " + String(totalAmount) + " LE");), and the IR sensor detects inserted coins → (digitalRead(IR_SENSOR_PIN);).
2- When a coin is detected, the servo motor moves → (myServo.write(90);), to allow the coin to pass, then returns to its position → (myServo.write(0);).
3- A buzzer sounds to confirm the coin deposit → (tone(BUZZER_PIN, 1000);), and the total amount increases → (totalAmount += coinValue;).
4- A potentiometer can also manually trigger the servo to add a coin → (int potValue = analogRead(POT_PIN); if (potValue > 512) { moveServo90ThenBack(); totalAmount += coinValue; }).
5- The LCD updates with the new total → (lcd.clear(); lcd.print("Amount: " + String(totalAmount) + " LE");), and the process repeats continuously inside the loop() function.
Title of Media
Chatgpt was a great help in this project.
The way of how the coin will fall was a challenge, I want to make it smart... This video gave me the technique.
This week, by chance, some of my diploma colleagues and I attended the Maker Faire event. It was an amazing day and truly inspiring to see so many makers whom I have learned from on social media.
Title of Media