PyroElectro.com Forum Index PyroElectro.com
Build what you want, Be the pyro you are.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Short Range Personal Radar
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    PyroElectro.com Forum Index -> Projects
View previous topic :: View next topic  
Author Message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Thu Feb 07, 2008 10:05 pm    Post subject: Short Range Personal Radar Reply with quote

Short Range Personal Radar Project Write-up

Quote:
The idea to create a type of close proximity radar system came from a student in one of my classes. We went ahead and decided to streamline the idea into the course as one of the projects we'd build.


Link


Questions & Comments?
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
jrob
Newbie Pyro


Joined: 10 Feb 2008
Posts: 1

PostPosted: Sun Feb 10, 2008 9:24 pm    Post subject: Reply with quote

Might want to move the box into the back seat or have it be an auditory display. Imo if ppl are staring at this box they might be paying less attention to the things behind their car.
Back to top
View user's profile Send private message
Lakerol
Newbie Pyro


Joined: 27 Feb 2008
Posts: 2

PostPosted: Wed Feb 27, 2008 5:12 pm    Post subject: Reply with quote

Hi, I would like to know if the codes can be applied/modified to run on a 16F877 20 MHz osc?
Back to top
View user's profile Send private message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Wed Feb 27, 2008 7:19 pm    Post subject: Reply with quote

Hi Lakerol,

You can definitely use a 16F877 for this project Very Happy .
You'll need to modify the:
#include <p18f452.h> to <p16f877.h>

along with a few of the port statements so that it matches up with the ports used in the program.
The 2 timers used will also need to have some numbers modified to match the clock frequency.
If you need to know more specifics just ask Wink .
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Lakerol
Newbie Pyro


Joined: 27 Feb 2008
Posts: 2

PostPosted: Thu Feb 28, 2008 4:55 pm    Post subject: Reply with quote

Hi,

Actually I'm a newbie to PIC stuff so pardon me if some questions sound simple to you... After searching for days on the net for information, it seems that if I were to use a 20 MHz crystal, it is impossible to do PWM using timer2 because the frequency required to control the servo is too low and requires a lower crystal such as ~4 MHz? Pls correct me if I'm wrong...

Right now what I'm doing is to use time delays to generate pulses and using a oscilloscope to measure it... something like trial and error... and it can still control the servo... but it would be great if you can shed some light into the feasibility of using a 20 MHz crystal to control the servo using PWM.
Back to top
View user's profile Send private message
BushidoShonin
Newbie Pyro


Joined: 05 Mar 2008
Posts: 4

PostPosted: Sat Mar 08, 2008 1:34 am    Post subject: Got questions Reply with quote

Hello, I am new to all this stuff and I have some questions.

First: In the line:
"if(ir_data > 0x171 && ir_data <= 0x19E){"
where did "0x171" come from and is it Hex?

Second: Is there recommendations on learning material?

Thank you in advance.
Back to top
View user's profile Send private message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Sat Mar 08, 2008 5:48 am    Post subject: Reply with quote

Hey BushidoShonin,

Arrow For your first question:

0x171 and 0x19E are representations of hexadecimal values in C.
0x171 = 369 (decimal), 0x19E = 414 (decimal).

These values are chosen as 'limits' and if you look, you'll see there's a few of them used in the radar program, one for each possible led on the radar output display.

They are used as comparators for the IR sensor data input. Depending upon the value coming in, a different led may or may not light up on the display.

(I'm just giving a high level description of what's going on)

Arrow For your second question:

Unfortunately there is no one magical book out there that you can buy to learn all this stuff. It is a cumulative learning process like most things. Here's my recommendation:

First:
-Learn the basics of Digital Logic Design (and, or, not, xor...etc).
-Learn the basics of Programming C.

Then:
-Get a Microcontroller Development Board & Programmer Setup (these are available alllll over)
-Begin programming very simple programs & work your way up.
These two tutorials give an example of a microcontroller & programmer:
http://www.pyroelectro.com/tutorials/pic_microcontroller/index.html
http://www.pyroelectro.com/tutorials/program_pic/index.html


If you want specifics just give a reply, I can make some recommendations. Very Happy
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
BushidoShonin
Newbie Pyro


Joined: 05 Mar 2008
Posts: 4

PostPosted: Mon Mar 10, 2008 12:00 pm    Post subject: Reply with quote

Thank you for your help, but I was wondering a little more indepth. Where are the hex numbers coming from? (ie if I want to change the distance of when the LED is lit, how do I get the number that represents said distance).

Again, thank you for your help.
Back to top
View user's profile Send private message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Thu Mar 13, 2008 7:33 pm    Post subject: Reply with quote

Hey BushidoShonin,

Idea Check out the datasheet for one of the IR sensors (for example part #GP2D120). They have a really nice graph that shows how the ouput voltage from the device relates to distance, there is even a nice method to create a linearization of the graph.

I included it in this tutorial as well:
Arrow http://www.pyroelectro.com/tutorials/infrared/theory.html

The analog output voltage nears 3v and varies much lower when objects are far, far away (depending on the sensor specified range). In my project I used an A/D coverter to get the voltage value with a reference to +5v. The hex numbers you see are ranges for the different values. Each LED that lights up represents a distance range away from the sensor with similar distances away from each other.

You choose the (hex) value that you need for your given application. That's how i did it for this one, very little mathematical theory was done, just basic manual ranging and testing with a battery and a piece of paper to determine voltage/distance relationships in different light settings and to confirm the graph on the datasheet. Shocked
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
cevbe
Newbie Pyro


Joined: 07 Apr 2008
Posts: 1

PostPosted: Mon Apr 07, 2008 8:45 pm    Post subject: short range personal radar problem Reply with quote

Hii first of all i would like to thank you for project. i set up ciruit and loaded the pic18f452 with c18. But my device is working very absurd. I used sharp 2yoa21 and standart servo. servo and circuit are working out of order . I wanted to use pic16f877 but c18 was not compile. please help me what can i do? in addition my programmer is not work (for xt 10Mhz.) max 4 Mhz. thanks right now.
Back to top
View user's profile Send private message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Tue Apr 08, 2008 8:24 pm    Post subject: Reply with quote

Hi Cevbe,

Reguarding the operation being 'absurd'. This is most likely because you haven't calibrated the ranging of the sensor. The code I developed was specific to my enviornment (i.e. lighting conditions, weather). You will need to altar the range of A/D values (in the code) that light up the LEDs. Idea

After you have the sensor calibrated it will work much more accurately. Remember the IR sensors can be thrown off quite easily, like any sensor can, if you drastically change the surrounding enviornment. Confused

The PIC 16F877 can be programmed using the ICD2 programmer, not all PIC programmers are created equally so yours may not be able to program it. You will need to double check with the manufactuerer. Be sure to:
Arrow #include <p18f877.h>
atop the code so that things compile & program properly.

With a 10MHz clock you should be choosing an HS oscillator configuration. XT is meant for up to 4 MHz if my memory serves me correctly. Wink
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
tylerl
Newbie Pyro


Joined: 26 Mar 2008
Posts: 1

PostPosted: Tue Apr 22, 2008 8:32 am    Post subject: 74HCT... Reply with quote

Is there significant reason to use the 47HCT373 chips in particular, as opposed to another logic family?

I'm fairly new to building my own hardware, so I what to look out for and what I can get away with.

Say, for example, could I use a 74ALS373 or a 74ACT373 chip instead? I've heard of problems if you mix logic families, though to be honest, I have no idea what family microcontrollers use anyway, so I wouldn't know what I'm mixing.

So, to nutshell the issue: does it matter here? when does it matter? and when it does matter, what should I use? Thanks.
Back to top
View user's profile Send private message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Tue Apr 22, 2008 6:23 pm    Post subject: Reply with quote

Hi Tylerl,

The reason 74HCT373's were used is because they are 'high current' logic devices. For the personal radar application 74HCT/74LS shouldn't make a difference. Just test the chip out and make sure it is capable of lighting 8 LEDs at once. The LEDs I used for displaying output are low current so in the end it didn't really matter. Wink

In a nutshell:
Arrow It doesn't matter here.
Arrow It matters when you need to have high current outputs.
Arrow You should use whichever device suits your needs. compare the data sheets side by side and you'll see the differences in output current.
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
derrick1616
Newbie Pyro


Joined: 15 May 2008
Posts: 6

PostPosted: Thu May 15, 2008 6:15 pm    Post subject: need help compiling Reply with quote

This is the error message i keep getting when i trying compile using MPlab

Release build of project `C:\Documents and Settings\Derrick\Desktop\project\radar.mcp' started.
Thu May 15 13:11:28 2008
----------------------------------------------------------------------
Build aborted. The project contains no source files.
----------------------------------------------------------------------
Release build of project `C:\Documents and Settings\Derrick\Desktop\project\radar.mcp' failed.
Thu May 15 13:11:28 2008
----------------------------------------------------------------------
BUILD FAILED
Back to top
View user's profile Send private message
ThePyroElectro
PyroElectro Admin


Joined: 12 Nov 2007
Posts: 401
Location: Earth

PostPosted: Thu May 15, 2008 6:41 pm    Post subject: Reply with quote

You need to add your .c file (i.e. main.c) to the current project. This means right clicking on the 'source files' folder in your project window and adding the file. Then your project should compile. Very Happy
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    PyroElectro.com Forum Index -> Projects All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group