Announcement

Collapse
No announcement yet.

Circuit for Ultrasonic (Parking) Sensor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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

          Comment


          • #6
            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.

            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.

            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!

            Comment


            • #7
              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 Files

              Comment


              • #8
                Wow thanks! I'll look into that!

                Comment


                • #9
                  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.

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      Hi again all,
                      If anyone's interested, i've started using ultrasonic rangers from http://www.robot-electronics.co.uk/

                      Their bottom of the line ultrasonic sensor, the SRF02, combined with a USBI2C creates a quick and easy distance sensor.

                      I haven't actually thought about how to mount the things in the car yet, but i've bought 2 and they're set up fine, quick VB app attached (mondeo pic copyright ford ;-) ).

                      You could have an USBI2C with every sensor, which would mean 4-sensors for 120.The SRF02 runs on the I2C bus, which i've been told I shouldn't extend more than ~2metres. The obvious plan would then be to have one USBI2C for the back bumper, and one for the front, with a total price of 80. I'm currently experimentally considering if a 'spider' arrangement, with the USBI2C in the center of the car, leading out to the four sensors, would allow me to reduce the price to about 65.

                      It could maybe be done cheaper by soldering it yoursef, and I wouldn't call it cheap, but i think 65 for a 4-sensor system is a pretty good deal, up to 90 for 6 sensors.

                      The only major flaw with these at the moment, is that they arn't waterproof. So, next work is to research trying to cover these as best as possible. Apparently just replacing the transeiver with a waterproof type doesn't work for some reason.

                      Comments appreciated.

                      Sam
                      Attached Files

                      Comment


                      • #12
                        Originally posted by Nerd2 View Post
                        Hi again all,
                        If anyone's interested, i've started using ultrasonic rangers from http://www.robot-electronics.co.uk/

                        Their bottom of the line ultrasonic sensor, the SRF02, combined with a USBI2C creates a quick and easy distance sensor.

                        I haven't actually thought about how to mount the things in the car yet, but i've bought 2 and they're set up fine, quick VB app attached (mondeo pic copyright ford ;-) ).

                        You could have an USBI2C with every sensor, which would mean 4-sensors for 120.The SRF02 runs on the I2C bus, which i've been told I shouldn't extend more than ~2metres. The obvious plan would then be to have one USBI2C for the back bumper, and one for the front, with a total price of 80. I'm currently experimentally considering if a 'spider' arrangement, with the USBI2C in the center of the car, leading out to the four sensors, would allow me to reduce the price to about 65.

                        It could maybe be done cheaper by soldering it yoursef, and I wouldn't call it cheap, but i think 65 for a 4-sensor system is a pretty good deal, up to 90 for 6 sensors.

                        The only major flaw with these at the moment, is that they arn't waterproof. So, next work is to research trying to cover these as best as possible. Apparently just replacing the transeiver with a waterproof type doesn't work for some reason.

                        Comments appreciated.

                        Sam
                        Hi,
                        How are you getting on,are you still workin on this??

                        If not is there any chance you could share the source in the hope someone might continue the project?
                        P4 2.8 HT, 512Mb Ram, 60Gb 2.5 HD, M4-ATX, SB Audigy2, BU353, Lilliput TS,Soundgraph Imon VFD,SONY Optiarc dvd Burner,RideRunner, iGo8, Custom Freedom 2.1

                        Comment


                        • #13
                          Haven't bothered with these for a while. There isn't really much source to work with - I just followed the instructions and sent data using MsComm in VB. Don't have the source with me anyway, if anyone wants it then I can send it next week.

                          Comment


                          • #14
                            ah, I thought about doing something like this....







                            for about 1 minute......












                            then it hit me......









                            cheaper, easier & better........









                            USE A CAMERA!!!!!!








                            in the end, it's the best way to go, if you can set up the display to auto switch in reverse your golden..... forget the beep beep beep beeeeeep boom....
                            MY NEWEST INSTALL:modded infiniti fx with big screen

                            first windows carpc install........my liquid cooled LVDS screen :D

                            Comment


                            • #15
                              Ultransonic range detector

                              hi all,

                              Does any 1 noe how to construct a simple ultrasonic range detector circuit ???
                              can teach me or give me some guide.... Basically I dnno much about Ultrasonic sensor also....but i hope to construct 1 in 1month time.. i had try 1 like the picture i attach... for IC4 RX i had change to LM833N, this is because i can't buy it in market on NJM4580D....
                              any 1 have any idea??? or other circuit might help ???
                              Attached Files

                              Comment

                              Working...
                              X