Well this week assignment idea was inspired from EO week session so I decided to make a mimic for a smart lamp and window for the house.
Tinkercad
Tinkercad is a free, web-based application that allows users to create 3D models, electronic circuits, and code blocks in an easy-to-use, beginner-friendly interface. Used for simulation also.
Arduino IDE
Arduino software system used to check and write the code for arduino then upload it on arduino board.
Arduino Bluetooth control
The Arduino Bluetooth Controller Application make to able to remote control your device with Bluetooth Module and Arduino Board.
Relay module
Bluetooth module
Arduino uno and its cable
Servo motor
Light bulb
9V adaptor
Jumber wires
Rosetta
Breadboard
The main idea of this device is to control the circuit through the Bluetooth module, through (GUI) on the phone.
Started by adding the components I need in my workspace and also available in my electronic kit.
Then connected each component to the breadboard and to specific pins on Arduino.
connected the Servo motor to pin 10 on Arduino.
Before the void setup part
before writing the code in the void setup part, we have to define the components and their pins on Arduino, so that when i include them in the code it's understandable for Arduino.
The components and their pins are defined as int(integers).
the relay was on pin 9.
The Servo was on pin 10.
And the Bluetooth module default number is 0.
Void setup
In this part we are supposed to write any action that we need to be repeated only one time.
Also we define the inputs and the outputs in this part.
Bluetooth : input.
Servo and relay : output.
Void loop
in this part we write the action that will be repeated so many times as long as we need to.
I used the if condition to define the buttons that will send signals to the Bluetooth module to turn on the bulb and the Servo
Code logic:
simply the code states that when i press 1 on the mobile Bluetooth application, this sends a signal to the Arduino that turn on the lamp and print on the serial monitor Light is on, and when i press 2 on the mobile app the lamp is turned off print on the serial monitor Light is off, and when i press on 3 the servo motor turn 90 degree and print on the serial monitor window opened, and i press on 4 the servo motor go back to 0 degree and print on the serial monitor window closed.
I added the components to the breadboard.
Connected each component to the Arduino as I designed in tinkercad.
Uploaded the code and tested the components.
Then tested the whole device and it worked.
Challenges:
Couldn't find some components on tinkercad so I used Paint software to add this components by using pictures to design the whole circuit and I couldn't use frizzing cause I didn't find the free version.
Will in this week I learned more about electronics and coding based on texting.
Making a robot arm for the first time was an amazing thing to do actually
Title of Media