Picture of Ultrasonic gesture based TV remote control
This is a fairly simple project that is designed to introduce key components to a new Arduino user. I created this in a few hours of tinkering using existing Arduino libraries and a SainSmart starter kit. Real world applications could include users who have difficulty using remote controls or are in food preparation areas etc.

The IR code is configured for use with a Sony TV, the library is courtesy of
I also took some IR codes for the TV from here:

Everything else uses the built in Arduino functions and libraries or my own work.
Remove these adsRemove these ads by Signing Up

Step 1: Materials

You will need:
1. An Arduino UNO.
2. An HC-SR04 ultrasonic module
3. An Infra-red LED
4. An appropriate resistor for your Infra-red LED (I used 220R but the signal is quite weak!)
5. An RGB LED (and resistors if they aren't built in).
6. A breadboard and wires.

Step 2: The Electronics

Picture of The Electronics
The configuration is straight forward.

1. Connect the IR LED to pin 3 via an appropriate resistor, and then connect the cathode to GND.

2. Connect the ultrasonic sensor to 5v and GND where the pins specify. Connect the trigger pin to pin 8 and the echo pin to 7. You can configure these pins in the sketch.

3. Connect the RGB LED to GND and pins 11 (red), 10 (green), 9 (blue). These pins are also configurable.
NOTE: Make sure your LED module has built in resistors or you will damage the LED.

debybnya11 month ago

hai mr, I want to createa tool likethis, butI havedifficultyin finding thecode forSHARPtvprogram,could you give mesome help tosource code,thanksbefore:), you can sendit to email :

preddy1264 months ago

hello sir i have onida tv , so i cant run the code which u have given can u please send me the code please give me replay

hi i want to control dslr cameras with ultrasonic is this possible

samj210 months ago

Hey! I wish to do this project, but I own a LG TV..can you tell me what all changes i will need to do? and i wish to change the gesture for the same like, i wanted the volume to change on rotating the finger clockwise and anti clockwise, change channel on swiping with entire hand(like in mobile phone's gallery),so what changes do i make for this?

dan_nicholson (author)  samj210 months ago

Hi, You would need to get a hold of the LG sending protocol and codes which may be available on the internet. As far as rotating your finger to change the volume: the sensor is one dimensional by definition, I don't see a way that you could do that without adding additional sensors and calibrating them to detect that precise motion. Have you considered a Leap Motion controller instead?

and can I use it with my arduino board in the same way? like, just replace hc-sr04 with leap motion controller, and use the same code(with LG sending codes?)

Well, no I actually have no idea about leap motion controller..can u please brief something about it? Also, can I remove my arduino IC and use the programmed IC on a circuit of it's own? (kinda stand-alone?) thank u :)

deepestdreams10 months ago

The code shows an error, check the attached photo.

dan_nicholson (author)  deepestdreams10 months ago

The error indicates that you have not included the IR remote library from correctly.