Inspiration
I chose to create a system that simulates smart wall with emergency system using a circuit consisting of a servo motor, Arduino, Ultra sonic sensor and an IR sensor.
Using thinker CAD to build and simulate the circuit
Electronics I used in the Assignment
servo motor
arduino UNO
IR Sensor
jumper wires
crocodile wires
Ultra Soinc sensor
Components Kit
input Devices : IR sensor+Ultra sonic
Output Devices : Servo Motors + buzzer
brain : the Arduino UNO board
Power Management : from the Arduino
BUILDING MY CIRCUT
Connect the sensor's positive (VCC) to power, the negative (GND) to ground, and the signal (SIG) to pin 8 on the Arduino.
Then, I connected the servo motor: the positive (VCC) to power, the negative (GND) to ground, and the signal (SIG) to pin 11 on the Arduino.
Then, I connected the ultra sonic : the positive (VCC) to power, the negative (GND) to ground, and (echo) to pin 10 on the Arduino and trig to 9.
Then, I connected the Buzzer: the positive (VCC) to 12, the negative (GND) to ground,.
Start coding Arduino on Thinker CAD using blocks
1. Create Variables to Store Values
Go to Variables, click Create Variable, and name it IR.
Create another variable and name it ultra.
2. Read Sensor Data
Drag Set Variable from Variables, and set it to IR.
Connect it to Read Digital Pin from Input, and select Pin 8.
Drag another Set Variable, and set it to ultra.
Connect it to Read Ultrasonic Distance Sensor, select Trigger Pin 9 and Echo Pin 10, and set the unit to cm.
3. Trigger Actions Based on Sensor Readings
If the IR sensor detects an object:
Drag if-do-else from Control.
Drag (≥) from Math, and set it to IR ≥ 1.
Inside do, drag set pin to HIGH, and select Pin 12.
Inside else, drag set pin to LOW to turn it off.
If the distance is greater than 30 cm:
Drag another if-do-else block.
Set the condition to ultra ≥ 30.
Inside do, drag rotate servo on pin, select Pin 11, and set it to 180°.
Inside else, set the servo back to 0°.
4. Reset the IR Variable
Drag Set Variable, select IR, and set it to 0.
Final Result
I asked about the challenges I faced while preparing the files, and the trainers played a big role in overcoming the obstacles.
When I faced difficulties in writing and organizing the code on ThinkerCAD, I turned to an instructor for guidance in understanding and fixing errors. At times, I had to pause and research how to structure the code more efficiently within the platform, as well as ensure the correct connections between different components in the circuit.
One of the challenges I encountered was identifying the main error in the code, as it was not always immediately clear. Additionally, organizing the code in a way that made it easy to read and modify was another hurdle. However, I learned the importance of adding comments within the code and breaking tasks into smaller parts.
For anyone working on a similar assignment, I recommend avoiding trial and error alone. Instead, start by researching the fundamental concepts of ThinkerCAD and the relevant programming principles. Consulting someone with experience can save a lot of time, especially when dealing with unclear errors. Lastly, keeping notes during the process can help prevent repeating mistakes in the future.
I can use ThinkerCAD to design initial electronic circuits for the project before implementing them practically.
Arduino programming will help me add smart features like automatic lighting, sensors, or even remote control in the product.
The coolest thing I’ve learned this week is how ThinkerCAD can be used to simulate circuits before actually building them, making prototyping much easier and error-free.
Something I’ll never forget from this week is how Arduino programming can turn simple components into interactive, smart systems. Seeing how a few lines of code can control lights, sensors, or even small robots was truly fascinating!