Arduino Bluetooth IR Remote Controller Project

Conclusions



  Project Conclusions


To conclude, I want to say something about what I learned from this project and report some ideas for improving it.

This experience helped me to extend my knowledge on Arduino programming and learn something about Android app development, the lifecycle of an app and the differences between pc vs mobile development. Moreover, due to the not really small dimensions of the entire project, I learned a little better how to manage all the resources and files needed by the project.

Even the website creation has been instructive, sometimes challenging to make it looks and works as I wanted it to.

In my opinion, this project has some undeniable advantages:

  • It’s a universal remote, you can theoretically use it with any IR device maybe extending its supported protocol list.
  • You can give to any smartphone without IR-blaster the capability to emulate it and control IR remote devices.
  • Thanks to Bluetooth connection, you can place Arduino near the target device and use your smartphone as remote controller from any room, no need for it to be directly visible from the receiver - as is for a normal remote controller.

Of course, perfection is unreachable and there are many things that can be improved or maybe even redesigned from scratch.

Some of them could be:

  • No database with predefined commands.
  • HC-05 uses the Bluetooth 2.0 revision, which doesn’t have a wide usage distance range. Bluetooth 4 and higher or even better wi-fi connection would be preferable.
  • Few protocols are currently supported – the most common ones – but the user should be able to add more of them quite easily following the current structure. A little tutorial is reported down below.
  • Android app could be improved if you are familiar with Android programming - more than I am.

  Tutorial for Adding New Protocols


I want to write here a little tutorial if you want to add new protocols.

First of all, add mySerial.hpp to your source file for using mySerialPort instead of SerialUSB or Serial5 or any other Serial of your Arduino board you want to use. It helps because it is defined once for all, so you don't have to rename every Serial into your sources if you decide to use another Serial port. Then add Leo_IR_Timer.hpp to use Arduino built in TC3 timer. You have to pass it the output pin, which is defined in the .ino sketch.

The timer must be enabled before starting a transmission and should be disabled at the end.

I suggest you to follow the other protocol classes structure for your sources, in particular for measure units for variables passed to Timer functions.

Inside Leo_IR_Read.hpp and Leo_IR_Remote.hpp you have to include your protocol source files, create and initialize it as an object.

Leo_IR_Read.hpp class performs the first part of decoding, identifying which protocol is going to be received and decoded. You have to add inside decodeProtocol() function a new entry to distinguish your protocol from the others - perhaps looking at the duration of the start frame - and call the decode function inside your sources.

Leo_IR_Remote.hpp class is the entry point when you have to send a stream. It asks the user which protocol must be used and data to be transmitted (in HEX coding). You have to add your setupSendXXXX() function to ask and check the string and then call the proper send() function inside your sources.




In the following video I'll show how it all works.

Here I'm using Arduino to control my USB TV tuner by AVerMedia, which has its own remote controller. I'm going to connect my old smartphone to HC-05 module via bluetooth, decode the On/Off button and memorize it in the corresponding application I/O button. You will see the TV tuner program starting up as soon as I tap the I/O button.




That's all!  


  Credits


List of useful links, websites and documentations: