Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: bhengsoh on June 13, 2011, 11:50:48 AM

Title: Need help in serial infrared modulation
Post by: bhengsoh on June 13, 2011, 11:50:48 AM
Hi. I am building a robot that will be guided to 3 different locations using infrared. What I'm planning to do is to have IR transmitter in each location to transmit modulated signal to the robot. My problem is how to design a circuit that can transmit different serial code through IR, and the robot can differentiate the signal from different IR source.

So far, what is in my mind is to use parallel to serial register IC to change into serial data, and modulate it using 555 timer. But I very unsure whether this is the correct way.  If this is possible, what are the common IC available and how should the circuit look like?  ???For receiving part, I will be using PIC16F877A microcontroller with IR receiver.

Another problem is how to make the robot stop like 1 meter before it reach the IR transmitter.

Pls give me your opinion. Ty.
Title: Re: Need help in serial infrared modulation
Post by: Soeren on June 13, 2011, 04:49:11 PM
Hi,

Hi. I am building a robot that will be guided to 3 different locations using infrared. What I'm planning to do is to have IR transmitter in each location to transmit modulated signal to the robot.
Are they supposed to transmit concurrently?
(That may be problematic on the receiving end).


My problem is how to design a circuit that can transmit different serial code through IR, and the robot can differentiate the signal from different IR source.
In other words, your problem is how to make either circuit then - sounds like you're in for a steep learning curve - are you ready for that?


So far, what is in my mind is to use parallel to serial register IC to change into serial data, and modulate it using 555 timer. But I very unsure whether this is the correct way.  
There is no right way and wrong way, but there's ways that minimize errors, give a smaller footprint and is easy to maintain - and then there's the opposite, involving cascades of components.
Personally I'd never go the way you suggest, but it really is your decision.


If this is possible, what are the common IC available and how should the circuit look like?  ???
The most common IC for this would be a microcontroller - Since you are using the F877', I'd suggest you look at the PIC10F2xx family, as they are brilliant for such tasks (and dirt cheap).
The schematic is really boring though - a 6-pin controller with a resistor and an LED or a transistor to drive several LED's, which you'll need to get it to cover 90° or whatever angle you need.


For receiving part, I will be using PIC16F877A microcontroller with IR receiver.
OK, just make all towers transmit on the same carrier frequency and perhaps you need to use several receivers to cover 360°.
To avoid the IR signals mixing (making them unreadable), you'd have to enable them one by one (1-2-3-1-2-3-etc.) and that could be accomplished by either yet a controller or a 4017 driven by an oscillator.


Another problem is how to make the robot stop like 1 meter before it reach the IR transmitter.
You could use a Sharp distance sensor like eg. GP2D12.
Title: Re: Need help in serial infrared modulation
Post by: bhengsoh on June 14, 2011, 02:28:04 AM
I have changed my mind.

Now, one IR beam of the 3 transmitters) is to modulate the TX carriers with 3 different frequencies. This will be equivalent to sending 3 different patterns (continuously) as in the following example:

00001111… equivalent to frequency= F
00110011… equivalent to frequency= 2*F
01010101… equivalent to frequency= 4*F

But for receiver side, I need to use serial pin to decode it? If yes, what is the logic behind it?
Title: Re: Need help in serial infrared modulation
Post by: Soeren on June 14, 2011, 04:53:30 AM
I have changed my mind.
Why?


Now, one IR beam of the 3 transmitters) is to modulate the TX carriers with 3 different frequencies. This will be equivalent to sending 3 different patterns (continuously) as in the following example:

00001111… equivalent to frequency= F
00110011… equivalent to frequency= 2*F
01010101… equivalent to frequency= 4*F

But for receiver side, I need to use serial pin to decode it? If yes, what is the logic behind it?
You're just making it much harder on yourself this way.

Using one carrier frequency, you can receive all signals with the same integrated IR receiver.
You won't be able to get the integrated IR receivers in F, 2F and 4F, so you'll need to design and build sensitive IR preamplifiers - not a task for the uninitiated.

Sending F, 2F and 4F concurrently from one tower will give you a headache, as they mix into sum and difference frequencies - you'd be much better off using just one carrier as I described.
Title: Re: Need help in serial infrared modulation
Post by: waltr on June 14, 2011, 06:55:21 AM
To add to Søren's comments:

Google "PIC IR remote receiver" for many projects and examples that can be adapted to your requirements.
Title: Re: Need help in serial infrared modulation
Post by: bhengsoh on June 14, 2011, 07:23:59 AM
Quote
You're just making it much harder on yourself this way.

Using one carrier frequency, you can receive all signals with the same integrated IR receiver.
You won't be able to get the integrated IR receivers in F, 2F and 4F, so you'll need to design and build sensitive IR preamplifiers - not a task for the uninitiated.

Sending F, 2F and 4F concurrently from one tower will give you a headache, as they mix into sum and difference frequencies - you'd be much better off using just one carrier as I described.


Correct me if I am wrong, but you might have misunderstood it. What I mean is to have the modulating frequency changed, not the carrier frequency. This way, I can still using one integrated IR receiver.

This is the TX circuit I going to use. What I will do is to modify the modulating frequency at left part of circuit.
http://electroschematics.com/782/infrared-light-barrier/ (http://electroschematics.com/782/infrared-light-barrier/)

Please comment if you think this is not the way.

Rest of problems will be IR interference, C program in RX side and to stop the robot when it get too close to the IR TX.
Title: Re: Need help in serial infrared modulation
Post by: Soeren on June 14, 2011, 06:01:23 PM
Correct me if I am wrong,
So far it didn't help any.


but you might have misunderstood it. What I mean is to have the modulating frequency changed, not the carrier frequency. This way, I can still using one integrated IR receiver.
Sure, but you'll still have problems with sum and difference frequencies from the modulation.


Please comment if you think this is not the way.
I already gave you the way that I find best and I don't think I can add anything more to that presently. If you choose to ignore it and make something else, it's your call of course - but why do you ask if you are going to ignore the advice you get anyway?
Title: Re: Need help in serial infrared modulation
Post by: bhengsoh on June 15, 2011, 09:28:03 AM
Sry I didn't know PIC10F20X is so cheap....Ty for your criticism. I have PicKit2 Programmer, but need to know what is the circuit to program it?

Or maybe you have easier way. I really do appreciate your advice.
Title: Re: Need help in serial infrared modulation
Post by: waltr on June 15, 2011, 12:52:09 PM
Quote
but need to know what is the circuit to program it?
Did you read my post above?
The info you need is out there on the web.
Title: Re: Need help in serial infrared modulation
Post by: bhengsoh on June 16, 2011, 10:43:01 AM
Quote
but need to know what is the circuit to program it?
Did you read my post above?
The info you need is out there on the web.

Yes. But their modulation method is too hard for me, I can't rly understand and dunno how to modify it(very bad in assembly). Maybe will try if no other method can work...Maybe u can guide me on how to modify it to always transmit signal. But receive signal only when I call it as subroutine.

As of IR interference, I will use IR TX with controlled angle, and point them at different direction.

Anyway, this is my problem so far.
At TX side, I make an signal generator with PIC10F w/o carrier frequency for simulation.
At RX side, I use USART with baud rate specified as around 3221 bps. I dunno what is going wrong, could be the logic or program is wrong...

Output should be 1 but it shows 0, as if no data is received.
Circuit and program attached.
Title: Re: Need help in serial infrared modulation
Post by: waltr on June 16, 2011, 12:53:33 PM
When trying to understand someone's code step through the code in the MPLAB Simulator and watch each register and variable being changed.
Following what the assembler code does in the simulator is not that difficult. The instructions are in the PIC data sheet. For PICs is is very useful to at least be able to read and follow ass ember code since most examples are in assembler.