September 27, 2005
Analog In/Out, Serial Out, Infrared Remote Control
Description of the lab see here.
This week I learned how to send serial signals out from the PIC to be read and understood by a computer. We used a PC program, Hyperterm, to view the serial data. Connecting reminded me of how I used to get on the internet back around '96: Specify the baud rate, the parity, stop bits, flow control, etc.
I figured out how to use a potentiometer wired in series with a 10K resistor to vary the voltage coming in to the PIC, and the resulting numbers that show up in Hyperterm range from 0 (when there are 0 volts, i.e., the potentiometer is at maximum resistance) to 1024 (because we specified that there would be that many steps between low and high).
In the course of trying to find something interesting to use this analog signal for, I thought about the different kind of input devices that were possible: there are force resistors, light-sensitive resistors, heat-sensitive resistors. We use single LEDs to indicate the presence or absence of a digital signal, so why not use one of the analog sensors mentioned above with an array of LEDs to indicate strength of the analog signal coming in? I decided to be fancy and try to create a crude remote control using an infrared sensor and infrared emitting LED.
I went down to Chinatown and found an electronics store where I bought an IR Photodiode, part number NTE3033, and an IR LED, part number NTE3017. I had a lot of headaches with these, mostly because I didn't have a clue how they should be properly powered and installed on the breadboard. I finally got a decent reading from the IR receiver when I wired it like a switch, from power to receiver to 10K-Ohm resistor to ground. But I never got the IR LED to work well. I wired it in series with a potentiometer so that I could vary the voltage on it (I wasn't sure if it uses the same amount of voltage as a normal LED), and I was only able to get big readings off my photodiode when I had the resistance on the pot turned down so low as to almost fry the board.
I had also been told that a digital camera will pick up IR, so that you can see an IR LED shining if you look through the camera's viewfinder. I could see no such thing on my poor IR LED.
Long story short, I plopped down a few more bucks at Radioshack for another IR-emitting LED, and all my problems were solved. On with the lab.
The first idea was, if I am going to make an infrared detecting system, I might as well just go ahead and make a full-blown remote control. I used a 9V battery and wired it together with a 5-volt regulator, a 220-Ohm resistor, the IR LED, and a push-button momentary switch. Here's the battery, wrapped in tape (to prevent its metal outside from creating shorts):

A close-up of the guts of the remote, before wrapping them all up in tape.

The final remote:

When the remote is clicked, you can see the infrared LED glow in the viewfiender of a digital camera:

Here is the original setup. The IR detector is the black blob on the right.

Here's how the board looked after I put the LED bar display in, trimmed all the wires, and bent the IR detector backwards so it would detect a signal coming from above.

This is the Radioshack IR Kit (emitter and detector) that saved me:

And, finally, a movie of the sucker in action, set to the Beastie Boys' "Remote Control" (turn your bass up):

And don't forget the code.
Posted September 27, 2005 12:52 PM. Categories: Labs , Week 3 | Permalink