Intro: RGB Infinity Clock With Own BT App
Normal Digital and Analog clocks are boring, So plan to develop a cool clock with custom colors for Dial, Hour hand, Minute hand and Second hand. For this first want to develop the clock using Addressable RGB LED strip. Then for communication with Arduino to Change color i plan to build a app using App inventor. All are working fine. Lets see it step by step.
Colors are clear with eyes, while through camera it reflect the top glass color blue combined. Or use white one way glass for more better out put even in camera.
Step 1: Materail and Tools Required
1) Addressable RGB LED Strip with 1m 60Leds.
2) Arduino UNO.
3) RTC module for Arduino.
4) HC-05 Blue tooth module for arduino.
5) Plain PCB.
6) Male and Female headers.
8) Mirror and Sun glass.
9) Framing Tape
1) Soldering ion set.
2) Wire Stripper.
Software and Library Required
1) Arduino IDE.
a) RTC Library.
b) Wire Library
c) EEPROM Library
Step 2: Build Shield
1) Building the shiled is our first task. Here we want to connect three items (RTC, Bluetooth, Addressable LED with arduino.
2) For RTC we use A4 and A5 of the analog side and +5V and GRN.
3) For bluetooth we use D2,D3 pins for TX and RX. and 5V and GRN.
4) For Addressable LED strip use a regulated power supply board for +5V and GND. Connect the Data to the D12 of the Arduino.
5) First fix the Male header according to the arduino pin and insert the plain PCB over it.
6 )Solder the male header.
7) For RTC and Bluetooth solder female header on the Plain PCB. use wires and draw track to create ciruit.
Step 3: Assemble the Circuit
1) Now Fix the shield over the arduino.
2) Plug the RTC and Blue tooth module.
3) Connect the Addressable RGB LED light Strip.
4) Connect the Regulator power supply 5v to the RGB LED and 12V to the Arduino.
5) Connect the 12V power supply to the Regulator power supply.
Step 4: APP Development Design
My First Completed Project in Android is Pattern door Lock after that in this project i learn lot in app inventor. Mainly working with colors and Multi-screen links. I use online App inventor2 to develop the android application. Its a GUI based coding online application. Very very interesting to learn and work.
1) My Plan is to connect the Arduino and Android using Bluetooth and want to change the colors of the Dial, Hour, Minute and Second Hands. Additionally if we want to switch off and on the lights we have separate buttons to switch ON and OFF.
2) In the Project i use two screens.
3) First Screen
- In the Top i use a button to pick up the the bluetooth devices and in the side a label box to display the bluetooth status.
- Next row I put a label box to show the APP messages.
- Then a Canvas it covers the major portion of the app. I want to draw the clock in the canvas with the selected color.
- Then four Buttons named Dial, Hour, Minute, Second to pick color from the second Screen.
- Then Three buttons to ON,OFF,MODE.
- A bluetooth client control and Timer in the hidden list.
4) Second Screen (Color Picker Screen)
- In the Color Picker Screen I use two Color pickers image. To change the Images I use two button on the top.
- Then Two Canvas one with circular color and another square palette is used. Only one is visible at the time.
- Then A label box which shows the selected color and a select button to move to the first screen with the picked color.
Now the Design part is completed. Its a GUI coding so in the coding part also we want to drag and drop it continue in the next step.
Step 5: APP Development Code
1) In the First two images i show the full coding of each page.
2) Here i explain the important steps in this project
- All the first is to Pick up the bluetooth. So on click the Bluetooth button we call the addressesand names of Bluetooth.
- Once the Bluetooth is picked in After Picking function check whether the bluetooth is connected or not. If connected send the connected signal to arduino using blue tooth.
- In the Arduino program once the connection is ok. It send back the current colors of the Dial, Hour, Minute and Second. App receive the code and draw the clock again with the colors.
- Now to change the Color of the Dial or any other click the respective button in the lower side of the app. On click the button it call the color picker page with the color already set for it.
- While color picker opens it read the color send by the previous page and set it to the label in that page. Now by using Pick color from the canvas we select the color.
- I use two button to show and hide the circular color palette and square one.
- Then after select the color by click the button we close the page with the selected color in the list.
- In the main page on using otherscreenclose function we get the value send by the color picker screen and set it to the button and redraw the clock and send the data to arduino through Bluetooth.
- Like wise same is repeated for all other color select button.
- Then 3 buttons in the bottom for ON,OFF and MODE. On click function i transfer the instruction to the arduino.
3) I check the repeated function and bring it to the procedure. For example to draw Circle i create a procedure and call it when required. After complete the Circuit and Android Program its time to build the Arduino Program.
Step 6: Arduino Program (Program Attached)
1) To communicate with Bluetooth modile we want a serial port. Arduino default serial port used for debugging. So, use softwareserial Library to create new serial port.
2) Use Wire and RTC library to communicate with RTC module.
3) Use Pololuledstrip library to control addressable LED strip.
4) User EEPROM library to write and read colors and status from Arduino.
1) First write a program to check the addressable LED, then use test program to test the RTC, then use the Bluettoth program and test the module data receive.
2) Now join the programs and check the data received form the Bluetooth, write it on the serial monitor.
3) Then using string functions like indexof and substring in string to get the result from arduino and save it in EEPROM and change the color or mode or on/off the arduino.
4) At first connect with blue tooth it send the colors using string concat and send.
5) Seperate functions to ON and OFF sequence created to call it in time.
Step 7: App Running With Arduino (apk Attached)
App Install Procedure
1) Download the MIT AI2 Companion on your android phone.
2) In the App inventor Website Click Build > App (provide QR code for .apk). A QR code generated in the screen.
3) Open MIT AI2 Companion on your android phone and click scan QR code, once scan click connect with code. The apk download and installed on the mobile after ask permissions.
4) Or Simply in the App inventor Website Click Build > App (save .apk to my computer).
5) Copy the apk to mobile and install.
1) After install u found your app on the home.
2) At first open the bluetooth in the mobile and connect with the HC05 bluetooth module.
3) Click the app on the home screen. In the screen click Pick BT. Select the HC05. Once connected the Saved color from the arduino read in the android and clock repaint. Then use buttons to ON/OFF/Change mode. Use Dial, Hour, Minute and Second button to change the color.
Download My apk
1) If you feel dont want to waste time in Android development then simply download the apk attached here and install on your mobile.
Step 8: Check the Function
After Upload the program to the arduino and install the APP apk to the android mobile. Check the functions before arrange mirror.
Step 9: Make It Infinity (Glass Arrangement)
1) The total length of the led strip is 1 meter(100 cm). so the circumference of the clock is 1 meter(100cm). From circumference calculate the diameter it is 31.831 cm. So i purchase a 38 X 38 square Mirror and one side reflection glass.
2) Cut a thermocol sheet to the same size.
3) Cut a circle of Dia 31.831 cm in the center of the thermocol sheet. Its a very sculpturing work if use thermocol.
- If you have cardboard just paste the LED strip over it cut it and bend to make circle. Because it almost cost me 2 hours to sanding to correct size.
4) Paste the RGB LED Strip in the center circle.
5) Carry the wire out through the sides.
6) Place the mirror in the bottom and Put thromocol with light strip over it.
7) Place the one side reflective glass over it. and now check how it works.
Step 10: Testing Before Completion
This is the testing image before Framing.
Step 11: Framing and Boxing
1) With out moving the glasses use framing tape to join all together in all side. Because of glass are weigh high i tape it two times.
2) Then Move the wire out from the clock to the back side and box the circuit and hot glue with the mirror on the back side. In the box let the power come in and connect the out put to the led strip.
3) Now all the work is finish. Its time to run.
Step 12: Infinity Clock Pictures
Arrange it to hang on the wall or stand on the table (Because of using thick glasses by me it make it stand ). We use it as night light if required. Use mobile to control its colors or turn off if not needed. In the above picture first 3 images shows the various mode.
Step 13: Clock Modes
Video for all three modes
1) MODE 1 - All the Second line glow.
2) MODE 2 - All the Minute line only glow.
3) MODE 3 - Only Hour, minute and second hand only glow.
Step 14: Clock Color Change
ON, Color change and OFF
Step 15: Mode Change
Its very amazing to watch the infinity clock. Also change the codes for load default color change by the library and check. Its very superb. Here i share the Clock mode change and color change videos.
Go through the work. If you make it and Vote for it i feel very happy.
I am very very happy to learn and make new things. Let share yours then Happiness multiply.
Thanks for watching.