Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Circuit for Ultrasonic (Parking) Sensor

  1. #1
    Variable Bitrate Nerd2's Avatar
    Join Date
    Dec 2006
    Location
    Bristol/Cambridge, England
    Posts
    237

    Circuit for Ultrasonic (Parking) Sensor

    Hi all,

    Does anyone know how to wire a basic ultrasonic transmitter/receiver to a car pc for distance measuring?

    What I want, I think, is a sensor that every 5 seconds or so outputs a signal data1 on the parallel port,and simultaneously sends an ultrasonic pulse.

    Then when the receiver receives the ultrasonic pulse,it sends a signal to data2 on the parallel port. Then software could easily work out the distance to the target.

    Unfortunately my electronics skills are very lacking. I can find high-level ultrasonic sensors for ~$30, which seem to want to do their own thing. I can also find lowlevel sensors for ~$5,but that probably need extraneous circuitry (example: here).

    Google isn't being helpful, not suprisingly since I don't really know what I am searching for.

    Any help appreciated, thanks, Sam

  2. #2
    Variable Bitrate gameboy's Avatar
    Join Date
    May 2005
    Location
    Elizabeth City, NC
    Posts
    294
    you do realize that recieving data on a parallel port is difficult at best....you have to have interupt handlers, and a way to trigger the interrupt .... use serial(do a google, you can find a dozen or so ways to get data to the computer via serial/usb)..
    data 0-7 on the parrallel port are output only,

    and you would need some really custom drivers to let your program have any kind of direct control to the port(windows no like this)
    95 Mazda Protege LX
    Worklog
    Overall [Project Dead] 0%

    2003 Nissan Altima
    [XXXXXXXX--] 80% Planning
    [XX--------] 20% FABRICATION/INSTALLATION

    Worklog

  3. #3
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,053
    And also, you might want a sample frequency above 1Hz. If it is 1 sample every 5 seconds, that means that you will have to go back a little bit, and wait for data. If you are parrallel parking, it would be better to have a 1Hz or better 10Hz signal. Just something to think about.

    And serial is definately the way to go. Expecially since parallel ports are dying a slow painful death that started about 5 years ago.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  4. #4
    Maximum Bitrate Ruffy's Avatar
    Join Date
    Sep 2006
    Location
    Georgia
    Posts
    511
    Would probably be easier to buy a premade parking sensor off ebay(cheap one under $40)

    and taking the input going to the display and converting it to a serial interface. The parking sensor I have has a small display with a Numerical LED, and two horizontal led bars flanking each side of the Numeral Display.

    Havent opened it up but I could to see how it works.

    I wouldnt go after the parking sensors that use a more fancy vfd/lcd display. But who knows it might be easier to do that.
    Car : 00' Chrysler 300M
    Speakers : Rainbow Audio SLC 265 | Subs : Diamond Audio D6 12" Subs X2
    Amp's : Hifonics ZXi 6006 AB | Hifonics BXi 1606 D
    CarPC: HP Laptop AMD Sempron 3000+ | 1.5GB RAM | DVD+RW | 80GB 5400RPM HD | ATI R200 Video

  5. #5
    Maximum Bitrate Ruffy's Avatar
    Join Date
    Sep 2006
    Location
    Georgia
    Posts
    511
    also you can buy additional transceivers cheap for $5-15, already ready for use in a car.
    Car : 00' Chrysler 300M
    Speakers : Rainbow Audio SLC 265 | Subs : Diamond Audio D6 12" Subs X2
    Amp's : Hifonics ZXi 6006 AB | Hifonics BXi 1606 D
    CarPC: HP Laptop AMD Sempron 3000+ | 1.5GB RAM | DVD+RW | 80GB 5400RPM HD | ATI R200 Video

  6. #6
    Variable Bitrate Nerd2's Avatar
    Join Date
    Dec 2006
    Location
    Bristol/Cambridge, England
    Posts
    237
    Quote Originally Posted by gameboy View Post
    you do realize that recieving data on a parallel port is difficult at best....you have to have interupt handlers, and a way to trigger the interrupt .... use serial(do a google, you can find a dozen or so ways to get data to the computer via serial/usb)..
    data 0-7 on the parrallel port are output only,

    and you would need some really custom drivers to let your program have any kind of direct control to the port(windows no like this)
    My parallel port knowledge is from a while ago - I got a couple of switches and hooked them up to some pins (can't remember) on the port to trigger music play/stop etc in a simple vb app. Seemed easy then,maybe more research required on the software side first.

    Ah yes, I still have the app. I seemed to use 'vbInp' (linky). Dont know how well that would respond to high sampling frequencies though...

    I understood that USB (no serial port on lappy) would be a nightmare to program in VB, and that parallel, although restricting, would be a hell of a lot easier if you can get away with it. A quick google for usb addons for vb shed no light on this.

    Quote Originally Posted by 2k1Toaster View Post
    And also, you might want a sample frequency above 1Hz. If it is 1 sample every 5 seconds, that means that you will have to go back a little bit, and wait for data. If you are parrallel parking, it would be better to have a 1Hz or better 10Hz signal. Just something to think about.

    And serial is definately the way to go. Expecially since parallel ports are dying a slow painful death that started about 5 years ago.
    Agreed as regards sample frequency, however I am slightly worried about vb's ability to detect the pulses with fast sampling frequencies, hence why i said 0.2Hz originally. I suspect, certainly for parallel parking, high frequencies would not be required, 1Hz would probably be more than required, although preferable clearly.

    Quote Originally Posted by Ruffy View Post
    Would probably be easier to buy a premade parking sensor off ebay(cheap one under $40)

    and taking the input going to the display and converting it to a serial interface. The parking sensor I have has a small display with a Numerical LED, and two horizontal led bars flanking each side of the Numeral Display.

    Havent opened it up but I could to see how it works.
    I wouldnt go after the parking sensors that use a more fancy vfd/lcd display. But who knows it might be easier to do that.
    also you can buy additional transceivers cheap for $5-15, already ready for use in a car.
    Possibly a better idea - but I do like the idea of trying to do it myself. I did find something like this and I imagine I could do something easily with the 'buzzer' output. However, I ideally want each sensor on a separate channel into the pc.

    Thanks all!

  7. #7
    Newbie
    Join Date
    Jun 2005
    Posts
    15
    The PDF has a circuit for 2 channel ultrasonic ranger that I use.

    It works but needs a few improvements. Accuracy is about 5% . On detecting the car going into reverse serial command is sent to enable and the unit turns on IR leds for a reversing camera at the same time as taking 10 readings a second. Each pair of readings is averaged and 5 updates per second are sent to the PC. On getting out of reverse the unit is sent an off command which turns off IR leds and stops data being sent.

    PC converts the readings to feet and inches and displays on simple graphic screen

    The serial data is a 2 byte header followed by four bytes giving the range in inches for the left then right distances. Maximum and minimum distances vary the best is about 3 inches to 8 feet and the worst about 12 inches to 5 feet. Not sure why this happens yet, accuracy stays about the same. The circuit will give you some idea of what to do. You will need to add comparators on the output as the microprocessor has these built in.

    There is plenty of information on how to drive the transducers, timing wise, available on the web.
    The ultrasonic transducers must be a waterproof type if fitting to a car. It should be possible to add a second transducer, wired in parallel, to each to widen the area covered. Have not tried this.

    Madmac
    Attached Images Attached Images

  8. #8
    Variable Bitrate Nerd2's Avatar
    Join Date
    Dec 2006
    Location
    Bristol/Cambridge, England
    Posts
    237
    Wow thanks! I'll look into that!

  9. #9
    Low Bitrate
    Join Date
    Jan 2007
    Posts
    91
    I built a circuit for 3d distance measurement some 10 years ago and let me tell you : It's a pain to get it to work reliably !!

    How do you deal with echoes ? How do you compensate for slow startup time of the speakers and/or amps ? How do you deal with other ultrasonic noise in the vicinity (e.g. someone handling a keyring) ?

    My advice: get a premade circuit that's intended for vehicle use.

  10. #10
    Newbie
    Join Date
    Jun 2005
    Posts
    15
    Not too difficult to get it to work reliably detecting distance. Main problem is range varying (have not had time to look at this further). The minimum distance is the result of an auto calibration when first started. This waits for the transmit pulse to end and works out a time to mask this on future cycles, thereby compensating for start up and ringing times.
    Echoes are what you are after to get a range, the main problem echo is from the ground and by using transducers made for cars with a fan shaped beam this is got round. Ultrasonic noise in the vicinity is dealt with in two ways, firstly there is a small window during which an echo is looked for and secondly by averaging out readings.
    I agree a prebuilt unit is the easy way to go but if you want to integrate with car PC then building from scratch is probably as easy as hacking a unit to get the signals.
    The best way to get the sensors is to buy a unit off ebay and use just the sensors, it is cheaper than buying them on their own. That way at least you can look at both approaches.
    Madmac

Page 1 of 2 12 LastLast

Similar Threads

  1. parking sensor wire
    By tubbytommy in forum Input Devices
    Replies: 3
    Last Post: 11-22-2006, 08:35 PM
  2. Reverse Camera + Parking Sensor
    By ankur in forum Input Devices
    Replies: 1
    Last Post: 10-28-2006, 02:29 PM
  3. Parking Sensor Wire
    By aquatist23 in forum General Hardware Discussion
    Replies: 1
    Last Post: 07-31-2005, 02:36 PM
  4. Parking Sensor wire
    By aquatist23 in forum LCD/Display
    Replies: 1
    Last Post: 07-29-2005, 11:41 PM
  5. Painting a reverse / parking sensor?
    By modemide in forum General Hardware Discussion
    Replies: 0
    Last Post: 09-06-2004, 08:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •