3
\$\begingroup\$

Before you judge me, I'm fairly new to electronics besides the very basics, so be gentle. However, I'm quite proficient with computers at a high level; I'm decent at writing code, and have experience with Java, C#, and JavaScript.

Basically what I want to is send an IR signal from a computer to an IR receiver in a box about 2-3 feet away. (yes, it has to be IR.) Once the receiver gets the signal, it needs to turn on one of five small motors for, oh, 500msec, (each of which take in ~1.5-3v) depending on which of 5 signals is sent to it.

Now there are several parts to this:

1. Sending the IR signal

This transmitter must send data at least 2 feet, up to 5. (Shouldn't be an issue, I think). I'll need to control it via USB. I've found two:

http://adafruit.com/products/387 - a cheap ($.75) IR LED. However, I'm not sure if one of these can send multiple signals.

I can't post more than 2 links, so search Amazon for Syba SD-U1IRDA-NM USB Fast Infra-Red Adapter - a more expensive ($12) IR adapter. One of the pros of this is that it already has a USB port.

2. Receiving the IR signal

The receiver must be fairly small (maybe up to a max of 2 cubic cm). So far I've found one:

http://www.adafruit.com/products/157 - only $1.95. It's small, seems like it'd work, is cheap, etc. If there are any problems with using it, I'd love to know.

3. Processing the IR signal & doing stuff

Now, something needs to move the motors. I'm guessing a PIC (not sure which one, please suggest one) since they're cheap, popular, and a relative gave me a PIC programmer, circa 2006 (I assume this doesn't matter), for last xmas (she had no clue what it was - but someone told her it was a good present for a programmer)

This is the area I'm most fuzzy on. I guess that I'd somehow connect power to two legs of the sensor, connect the third leg to part of the PIC, have the PIC run some simple code to figure out which of the 5 signals it received, and then turn on power for one the 5 motors, turning it off ~500msec (in no way has to be precise) later.

tl;dr: Which, if any, PIC should I buy? Which IR transmitter works? Does this IR receiver work? How do I program the PIC and how should I wire it to control the motors?

\$\endgroup\$
  • \$\begingroup\$ Just a note about the signals. IR usually uses encoding, like a barcode. For example your television remote has but one IR emitter, yet can send dozens or hundreds of different codes. In simple terms, the desired operation is encoded in a series of pulses, and the detector decodes those and then carries out the corresponding action. \$\endgroup\$ – JYelton Jan 8 '13 at 0:28
  • \$\begingroup\$ @JYelton: So basically you're saying that I can use the IR LED instead of the USB thing - but I'll need another thing there to send various series of pulses? \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 0:58
  • \$\begingroup\$ You can send signals with an IR LED using various means. You could use a microcontroller (just like a remote control) or simply build a USB device that gets the encoded pulse information from the computer. The key here is that you will need some way to generate the pulses. Simply providing power to an IR LED won't generate any meaningful data. \$\endgroup\$ – JYelton Jan 8 '13 at 1:11
1
\$\begingroup\$

You can build a simple RC5 decoder using a PIC microcontroller.

Transmitter: Use a universal remote with Phillips TV settings. RC5 is a protocol designed by Phillips for their TV, VCR, etc remote controls. By using RC5 protocol, you eliminate the need to design your transmitter. Just use any universal remote control and program it for Phillips TV. I have seen universal remotes floating at 99-cents only stores in Southern CA.

Receiver: A RC5 decoder can be built around a PIC microcontrooler. Take a look at RC5 Decoder with PIC Microcontroller. This article describes RC5 protocol, hardware and software needed to decode RC5. You many have to change the code to your taste. To drive motors, use simple transistor drivers at PIC outputs. The motor driver depends on the type of motor you are using.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Awesome, thanks! The only problem with using the universal remote as a controller is that the transmitter must be computer controlled - and since I have to make a lot of them, it might take a while to disassemble and create a lot of little USB dongles using the Phillips remote, plus I'm not sure how I'd convert a remote into a USB device. \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 1:30
  • \$\begingroup\$ You can also look at USB Infrared Toy. It is an open source design and may help you in developing USB to IR interface. \$\endgroup\$ – Chetan Bhargava Jan 8 '13 at 3:36
  • \$\begingroup\$ That would be perfect if not for its' high price. I think I might end up using the IR transciever from Amazon - it's $8 less expensive, which adds up quickly when you have a lot of devices. I think that sourceforge.net/projects/winlirc will help me control the device. \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 3:52
  • \$\begingroup\$ @OwenVersteeg in my opinion costs/prices should be considered only when doing a commercial large scale production. I don't know if your application is a commercial one. If it is, you can definitely absorb some USB development costs. You should do a cost-benefit analysis and see if a commercial IR product is worth your endeavor. \$\endgroup\$ – Chetan Bhargava Jan 8 '13 at 3:57
  • \$\begingroup\$ I'm not doing this commercially (although I might later) but I am building 50. So choosing the Amazon one saves me $400 if it works - and I don't see any reason it wouldn't. \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 11:38
1
\$\begingroup\$

Your question is asking a number of sub-questions, which could (and should) probably be questions of their own when you get to that point.

But to address things in a macro perspective:

Sending the IR signal:

A simple infrared emitter (IR LED) is all that is used in most common household remote controls. You can easily find these from any reputable electronics source. The distance you need to cover (2-5 feet) is trivial for most of these. It can become more difficult with interference or IR saturation such as in the outdoors from sunlight, but I'm assuming your application is indoors/office. You'll want to use something 900nm to 1000nm (NIR) in wavelength; my recommendation is to avoid ones listed at 890nm or below, as some of them can emit visible light. (Though that recommendation is more for IR illumination of night-vision camera equipment than remote controls.)

Viewing angle of the LED is important, because it will have an effect on how well the emitter and receiver must be aligned. An Optek OP265W has a 90° viewing angle, which gives a lot of coverage, but may diminish the brightness (and thus operating range). However you said your range is small (2-5 ft.). They also have 18° angle packages, which I'd use for a longer-distance application.

Receiving the IR signal:

Match the emitter in wavelength and frequency, mainly. The one you linked is most sensitive from about 900 to about 970nm. Its datasheet shows that there are various carrier frequencies which make one part or another more or less ideal. For example, the TSOP38238 is recommended for 38 kHz applications. (More about frequency next.)

These devices are small, usually no larger than a 5mm through-hold LED or a standard TO-92 transistor. But consider you will need some supporting circuitry to drive the receiver and decode signals, and also drive the motors. Which brings us to:

Processing the IR signal & doing stuff:

Let's say you have the IR receiver on a small board, what else is there? Well, you'll need a microcontroller to decode the pulses, some transistors or relays (or combination of) to drive motors, and of course a power supply. So don't forget these critical items when calculating the space needed for the receiver and its associated electronics.

You can definitely use a PIC (or any other micro), and probably recommended since you did mention you have a programmer already. Though I am not a PIC expert, you'll want to ask about the programming aspects separately.

Generating (and decoding) the pulses usually is done with pulse width modulation, in which you vary the length or duration of pulses on a clock. For the receiver you linked, the frequencies are in the 30 to 56kHz range. There are a lot of articles about encoding and PWM, you'll need to research what seems right for your application.

You'll wind up connecting the IR sensor to the PIC, with some supporting filtering components, and also connecting some output pins to the motors. You didn't mention what size of motors, or if they are steppers, DC or AC. Those attributes are going to affect what components you select (power transistors, relays, etc.). Since you need 500ms pulses, I'd recommend looking for power transistors or MOSFETS but more information is needed before anyone can make a recommendation.

Edit:

The motors you mention are 1.5-3 volt, which I assume to be small DC motors. They're still going to take (almost assuredly) more current than the micro can source, so you'll need to look up motor driving circuits from micros. Here's one from Seattle Robotics.


To sum up, you'll need to research methods of encoding for IR transmission (pulse-width modulation is most common). Also look at ways of driving motors from microcontrollers (lots of information on the net) - the bottom line is that you can't drive the motors with the micro directly; it cannot provide enough current.

I suggest you break the project into smaller pieces and ask about them specifically as needed, you'll get more detail.

Some useful references:

\$\endgroup\$
  • \$\begingroup\$ In respect to the motors: You're correct - they are. But I don't need a constant speed for these motors at all, so I assume I don't need a motor controller (trying to keep everything very small) \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 1:57
  • \$\begingroup\$ The LED you mentioned was 890nm. Is this close enough? The LED I originally found was only 20 degrees; I think I might need a 90 degree one like the one you referenced. \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 2:18
  • \$\begingroup\$ You might need to experiment with the viewing angle. At the close range you're talking about, I don't think it is of critical importance. Also, with the motors, you didn't go into detail about what you are trying to do with them. A motor controller (PWM) may or may not be needed. It all depends. \$\endgroup\$ – JYelton Jan 8 '13 at 6:26
  • \$\begingroup\$ @JYelton I might use the transciever from Amazon simply because it's less work for me (otherwise I have to make 50 transmitters by hand) + I should be able to control it via Windows APIs easily. \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 23:31
  • \$\begingroup\$ Also, for the motors: I think for now I just want to make devices where it notifies the user via a vibration motor. (I had another idea that I would maybe want to use a PWM for, but for now I'm sticking to this idea) \$\endgroup\$ – Owen Versteeg Jan 8 '13 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.