Due to high strong heat waves during summer a smart portable fan is needed - this is the inspiration of this project
Tinkercad
Electronics kit
Arduini IDE software
Arduino uno
First thing I grabbed the needed components :
- Arduino - Ultrasonic sensor
- breadboard - DC motor/buzzer
- wires
Fist I started by collecting my components and connecting them using breadboard
this is a parallel circuit connection between the the sensor and the buzzer
as the sensor has transmitter and receiver it uses two digital pins , 3 &4,
placed the output into another digital pin 5
connecting the negative and positive ends to the GND and 5v in Arduino respectively
*using buzzer to simulate fan as output in tinker CAD*
Moving to the code - using code blocks
here we have one input (ultrasonic sensor) and one output (fan/buzzer) controlled by the Arduino.
the plan was to turn on the fan when there is object in front of the the sensor
if there is an object less than 10 cm away from the Ultrasonic sensor
then turn on the fan / buzzer
else - or if there is no object 10 cm in front of the sensor
then turn off the fan
Testing the code
wiring the components to Arduino and mini breadboard .
uploaded the code to Arduino IDE .
finally compile and upload the code to Arduino and test it .
Code : week 6
Final Result
Title of Media
In TinkerCAD, when using the sensor with the motor, the code didn't work unless I added a map function, as it requires motor driver. When connecting the actual circuit, it wasn't working properly, like the sensor was not limited by distance. That's why I replaced the motor with a buzzer to simulate the correct code.
Title of Media
Title of Media