Turn On Lamp by Arduino, Bluetooth and Android Phone

on
Categories: English, Mikrokontroller, Produk

After long time of making its application for android mobile phone, finally the video on how to use it could be produce.

This is a device that can be used or installed at your house to replace the function of an electric switch which enables you to turn on your electric devices from a long distance using an android mobile phone. Other than home installation, the device is usually ordered to be installed on a vehicle as I did on my motorbike and car.

The installation on a motorbike is usually used for turning on the machine in a motorbike modification contest by mobile phone, turning on the machine, the alarm, and etcetera.

Actually the device in this video could work without Arduino control application from duwiarsana.com but it may be quite involute because we have to use terminal and type an order on the keyboard of our android mobile phone.

By using the Arduino control application we could activate the lamp or let say “relay”, then the “relay” turn the electric load on like a lamp by connecting electrical current like righteously a switch in just with pressing the lamp icon in the Arduino control application.

The working system from this device is by accepting a special character which send from android mobile phone through Bluetooth communication. Of course this character has been defined in android application that has been made. For example, “a” character is used for turning the “relay” 1 on and the “b” character for turning off that “relay”.

Therefore, 1 button has 2 conditions sent through Bluetooth, the condition of on button and off button.

Baca juga  Membuat Display Mata Uang Asing Update Otomatis

This android application I created using android studio application that you can also install on windows operation system, OSX, and Linux.  Its use is not too complicated, you just have to understand more about the “c” language and java as well.

Meanwhile sketch for the microcontroller or the hardware I wrote in arduino IDE software. The schematic and the layout I drew using eagle software so you can download the file down here and open straightly to the eagle PCB software.

You can download the android application for free in play store. For the schematic of the device, you can check it, it only using a single microcontroller and an IC siftregister to turn on the installed 8 relays.

[appbox googleplay com.arduino.led]

[appbox googleplay com.arduino.led]

[ads1]

There are 8 light buttons as you can see from the image sample. The 8 buttons represent the 8 relays which installed on the device of android switch just like in my video. You can try it with the common Arduino without assemble it anymore. First, you can simulate the relay using Led only. For the Arduino sketch, you can download at the link below. You can use it and modify it for a learning purpose.

Why is this device turn the relay on according to the letter received? The answer is because of this:

if(Serial.available()>0)
  {
    char in=Serial.read();
    if(in=='c')
    {
       setRegisterPin(0,HIGH);
       writeRegisters();
       Serial.println("c");
    }

The meaning of that coding is that the microcontroller reads the serial data that enters trough Bluetooth and accommodated for while in “in” variable. If the entered character has “c” letter then the register pin 0 or the first in IC siftregister will be given high signal and activated when the coding calling the “writeRegiters();” function, and then microcontroller sending the “c” character again to the android phone so that the button in the android application change in color.

Baca juga  Simpan Password Keypad di EEPROM

Besides can be turned using the android, this device can also be powered using a TV remote, how come? Just check the schematic, I also installed a tv’s sensor in it and I created the function inside the coding to read the tv remote data and turn the relay on as well. So, what are you waiting for, go ahead and just download it.

You can also buy the PCB itself through duwiarsana.com

  • Bluetooth HC-05

    Modul bluetooth yang cocok digunakan untuk membuat project mikrokontroler wireless.

    (0 reviews)

Download the schematic and its Arduino sketch from discussion forum

[sociallocker id=2480]

[button color=”orange” size=”medium” link=”https://www.dropbox.com/s/mteotm2hijkih2a/8ch.sch?dl=0″ icon=”” target=”false”]DOWNLOAD_FILE_SKEMATIK_EAGLE[/button]

[button color=”orange” size=”medium” link=”https://duwiarsana.com/forums/topic/coding-android-arduino-control/” icon=”” target=”false”]DOWNLOAD_CODING_ARDUINO[/button]

[/sociallocker]