I will Complete till the Nice to have features in my final Project idea. I will control the LCD screen and a servo motor using Android GUI , it will be a simulation to the last part in my final project. The idea of the final project is a solar tracker which tracks the sunlight to improve the efficiency of solar panels. In this week , I am going to control this tracker using a mobile app. I will control the direction of the panel using the servo motor , and the LCD display will help in knowing the direction of this servo (0 or 180 degree).
Software: Tinker CAD / Fritzing
1 Breadboard
1 Servo Motor
Jumpers
Arduino UNO
1 LCD display with I2C module
Bluetooth module HC-05
Software: Arduino IDE
Android GUI : Arduino Bluetooth controller.
LCD (i2c) Connections: Output
GND (LCD) → GND (Arduino)
VCC (LCD) → 5V (Arduino)
SDA (LCD) → A4 (Arduino)
SCL (LCD) → A5 (Arduino)
Servo Motor Connections: Output
Red Wire (Servo VCC) → 5V (Arduino)
Brown Wire (Servo GND) → GND (Arduino)
Orange Wire (Servo Signal) → Pin 9 (Arduino)
Bluetooth Module Connections:
Vcc --> 5V
GND--> ground of the arduino
RX---> TX of the arduino pin (1)
TX--->RX of the arduino pin (0)
Steps for the GUI Setup :
I used Arduino Bluetooth controller to communicate between the Arduino and the Bluetooth module .
After connecting the circuit , choose to connect with HC -05 and pair using the passkey 0000 .
after that choose control LED or lamp using a button , here we are going to use this button to control the LCD and the servo Motor .
When the button is pressed , a 0 or 1 is sent through the serial portal , so we have to tailor the condition in Arduino IDE to be if 0 or 1 received .
The code will be simple , it will contain one if condition to check the serial input ,if it is 0 print Move 180 degree and move the servo , if it is 1 get back to zero degree and print it.
Set up all the necessary libraries and variables, like the Servo and LiquidCrystal_I2C.
Get the LCD ready.
incomingdata will be used to store the information coming from the serial monitor.
Void Setup:
Turn on the LCD display, making sure it’s set up with 16 columns and 2 rows.
Start serial communication with the computer, so we can send commands to the Arduino later.
Attach the servo motor to pin 9 and define its movement range.
Void Loop :
The Arduino will keep waiting for you to send a command from the serial monitor.
Once a command arrives:
If the command is '0':
The LCD will display "Move 180 degree".
The servo will rotate all the way to 180° (to one side).
Then it will pause for a second.
If the command is ''1":
The LCD will display "Back to 0 degree".
The servo will return to 0° (its starting position).
Again, it will pause for a second.
The Main problem was in Tinkercad simulation as the Bluetooth module is not found on it. So I used the serial monitor to test my code on Tinkercad and make sure that all works . I used the Keyboard to enter the inputs and it worked and the simulation was smooth .