Inspirational picture of the idea
The assignment of this week was to create a smart device & control it by Bluetooth module.
I decided to create a RGB LED lamp which can change its colors & Intensity through a mobile app.
I- Electronic:
Software:
Thinkercad (to make sure the circuit if functional).
Arduino IDE (to load programming code to the Arduino).
Arduino Bluecontroller (to control the circuit wirelessly).
Material:
Arduino Uno.
RGB LED lamp.
7-segment display.
220-ohm resistor.
Bluetooth Modeler.
Breadboard & crocodile wires.
Power adaptor, Rosetta & USB cable.
Softwares & materials used
I-Circuit (Thinkercad)
Step (1): I started creating the circuit by place & connect Arduino & breadboard together.
Step (2): I couldn't find Bluetooth module among the components available in Tinkercad.
Step (3): So, I simulated the receiver & sender pins by two resistors to have most of my circuit drawn on Tinkercad before building it in real life.
Step (4): I added Bluetooth module photo on PS to show the simulated circuit just to imagine full circuit view.
Step (5): Then, I added 7-Segment display with separate resistors for each pin & connected it to the Arduino.
Step (6): After that I added RGB LED with separate resistors for each pin & connected it to the Arduino.
II-Code (Arduino IDE)
Step(1): I started by setting varabiles & pins depends on the circuit.
Step (2): I sat pins mode as output pins & called serial monitor.
Step (3): I created a loop that contains 6 modes of coloring.
Step (4): I added while loop to provide changing RGB colors change over & over in this case.
Step (5): I decreased delay amount to provide blinking mode.
Step(6): To provide colorful mode I set a value for each varabile then, created a function to change its value to create fading mode & change its direction when reaches the maximum amount of the color hue.
III-Simulation (Tinkercad)
I-Circuit (Building Components)
It was an easy step to build the circuit as it was designed.
II-Mobile Connecting (Bluetooth)
The pairing process between the mobile phone & the Bluetooth module that connected to the Arduino.
To control the Bluetooth module, I needed to download an app called "Arduino Bluetooth Control" from the google play store as shown above.
III-Circuit (Full Circuit)
I faced a problem at mode 4 & 5 that it was a little bit hard to provide changing colors with stable screen read for one mode and that required to create inner while loop to keep on checking the serial monitor read for those modes as shown above.
Learning how to communicate wirelessly with the Arduino using Bluetooth module is a great tool to have in my arsenal, I would like to add a wireless mode to my project if I had the time to do so.
The most fun thing I did throughout the week was the hackathon & I would say that being the winner for the second time is such a great feeling to be the winner of both hackthons :"D