Week 8: Arduino Sensors
This week we experimented with Arduino. Using 3 sensors we had to activate 3 actuators. The 3 actuators we used were the servo, LED and buzzer, and the 3 sensors we used were Ultrasonic sensor, shock sensor and tilt sensor.
All circuitry are made through tinkerCAD. Moreover, citations are all given in the comments next to each section of the code. Lastly, all codes edited and written be us have “Edited/written by H.” as a comment next to each section.
Actuator Codes (Our Base)
Circuitry
Code
Ultrasonic Sensor
The ultrasonic sensor is one out of 3 sensors we used. If the sensor detects something or someone closer than 7cm it switches the buzzer on, lights a red LED and the sheikhabot stops moving, whereas when the object is moved, a green LED is lit and the sheikhabot starts moving.
Circuitry
Code
Tilt Sensor
The tilt sensor activates the actuators when the sensor is being titled 180 degrees, meaning it will not activate any of the actuators when it is tilted. The buzzer goes off, sheikhabot moves and the LED emits red light.
Circuitry
Codes
Shock Sensor
The shock sensor activates when the sensor is violently moved activating all 3 actuators : the buzzer makes noise, the led glows red then green and the sheikhabot moves.
Circuitry
Codes









