Introduction: Tv Remote Control Glove Using Arduino, TEJ3 Summative Project
Today we'll be learning how to create a remote control glove for your TV using an Arduino. I made a glove that only uses three fingers, to have all five you'll need flex sensor (5), resistor (5), male-male jumper wires (7) and regular wires (10).
Parts you'll need
- Arduino
- Breadboard
- Flex sensor (3)
- Resistor (3)
- Infrared LED emitter
- Infrared LED receiver
- Male-Male jumper wires (5)
- Male-Female jumper wires (2)
- Regular wires (6)
The technology behind the glove.
In a regular TV remote, the infrared emitter (the light at the top of the remote) sends blinks of infrared light to the infrared receiver inside the TV to tell it what command to preform. Each button on the remote will make the emitter send a different frequency/command to the TV. In a TV remote control glove, the flex sensors on the fingers act as the buttons. Each bend or combination of bends of the fingers will act as a different button and will make the infrared emitter emit a different frequency.
Step 1: Hooking Up the Flex Sensors
Hooking up the flex sensors is the most important hardware component of this project, so be careful and precise!
First, we are going to attach two regular wires to the ends of each sensor in order to connect them to the breadboard, and ultimately the Arduino. To do this we need to solder them as the ends of the sensors are too small for the use of jumper wires. Once we've finished that we are going to use electrical tape to make sure they don't come undone. It should look something like the first picture.
Repeat for all of your sensors and it should look like the second picture.
Now that our flex sensors are ready we'll attach them to the breadboard. We'll also need to attach the resistors to the breadboard to create a voltage divider. This converts the analog value from the flex sensors into a digital value that can be read by the infrared LED emitter. I've included a (poorly drawn) blueprint of where the wires and resistors should go on the breadboard but feel free to google how it's if it's too hard to see. Keep in mind if you're adding more than three flex sensors you'll need to add the same amount of resistors.
Step 2: Hooking Up the Breadboard to the Arduino
For this part consult picture 1. To hook up the breadboard to the Arduino, we are going to use the male-male jumper wires. Attach one jumper wire into the breadboard right underneath each of the flex sensor wires. On the breadboard they're should be (for three fingers) three wires attached the sensors right next to each other, then three male-male jumper wires just underneath, then three resistors. We need to attach two other male-male jumper wires to the breadboard, one on the right if the end of the resistors and one to the right of the flex sensors.
For this part consult picture 2. Now that the flex sensors and properly connected to the breadboard and all the jumper wires are ready, we're going to connect the breadboard to the Arduino. Connect the (in this case) three jumper wires on top of the resistors to the A0, A1 and A2 ports on the Arduino and the two other to the CMC and Vin ports.
Step 3: Hooking Up the Infrared LED Emitter and Receiver.
This is the simplest part of the project. To hook up the infrared LED emitter and receiver you just need to attach a male-female jumper wire to the GND and 1 ports in the Arduino and attach the other ends to either the infrared LED emitter or receiver when needed.
Step 4: Programming the Flex Sensors and Infrared LEDs
int flexSensorPin1 = A0; //analog pin 0
int flexSensorPin2 = A1;
int flexSensorPin3 = A2;
void setup(){ Serial.begin(9600); }
void loop(){ int flexSensorReading1 = analogRead(flexSensorPin1); int flexSensorReading2 = analogRead(flexSensorPin2); int flexSensorReading3 = analogRead(flexSensorPin3);
Serial.println(flexSensorReading1); Serial.println(flexSensorReading2); Serial.println(flexSensorReading3);
//converts to 0-100 int flex0to1001 = map(flexSensorReading1, 1018, 1023, 0, 100); int flex0to1002 = map(flexSensorReading2, 1018, 1023, 0, 100); int flex0to1003 = map(flexSensorReading3, 1013, 1023, 0, 100); Serial.println(flex0to1001); Serial.println(flex0to1002); Serial.println(flex0to1003);
delay(250); //delay allows for easy reading }
The code for the infrared LED receiver should work for you no matter how many fingers you add to your glove, so feel free to copy ours.
For the flexsensors however, if you added more than free fingers you'll need to add the same number of int flexSensorPin and int flexSensorReading as the number of fingers your using.
Once you have the infrared and flex sensor codes, you simply need to add some "if" statements so that if flex sensor X = value Y, then frequency Z is emitted.