Same fan but smart 😅
For week 7, I didn't really had much time so I decided to make the fan I made before smart, has a music tune and has better enclosure this time. ( the only thing I could came up with that is NOT a direct replication of ANY POSSIBLE exercise or week example)
At first I wanted to make it a music box but I released that using buzzer for such function takes a LOT of coding.
TinkerCad
9V adaptor
breadboard
Jumper Wires
Arduino UNO
DC fan
1K ohm resistor
Push button
Buzzer
Ultrasonic sensor (HC-SR04)
Crocodile wires
Arduino IDE
First I added my first feature components (music feature):
-) Arduino Uno
-) Breadboard
-) Buzzer
-) Push Button (not this one though)
-) resistor and connections
Then Added Second feature components (automatic fan):
-) Ultrasonic sensor and its connections
-) Dc fan (simulated by the Dc motor)
Code took most of the assignment's time since i wanted an easy tone but still something I like.
Tried the code in TinkerCad and it gave me the results I wanted, so I copied it back into Arduino IDE and uploaded it on arduino.
First, Buzzer was connected to the arduino using Breadboard.
Then using crocodile wires and jumper wires, the push button was connected.
Ultrasonic sensor was connected using the same jumper wires colors to avoid any confusion.
Then Dc fan was connected.
Arduino code was uploaded after checking again its syntax and logic, then first trail was a success.
Basically, this code is made so when the Ultrasonic sensor detects something in range of 20 cm, the fan works automatically, Also the tunes are editted in the code with notes written beside them, 2 tunes keep repeating as long as the user is pressing the pushbutton, and it is meant to be always connected to a power source since the main function (fan) is automatic anyway. (ino file is in the files section below)
Then cardboard-ing step came and here I just switched the previous breadboard was the smaller one (same connections).
Used duct tapes only to ceil the top side and make edges look a little better.
Coming up with an idea that can make sense was a total failure, that's why I used an old Idea of mine, but I guess this was the week's name (making things smarter).
also the breadboard was too big for few connections only while I had small space, so I replaced it with the smaller one.
smaller breadboard, wider space
This week's assignment was by far the hardest, yet, I managed to achieve, also the idea of having many inputs controlling many outputs was not as challenging as making sure that the code is logical and working well, so the final project's coding now seems easier.