Page 1 of 45 1234567891011 ... LastLast
Results 1 to 10 of 444
Like Tree4Likes

Thread: Custom USB Parking Sensor interface (formally PDC-USB)

  1. #1
    Maximum Bitrate Robby BMW's Avatar
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    558

    Lightbulb 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.

    Name:  LED Kit .jpg
Views: 46991
Size:  33.6 KB
    - 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.

    Name:  Main unit.jpg
Views: 47097
Size:  108.4 KB
    - 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.

    Name:  Signal LED.jpg
Views: 45738
Size:  12.8 KB
    - 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.

    Name:  Data analysis.jpg
Views: 46770
Size:  71.5 KB
    - 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.

    Name:  LCD Kit.jpg
Views: 46866
Size:  46.2 KB
    - 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.

    Name:  Main unit LCD.jpg
Views: 46775
Size:  104.9 KB
    - 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.

    Name:  Signal LCD.jpg
Views: 46062
Size:  12.0 KB
    - 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.

    Name:  Data analysis LCD.jpg
Views: 46271
Size:  72.9 KB
    - 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).

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

  2. #2
    Maximum Bitrate Robby BMW's Avatar
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    558

    Lightbulb USB interface construction

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

    Name:  3D.jpg
Views: 88982
Size:  117.3 KB
    - 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).

    Name:  Schematic.jpg
Views: 49624
Size:  49.4 KB
    - 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).

    Name:  Board.jpg
Views: 47055
Size:  143.8 KB
    - PCB components side -

    Name:  CS.jpg
Views: 45795
Size:  81.7 KB
    - 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:

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

  3. #3
    Maximum Bitrate Robby BMW's Avatar
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    558

    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.

    Name:  Display opened.jpg
Views: 46750
Size:  64.5 KB
    - 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).

    Name:  Receiver.jpg
Views: 44812
Size:  46.6 KB
    - 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.

    Name:  PCB with receiver.jpg
Views: 44862
Size:  37.6 KB
    - 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.

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

  4. #4
    Maximum Bitrate Robby BMW's Avatar
    Join Date
    Aug 2005
    Location
    Italy
    Posts
    558

    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

  5. #5
    Variable Bitrate
    Join Date
    Nov 2004
    Posts
    242
    Robby....OMG....WOW....Where do I order!

  6. #6
    FLAC Chairboy's Avatar
    Join Date
    Jan 2004
    Posts
    1,380
    Great stuff! I look forward to tracking your progress on this project.
    Chrysler 300 - Fabricating
    http://hallert.net/

  7. #7

  8. #8
    Constant Bitrate
    Join Date
    Dec 2006
    Location
    India
    Posts
    213
    Excellent...Subscribed

  9. #9
    Newbie dencker's Avatar
    Join Date
    Jun 2008
    Location
    Aalborg, Denmark
    Posts
    27
    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!

  10. #10
    Confusion Master
    Auto Apps:loading...
    Enforcer's Avatar
    Join Date
    Sep 2003
    Location
    If you go down to the woods today, You're sure of
    Posts
    14,618
    Quote Originally Posted by dencker View Post
    Seems interesting! I'm looking forward to seeing how it turns out!
    Pretty good actually.

Page 1 of 45 1234567891011 ... LastLast

Similar Threads

  1. Replies: 115
    Last Post: 03-05-2011, 03:54 AM
  2. Core Duo / Core 2 Duo Mini-ITX boards
    By RedGTiVR6 in forum General Hardware Discussion
    Replies: 153
    Last Post: 10-03-2010, 10:30 PM
  3. Installing a USB Hub up-front? Read this...
    By hd54321 in forum General Hardware Discussion
    Replies: 13
    Last Post: 02-09-2007, 11:49 AM
  4. Problem with ITPS / hibernation and External USB HD
    By veetid in forum Power Supplies
    Replies: 5
    Last Post: 01-02-2006, 08:35 PM
  5. My USB/Wifi troubles.
    By JPuma in forum General Hardware Discussion
    Replies: 0
    Last Post: 09-23-2005, 11:44 AM

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
  •