Wireless controlling
I have been inspired by controlling Arduino's components via smart phone bluetooth module in addition to sending data.
Idea
the main idea is to control 3 LEDs (red, green and yellow) through mobile application that sends and signals to the Bluetooth module which is connected to the Arduino.
Controlling LEDs via Bluetooth
Software tool:
Tinker cad online tool is pretty useful for designing the circuits where I can test the results easily, to avoid any mistakes before the actual test on the bred board.
Arduino IDE for Mac Os
coding and programming hardware components need an intermediate tool to adjust and to operate the code on the electronic circuits. Arduino IDE is doing this function
Arduino Bluetooth control
This app is used to access to the Arduino through Bluetooth.
Hard ware tools
Bluetooth module
Resistor 220 Ohm
Bread board
LED
Arduino Uno
Jumper wires
Software tools
Arduino IDE for Mac Os
Arduino Blue control
step 1: Pseudocode
Sketching all steps as a virtual code to set properties before writing the actual code.
I wrote the code in form of steps to imagine the real action during the preparation process.
Step 2: TinkerCad
Fixing all LEDs on the board.
Connecting all ground terminals for LEDs to the -ve of board then to the GND of Arduino Uno to unify the grounds.
set red Led on pin 2 on Arduino.
set Green Led on pin 3 on Arduino.
set red Yellow on pin 4 on Arduino.
Fixing Bluetooth module
It has 6 pins we will use only 4 pins
GND connected to the common GND on board.
VCC is connected to 5V Arduino's pin.
RX is connected contradictory to Arduino on TX
TX is connected contradictory to Arduino on RX
N.B => I did not find the bluetooth module on tinkerCad
Step 3 Arduino IDE code
1- Before Setup void we need to define some variables.
Defining variable as a character type to save the incoming data sent by bluetooth.
Define and detect connected pins to LEDs
led 1 is connected to pin 2
led 1 is connected to pin 3
led 1 is connected to pin 4
2- Void setup => in this section we need to define all outputs and inputs as well as the commands that needed to be run once at the startup of the code.
Set speed of transferring data on serial with initial value 9600.
Set function for each Led as an output component and other function to control it by using digitalWrite and pinMode functions
3- Void loop => in this section we need to set the functions needed to be looped at certain time or at certain action.
At the begging we need to call the incoming data sent by the bluetooth so we need to make a variable as serial read and given a name incoming_data.
Another class hardware variable needed to translate incoming data which is serial available and both variables are placed inside a while loop.
Using if and if else condition to detect the action while controlling the LEDs.
Set if incoming data variable = 1 so read the LED as high or lit it up.
Set if incoming data variable = 2 so read the LED as high or turn it off.
On the same sequence for the 2 other LEDs
Connection process
It is a simulation process to mimic all connections on tinker-cad.
Fixing each led with its 2 terminals on the board.
using 3 resistors each with value 220 Ohm.
connecting one resistor at each +ve terminal to the LED while the other terminal of the led is connecting to the common ground on the bread board.
Blue tooth module has 6 pins however we will use only 4 where GND is connected to the common ground to board then Arduino.
VCC is connected directly to 5V pin on Arduino.
TX is connected to the Rx on the board.
RX is connected to TX on the board.
Testing process
Double check that all components are connecting properly.
testing the code on serial monitor
Debugging all mistakes in the codes whatever syntax mistakes or logic mistakes.
upload the code on Arduino and run the components.
Bluetooth Mobile app
Download Bluetooth app for android.
pair the app with module MD-BT-49
software challenge
Key configuration
After setting up the mobile app to control bluetooth module I surprised that Keys 5 and 6 have no response.
solution => I started to discover the app and googled the problem I have to change some settings in the app to make the configuration of key identified with values A=1, B=2, C=3, D=4, E=5,F=6
hardware challenges
Uploading code
While I was uploading code on Arduino It gives me an error. I tried many times and I could not solve the problem.
Solution => asking my instructor Nada to help me and she notified me that I have to disconnect wires which are connected to TX & RX in Arduino. Then upload the code again.
Crossing Rx &Dx pins
Conrolling palnts irrigation via bluetooth
Controlling irrigation of plants
One of the main target for my project is to control irrigation of the plants by using a wireless communication such as bluetooth module.
Robotic arm Makeathon
It was unbelievable challenge to design a mini robotic arm with 3 servomotors and control it using bluetooth module. Actually, I realized many tips during writing the code. I was so happy to modify the servo library to be suited for my commands.
something else, the idea of fishing magnetic tools was a mazing.