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.
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.
You can definitely use a 16F877 for this project .
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 .
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.
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)
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.
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).
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.
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.
Posted: Mon Apr 07, 2008 8:45 pm Post subject: short range personal radar problem
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.
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.
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.
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:
#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.
Posted: Tue Apr 22, 2008 8:32 am Post subject: 74HCT...
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.
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.
In a nutshell:
It doesn't matter here.
It matters when you need to have high current outputs.
You should use whichever device suits your needs. compare the data sheets side by side and you'll see the differences in output current.
Posted: Thu May 15, 2008 6:15 pm Post subject: need help compiling
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
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.
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