Jump to content
Sign in to follow this  
mnasir

A/d Conversion For Ir Sensor For Mobile Robot

Recommended Posts

hi ,

 

for my final project, i build an autonomous mobile robot using IR transmitter and receiver. I using PIC 16F877A as a microcontroller for a robot which is as receiver. I set IR frequency to 38kHz. For the locomotion system for my robot is using 20MHz while IR receiver is set to 38kHz and ultrasonic is set to 40kHz. Because of IR receiver is analog input, i use A/D converter module in PIC to create digital ouput (binary number).

 

My problem is about selecting the A/D conversion clock, should i use oscillator which operating frequencies is 20MHz or use oscillator which is operating frequencies 38kHz ?

or can i use both?

 

can these two frequencies compatible if i use both?

 

and 1 more thing about the A/d conversion. i don't understand about ADRESH:ADRESL. ADRESH is A/D Result High Register, ADRESL Result Low Register which contain 10bit of result of the A/D conversion. Is it ADRESH and ADRESL is output for A/D conversion? How to know or set the ADRESH or ADRESL?

 

can anyone help me?..thanks

Share this post


Link to post
Share on other sites
hi ,

 

for my final project, i build an autonomous mobile robot using IR transmitter and receiver. I using PIC 16F877A as a microcontroller for a robot which is as receiver. I set IR  frequency to 38kHz. For the locomotion system for my robot is using 20MHz while IR receiver is set to 38kHz and ultrasonic is set to 40kHz. Because of IR receiver is analog input, i use A/D converter module in PIC to create digital ouput (binary number).

 

My problem is about selecting the A/D conversion clock, should i use oscillator which operating frequencies is 20MHz or use oscillator which is operating frequencies 38kHz ?

or can i use both?

 

can these two frequencies compatible if i use both?

 

and 1 more thing about the A/d conversion. i don't understand about ADRESH:ADRESL. ADRESH is A/D Result High Register, ADRESL Result Low Register which contain 10bit of result of the A/D conversion. Is it ADRESH and ADRESL is output for A/D conversion? How to know or set the ADRESH or ADRESL?

 

can anyone help me?..thanks

 

manasir,

You have asked to many questions at one go. But let me try answering it one by one.

 

I have a scheme for IR object detection. See if its useful.

If you feel you need to use your IR receiver which gives analog output then you need to use the adc.

 

1. What IR transmitter_receiver are you using? I guess 38 khz must be the carrier frequency for IR communication. This carrier frequency has to be modulated with data signal. I have used a simple 555 timer ic to generate the 38Khz for Driving an IR LED( you should get an IR LED that has max sensitivity in this freq range, others may work but the detection range may vary).

 

Next you need a IR receiver. I had used TSOP1738 IR receiver. This receiver from Vishay electronics is sensitive only to 38khz IR signal. It has three pins, two for supply and the third pin(output pin) is connected to the micro. If it receives a IR signal the output pin goes high & you should read it with your micro.

 

TX:

Generally the IR led is also fired from the micro. How is this done?

The 38khz output from the 555 is connected to the anode of the IR LED, the catode of the LED is connected to the collector of a transistor say BC547(NPN) via a 47 ohms resistor. The emitter of the transistor is connected to ground. The base of the transistor is driven from the i/o port pin of the micro via 1k resistor.

 

You can not send a data (say high or 1) continiously. TSOP will consider it as noise and reject it. So you need to switch ON the transmitter only for a Brief duration (how brief? Say less then 200ms for worst case but 1 ms is good enough).See data sheet of TSOP to determine the max data stream length.

 

This is how you detect the object:

Switch on the IR led, immediately start reading the the TSOP for reflected signal and then switch off the IR LED.

If you read a 1 you have detected an object else no object detected.

 

If you are using analog signal as your receiver.

2. Don't confuse yourself with the microcontrollers crystal frequency(20mhz your using) and the IR carrier frequency(38khz). For the adc you need to be concerned only with the crystal freq of the microcontroller.

Read the micro chips data sheet for more information on a to d converter.

 

Regards

Raghunathan.

Share this post


Link to post
Share on other sites

did you use IR for obstacle detection purpose or as a target so the robot can move to the target? I think u should mentioned that...

Edited by systemchaos

Share this post


Link to post
Share on other sites
1. What IR transmitter_receiver are you using? I guess 38 khz must be the carrier frequency for IR communication. This carrier frequency has to be modulated with data signal. I have used a simple 555 timer ic to generate the 38Khz for Driving an IR LED( you should get an IR LED that has max sensitivity in this freq range, others may work but the detection range may vary).

 

Next you need a IR receiver. I had used TSOP1738 IR receiver. This receiver from Vishay electronics is sensitive only to 38khz IR signal. It has three pins, two for supply and the third pin(output pin) is connected to the micro. If it receives a IR signal the output pin goes high & you should read it with your micro.

 

TX:

Generally the IR led is also fired from the micro. How is this done?

The 38khz output from the 555 is connected to the anode of the IR LED, the catode of the LED is connected to the collector of a transistor say BC547(NPN) via a 47 ohms resistor. The emitter of the transistor is connected to ground. The base of the transistor is driven from the i/o port pin of the micro via 1k resistor.

 

You can not send a data (say high or 1)  continiously. TSOP will consider it as noise and reject it. So you need to switch ON the transmitter only for a Brief duration (how brief? Say less then 200ms for worst case but 1 ms is good enough).See data sheet of TSOP to determine the max data stream length.

 

This is how you detect the object:

Switch on the IR led, immediately start reading the the TSOP for reflected signal and then switch off the IR LED.

If you read a 1 you have detected an object else no object detected.

 

If you are using analog signal as your receiver.

2. Don't confuse yourself with the microcontrollers crystal frequency(20mhz your using) and the IR carrier frequency(38khz). For the adc you need to be concerned only with the crystal freq of the microcontroller.

Read the micro chips data sheet for more information on a to d converter.

 

Regards

Raghunathan.

 

 

dear mr Raghunathan @ ra68gi,

 

thanks for your info and help..

 

you are right about IR transmitter and receiver that i use for. That IR 38kHz is carrier frequency for communication. I also use 555 timer to generate 38kHz.

I use IR transmitter SFH485P from siemens (http://docs-asia.electrocomponents.com/webdocs/0028/0900766b8002885f.pdf) and

 

IR receiver module IS1u60 form sharp (http://www.datasheetcatalog.com/datasheets_pdf/I/S/1/U/IS1U60.shtml)..

 

actually, briefly my project is like this. I build a beacon and robot. The beacon which is the target for the robot consists of IR transmitter which will send the signal. The robot will searching for the beacon signal. The objective is the robot should go to the beacon based on the signal

from transmitter. For object detection, i use ultrasonic. I use IR only for communication.

 

My problem now is about programming. I stuck in A/D conversion. IR receiver consists of an analog output. So i use PIC internal A/D because i think more easier.

I want to know, how to set ADRESH and ADRESL which is a result for A/D conversion? Is it automatically generate or i have to set something? I bit confused about this.

 

thanks anyway :P

Share this post


Link to post
Share on other sites
dear mr Raghunathan @ ra68gi,

 

thanks for your info and help..

 

you are right about IR transmitter and receiver that i use for. That IR 38kHz is carrier frequency for communication. I also use 555 timer to generate 38kHz.

I use IR transmitter SFH485P from siemens (http://docs-asia.electrocomponents.com/webdocs/0028/0900766b8002885f.pdf) and 

 

IR receiver module IS1u60 form sharp (http://www.datasheetcatalog.com/datasheets_pdf/I/S/1/U/IS1U60.shtml)..

 

actually, briefly my project is like this. I build a beacon and robot. The beacon which is the target for the robot consists of IR transmitter which will send the signal. The robot will searching for the beacon signal. The objective is the robot should go to the beacon based on the signal

from transmitter. For object detection, i use ultrasonic. I use IR only for communication. 

 

My problem now is about programming. I stuck in A/D conversion. IR receiver consists of an analog output. So i use PIC internal A/D because i think more easier.

I want to know, how to set ADRESH and ADRESL which is a result for A/D conversion? Is it automatically generate or i have to set something? I bit confused about this.

 

thanks anyway  :P

 

Programming is not difficult. You write your code and post it, we will help you debug it. This forum is a very friendly one & iam sure there will be many people to help you. If you are a beginner in programming then see this thread.."pic micro programming in boostc for beginners". Its got examples on using PIC's adc.

 

Regards

Raghunathan.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...