The multiple inputs and multiple outputs devices led me to the smart systems that made me think of the automatic water faucet.
The main idea is when the faucet senses an object within a near distance, it opens a valve to let the water flow for a period of time and then closes. or it can be manually opened.
1- I searched for an idea about smart homes, and then I chose the smart water faucet. .
2- simulated the circuit using Tinker CAD containing (an ultrasonic sensor, servo motor, led light, resistor, slide switch, push button, adaptor 5V and Arduino.
3- used Arduino IDE to write the code and then pasted it into tinkercad.
4- Used the electric components from the electronics kit to simulate the circuit.
The Device Components:
I simulated The circuit on tinker CAD as shown in the video the wiring.
I wrote the code on Arduino IDE and then copied it into the tinkercad.
I used a 5V adaptor to power the servo motor as it requires a higher current than the Arduino could provide.
The device has 2 modes, the manual mode that enable you to control the servo and the light using an on/off switch. And an automatic mode: when the ultrasonic sensor senses a hand around 5cm far it enables the servo to rotate and led to light.
Thus the input components are the on/off switch on the manual mode and the ultrasonic sensor on the automatic mode. The output components are the led and the servo motor.
Tinkercad Wiring
Arduino IDE Code
I started the code with variable identifications.
inside void set-up, I identified the pin modes between input and output.
I tested first the manual mood by the slide switch If. if the slide switch is to the right, it uses the manual switch to let the servo rotate and led light up.
Then I added an else if function to let the automatic mode on.
Inside the else if function I added and if function to take the readings of the ultrasonic sensor and compare them to the required value.
In order to take the ultrasonic sensor readings and searched for its code to take the readings in cm.
Finally, if these conditions are not satisfied, The servo will get back to zero and the led will turn off.
I started simulating the wiring from tinkerCAD to the real Arduino and breadboard.
Then, I uploaded the code from the Arduino IDE to the Arduino itself and connected the adaptor as shown in the video.
Then I tested the two modes
The Prototyped Smart Faucet.
The Real Wiring
Video illustrating the mechanism of the Faucet using a cardboard prototype.
I faced a problem with the wiring. Specifically, the switches. Both the on/off switch and slide switch. I got help from Amany and saw the answers to the smart home of the Saturday session. Finally, I managed to do it right.
Title of Media
Title of Media
Title of Media