Night Lamp
Night Lamp
The assignment of this week to Communicate wirelessly with a Smart Circuit via a Graphical User Interface (GUI) on your phone or PC.
When the weather get Cold we need a smart Night Lamp we can control it by mobile app. and give us a cool colors and music while we are going sleep .
the Night Lamp has many colored light emitted from RGB LED and a strong light from 220 V lamp and controlled it by mobile app .
So I Built a simple smart circuit that contains Three action components ( RGB Led , Buzzer and Lamp with Relay Module ) and controlled it wirelessly by Android GUI on my phone.
Software :
1- TinkerCad Portal : to build and simulate the circuit online
2- The open-source Arduino Software (IDE) : to write code and upload it to the Arduino board.
3- Android Bluetooth Control App. to create the mobile app.
Materials :
§ 1 Android Phone
§ 1 Arduino Uno Board
§ 1 RGB LED
§ 3 Resistors 220 Ohm
§ 1 Lamp
§ 1 Relay Module
§ 1 Bluetooth Module (HC-06)
§ Jumper Wires
§ 1 Adapters (5 V)
§ 1 small Breadboard
Step 1 : Test RGB LED
Design a circuit of Arduino board and RGB LED with 3 resistors ( 220 Ohm) as shown in the picture.
Make it in actual Arduino Board and Breadboard.
then write a c code to RGB LED to emit red color for 0.5 second then green color for 0.5 second then blue color for 0.5 second then white color for 0.5 second.
Code image of RGB LED Circuit
RGB LED Circuit
actual Circuit of RGB LED
Step2 :
add a buzzer to the circuit and write C code to do the same action with RGB LED and make a different tone from the buzzer with each emitted color.
Code image RGB LED and Buzzer Circuit
RGB LED and Buzzer Circuit
actual RGB LED and Buzzer Circuit
Step 3 : test a relay and 220 v Lamp:
Design a circuit of a relay with 220v source and a Lamp as shown in the picture and write the next code to turn on the lamp for 2 second and turn off it for 2 second.
after uploading the code to Arduino the circuit doesn't work and after checking the circuit and insure its right i decide to replace the relay with another one.
after replacing the relay the circuit works fine and the lamp turned on and off.
Step 4: Test the Bluetooth
Design a circuit of Arduino board and HC-06 Bluetooth Module and LED and 220 ohm Resistor as shown in the picture.
Do it in actual component.
Write a C code to test the Bluetooth.
if the Bluetooth receive '1' the LED turned on and if the Bluetooth receive '2' the LED turned off.
open my mobile phone and Pairing the mobile Bluetooth with HC-06 Bluetooth module
open the Android Bluetooth Control App. and it connected with HC-06 module.
Press on Buttons and slider button then I used the first two buttons which send '1' and '2' via Bluetooth.
when press the first button the led turned on and when press the second button the led turned off .
Code of Bluetooth test
Circuit of HC-06 Bluetooth Module
first two button in the app. send 1 and 2 data to the HC-06
after testing all component and insures it works fine i go to Implementation Process.
Step 7 : Integration :
integrate RGB LED , buzzer , Relay and Bluetooth circuits in one circuit as shown in the picture.
Write a C code to do :
§ When receiving number '1' turn on the Red color only in RGB Led and play a tone from the buzzer.
§ When receiving number '2' turn on the Green color only in RGB Led and play another tone from the buzzer.
§ When receiving number '3' turn on the Blue color only in RGB Led and play another tone from the buzzer.
§ When receiving number '4' turn on the White color only in RGB Led and play another tone from the buzzer.
§ When receiving number '5' turn on the Lamp with Relay module only and play another tone from the buzzer.
§ When receiving number '6' turn off RGB LED and the Lamp.
Code of the final code
final Circuit
actual final circuit
video of the final circuit
Step 8 : Enclosure :
1- Design a simple cube with square holes to be cutting easy by manual cutter
So I drew this sketch and I will put the circuit inside the cube.
2- print the faces of the cube with square holes in sick white paper.
3- cut the squares by cutter
4- assemble the faces of the cube with each others.
5- put a Transparent paper inside the faces of the cube.
6- final enclosure
7- put the circuit in the enclosure
The Final Night Lamp
Program, assemble, and wirelessly control a Micro Robot Arm
my team Mohamed Adel , Ayman Mohamed and me helped each other in assembling and code of the robot arm and our Instructors Amani Ayman and Ibrahim Raafat helped us by recheck our code and replace a broken servo motor to complete the makeathon.
I will use the Bluetooth module and it's code and my mobile phone to control the circuit in the final project.
Build and program an Arduino Circuit consisting of Three servo motors to be controlled wirelessly using a mobile app via Bluetooth
Video of Makeathon #2
Title of Media