Announcement

Collapse
No announcement yet.

Custom USB Parking Sensor interface (formally PDC-USB)

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

  • Custom USB Parking Sensor interface (formally PDC-USB)

    According to the requests of some users, I've developed this new interface that allows to connect an ultrasonic parking sensor to the PC through the USB port, like I've alredy done for the TPMS kit (Hoops! I did it again ).
    The whole project is based on a cheap parking sensor kit (see the picture below) which can be purchased from many online retailers as well as on eBay and a simple interface based on the PIC microcontroller 18F2550.

    Click image for larger version

Name:	LED Kit .jpg
Views:	1
Size:	33.6 KB
ID:	2302628
    - the Prking Sensor kit used in the project -

    The Parking Sensor used is wireless, this means that it doesn't need a wired connection between the main unit and the LED display and that it uses a serial protocol for the communication, so, once identified the transmitter located inside the main unit, it has been relatively easy to analyze the data structure.

    Click image for larger version

Name:	Main unit.jpg
Views:	1
Size:	108.4 KB
ID:	2302630
    - the main unit opened with the transmiter highlighted -

    Basically the whole data packet is composed by 24 periods where the logical "0" has a time duration of about 600 ÁS and the logical "1" is about 1200 ÁS, so when the Parking Sensor is powered, typically through the reversing lights, it starts to transmit a series of 3 bytes (24 bits) many times per second.

    Click image for larger version

Name:	Signal LED.jpg
Views:	1
Size:	12.8 KB
ID:	2302780
    - periods time duration -

    The 3 bytes sequence contains the address and the data (distance from the obstacle) detected from each ultrasonic sensor, so, since the ultrasonic sensors are 4, we will have 4 sequences of 3 bytes repeated over time, one for each ultrasonic sensor.

    Click image for larger version

Name:	Data analysis.jpg
Views:	1
Size:	71.5 KB
ID:	2302629
    - the whole data packet -

    The first byte is composed by 2 nibble (4 bits), the first nibble identifies the ultrasonic sensor (0 = A, 1 = B, 2 = C and 3 = D) and the second nibble is complementary to the first, in order to verify the integrity of the data received.
    The second byte, as for the second nibble of the first byte, is complementary to the third byte.
    The third byte contains the distance detected expressed in centimeters.

    So, if the ultrasonic sensor B detects an obstacle at 83 cm, the sequence is: 30 - 172 - 83 (0001 1110 - 10101100 - 01010011).

    In order to allow the use of other types of Parking Sensors kits, I also looked into a second model produced by a different manufacturer (a special thanks to Enforcer who has provided both kits for the development of this project).
    This last is wireless like the first one, but it has an LCD screen instead of a LED display.

    Click image for larger version

Name:	LCD Kit.jpg
Views:	1
Size:	46.2 KB
ID:	2302637
    - the other Prking Sensor kit -

    The main unit of this Parking Sensor kit is different from the previous one, but the main difference is in the data sent to the display.

    Click image for larger version

Name:	Main unit LCD.jpg
Views:	1
Size:	104.9 KB
ID:	2302638
    - the main unit opened with the transmiter highlighted -

    The whole data packet of this second kit is composed by 10 half periods where the logical "0" has a time duration of about 2 mS and the logical "1" is about 5 mS, so when it is powered, a series of 10 bits will be transmitted to the display many times per second.

    Click image for larger version

Name:	Signal LCD.jpg
Views:	1
Size:	12.0 KB
ID:	2302639
    - half periods time duration -

    The 10 bits sequence contains the data (distance from the obstacle) detected from all the ultrasonic sensors, this means that with this Parking Sensor kit each data sequence carries all the distances detected from the four ultrasonic sensors, contrary to the first kit, which sends a single data sequence for each ultrasonic sensor.

    Click image for larger version

Name:	Data analysis LCD.jpg
Views:	1
Size:	72.9 KB
ID:	2302640
    - some data packets -

    The first nibble (4 bits) contain the shortest distance detected by a group of two ultrasonic sensors (A and B or C and D) expressed in decimeters (10 cm).
    The second nibble contain the longest distance detected by the other group of ultrasonic sensors.
    The penultimate bit indicates if the shortest distance (first nibble) is related to the ultrasonic sensors A and B (left side) or C and D (right side).
    The last bit is always "1".

    Doing a quick comparison between the two systems (the one LED and LCD) we can see that:

    The resolution of the LED system is 8 bits, so the accuracy is 1 cm (0.39 inches), the LCD system has a resolution of 3 bits only, then an accuracy of 10 cm (3.93 inches).

    The LED system transmits the data of each ultrasonic sensor individually, so we can display 4 sliders on the PC (one for each sensor), the LCD system handles the ultrasonic sensors in pairs, then we can have only two sliders, one for the right side and one for the left.

    Also, the LCD system needs to be connected to the USB interface only trough a cable, instead the LED one can operate also trough a wireless connection (bat this will be better explained later).

    Click image for larger version

Name:	Comparison.jpg
Views:	1
Size:	54.3 KB
ID:	2302641
    - comparison between the two Parking Sensor kits -
    _______________________________________
    Car installation 95% [■■■■■■■■■■■■■■■■■■■]
    Current project: Parking sensor USB interface

  • #2
    USB interface construction

    As mentioned above, the interface is based on the PIC microcontroller 18F2550.

    Click image for larger version

Name:	3D.jpg
Views:	1
Size:	117.3 KB
ID:	2271720
    - 3D view of the USB interface -

    The schematic is relatively simple, the microcontroller gets the signal from the Parking Sensor trough the PIN 13, performs the data sampling and sends them to the PC through the USB port.
    Through the transistor T1, connected to the PIN 22 of the PIC microcontroller, is possible to drive an active buzzer (or beeper), that will provide an alarm sound like the buzzer inside the original display of the Parking Sensor kit.
    The advantage of this solution is that when the system detects an obstacle in the dangerous range, it will give out a beep also if the PC has not yet booted.

    Brief note on the transistor used to drive the buzzer:
    I've used a BC547 (European), but it is not critical and can be replaced with an equivalent general purpose transistor like a 2N5818 (USA).

    Click image for larger version

Name:	Schematic.jpg
Views:	1
Size:	49.4 KB
ID:	2271776
    - schematic -

    The header pins JP1, JP2 and JP3 are optional and must to be placed on the board only if is used the wireless connection (available only with the LED Parking Sensor kit).

    Click image for larger version

Name:	Board.jpg
Views:	1
Size:	143.8 KB
ID:	2271721
    - PCB components side -

    Click image for larger version

Name:	CS.jpg
Views:	1
Size:	81.7 KB
ID:	2271722
    - PCB copper side -

    The connector SV1 is used to connect the buzzer and the main unit of the Parking Sensor kit (just in case it's not used the wireless link), in accordance to the following connection diagram:

    Click image for larger version

Name:	Connection diagram.jpg
Views:	1
Size:	115.1 KB
ID:	2271777
    - interface connection diagram -
    _______________________________________
    Car installation 95% [■■■■■■■■■■■■■■■■■■■]
    Current project: Parking sensor USB interface

    Comment


    • #3
      Wireless linking

      As explained above, the first Parking Sensors kit (the LED system) can be connected to the USB interface also by a wireless link, but to do this, you must open the original LED display and remove the internal receiver.

      Of course in this way the display will become unusable, so if you're planning to use this last in combination with the PC, it is better the wired connection.

      Click image for larger version

Name:	Display opened.jpg
Views:	1
Size:	64.5 KB
ID:	2271735
      - the LED display opened with the receiver highlighted -

      After removing the two small screws in the bottom, it's possible to open the LED display and unsolder the receiver module (be careful in order to don't damage it).

      Click image for larger version

Name:	Receiver.jpg
Views:	1
Size:	46.6 KB
ID:	2271736
      - the receiver unit removed from the LED display -

      The receiver module must to be soldered directly on the PCB interface trough the headers pin JP1 and JP2, while, on the pin JP3, must to be soldered an isolated wire long about 20 cm (8") or more, as antenna.

      Click image for larger version

Name:	PCB with receiver.jpg
Views:	1
Size:	37.6 KB
ID:	2271775
      - PCB with receiver unit and antenna -

      In summary:

      This interface can currently be used with two different Parking Sensor kits, one with LED display and the other with LCD display.

      The kit with LED display can be connected to the interface through a shielded cable or, alternatively, wireless.

      The kit with LCD display can be connected to the interface only through a shielded cable.

      In both cases is possible (and recommended) to connect a buzzer (or beeper) to the interface, that will provide an alarm sound like the one provided by original Parking Sensor kit.

      Since any manufacturer has his personal standard, it is impossible to develop an universal firmware able to work with all the kits available on the market, so I have made two different firmware for the two Parking Sensor kits.
      I recommend to specify exactly which kit will be used before to submit any PIC request.

      Click image for larger version

Name:	PCB.jpg
Views:	1
Size:	110.6 KB
ID:	2271781
      - the real PCB (copper side) -
      _______________________________________
      Car installation 95% [■■■■■■■■■■■■■■■■■■■]
      Current project: Parking sensor USB interface

      Comment


      • #4
        Communication protocol, FAQ and related downlads

        The communication with the PC is performed through the USB port and, as this is a Plug & Play HID device, it doesn't require a driver installation.
        This make easy the development of software (stand-alone programs or plug-ins for many Front Ends) without the need of special APIs.

        In order to facilitate the communication between the device and PC, I have developed a very simple communication protocol.
        Basically the device waits for a request from the PC (1 byte) and, if need, returns the information required (5 byte).

        The following table shows the protocol details:

        20H (31) Data request --> Returns: A,B,C,D,Bz
        40H (64) Buzzer mute --> Returns: Nothing
        41H (65) Buzzer un-mute --> Returns: Nothing

        Where:
        A, B, C and D are the distances (in centimeters) detected by the four ultrasonic sensors sets at the rear bumper. FFH (255) indicates the sensor inactivity (the reverse is not inserted), any other value between C8H (200) and 00H (0) is a valid distance.
        Bz is the buzzer status, 00H (0) muted and =1H (1) un-muted.

        As example of how to use this device in your code, you can download a RoadRunner plugin and its source code here.


        Related downloads:
        Schematic & PCB (created with Eagle CAD)
        Parts list & PCB scaled 1:1 (PDF - Adobe Reader)

        RoadRunner PlugIn (Bynary and source code)
        Centrafuse PlugIn (Developed by Wolfgang)
        _______________________________________
        Car installation 95% [■■■■■■■■■■■■■■■■■■■]
        Current project: Parking sensor USB interface

        Comment


        • #5
          Robby....OMG....WOW....Where do I order!

          Comment


          • #6
            Great stuff! I look forward to tracking your progress on this project.
            Chrysler 300 - Fabricating
            http://hallert.net/

            Comment


            • #8
              Excellent...Subscribed

              Comment


              • #9
                Seems interesting! I'm looking forward to seeing how it turns out!

                - Subscribed ;D
                Looking forward to picking up a '99 Ford Focus and stuffing a CarPC into it! I'm going for the OEM look. If anyone has tips or are willing to help me, please feel free to contact me!

                Comment


                • #11
                  Originally posted by Enforcer View Post
                  Pretty good actually.
                  Oh! What's the project status?
                  Looking forward to picking up a '99 Ford Focus and stuffing a CarPC into it! I'm going for the OEM look. If anyone has tips or are willing to help me, please feel free to contact me!

                  Comment


                  • #12
                    Well I have had it up and running and it's pretty cool.

                    I was demo'ing at the UK meet in May.

                    Just waiting for my unit to come back from Robby after a firmware upgrade


                    Here's a sneak (hope Robby don't mind) preview of it during testing.





                    http://youtube.com/watch?v=e4zM3PQeSag
                    Last edited by Enforcer; 05-06-2012, 08:16 AM.

                    Comment


                    • #13
                      Now THAT looks awesome! I actually saw the video earlier today while searching for some CarPC setups @ youtube

                      Can't wait to see it in action (in the car of course) Will you do a worklog of the install too (If you planned to install it in the near future of course)?
                      Looking forward to picking up a '99 Ford Focus and stuffing a CarPC into it! I'm going for the OEM look. If anyone has tips or are willing to help me, please feel free to contact me!

                      Comment


                      • #14
                        Originally posted by dencker View Post
                        Now THAT looks awesome! I actually saw the video earlier today while searching for some CarPC setups @ youtube

                        Can't wait to see it in action (in the car of course) Will you do a worklog of the install too (If you planned to install it in the near future of course)?

                        Might do.

                        Comment


                        • #15
                          Ush. Nice.
                          Looking forward to picking up a '99 Ford Focus and stuffing a CarPC into it! I'm going for the OEM look. If anyone has tips or are willing to help me, please feel free to contact me!

                          Comment

                          Working...
                          X