The MP3car.com Store The MP3car.com Store    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Hardware Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-25-2008, 10:45 AM   #1
Maximum Bitrate
 
Robby BMW's Avatar
 
Join Date: Aug 2005
Location: Italy
Posts: 525
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: 3439
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: 3451
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: 1726
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: 3438
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: 3297
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: 3278
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: 3241
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: 3249
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: 3208
Size:  54.3 KB
- comparison between the two Parking Sensor kits -
__________________
_______________________________________
Car installation 95% [■■■■■■■■■■■■■■■■■■■]
Current project: Parking sensor USB interface

Last edited by Robby BMW; 08-14-2008 at 04:11 AM.
Robby BMW is offline   Reply With Quote
Advertisement
 
Advertisement
Advertisement Sponsored links

Old 06-25-2008, 10:46 AM   #2
Maximum Bitrate
 
Robby BMW's Avatar
 
Join Date: Aug 2005
Location: Italy
Posts: 525
Lightbulb USB interface construction

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

Name:  3D.jpg
Views: 3227
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: 2875
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: 3185
Size:  143.8 KB
- PCB components side -

Name:  CS.jpg
Views: 3165
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: 2908
Size:  115.1 KB
- interface connection diagram -
__________________
_______________________________________
Car installation 95% [■■■■■■■■■■■■■■■■■■■]
Current project: Parking sensor USB interface

Last edited by Robby BMW; 07-04-2008 at 10:11 AM.
Robby BMW is offline   Reply With Quote
Old 06-25-2008, 10:46 AM   #3
Maximum Bitrate
 
Robby BMW's Avatar
 
Join Date: Aug 2005
Location: Italy
Posts: 525
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: 3072
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: 3067
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: 2846
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: 2796
Size:  110.6 KB
- the real PCB (copper side) -
__________________
_______________________________________
Car installation 95% [■■■■■■■■■■■■■■■■■■■]
Current project: Parking sensor USB interface

Last edited by Robby BMW; 07-06-2008 at 07:17 AM.
Robby BMW is offline   Reply With Quote
Old 06-25-2008, 10:47 AM   #4
Maximum Bitrate
 
Robby BMW's Avatar
 
Join Date: Aug 2005
Location: Italy
Posts: 525
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

Last edited by Robby BMW; 09-13-2008 at 02:21 AM.
Robby BMW is offline   Reply With Quote
Old 06-25-2008, 11:30 AM   #5
Variable Bitrate
 
Join Date: Nov 2004
Posts: 239
Robby....OMG....WOW....Where do I order!
juve021 is offline   Reply With Quote
Old 06-25-2008, 11:38 AM   #6
FLAC
 
Chairboy's Avatar
 
Join Date: Jan 2004
Posts: 1,379
Great stuff! I look forward to tracking your progress on this project.
__________________
Chrysler 300 - Fabricating
http://hallert.net/
Chairboy is offline   Reply With Quote
Old 06-25-2008, 02:39 PM   #7
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,217
Looks good, must subscribe to see how it comes along.
Enforcer is offline   Reply With Quote
Old 06-25-2008, 04:25 PM   #8
Low Bitrate
 
Join Date: Dec 2006
Posts: 56
Excellent...Subscribed
__________________
www.dentalteam.org
DigitalVampire is offline   Reply With Quote
Old 06-25-2008, 04:41 PM   #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!
dencker is offline   Reply With Quote
Old 06-25-2008, 04:52 PM   #10
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,217
Quote: Originally Posted by dencker View Post
Seems interesting! I'm looking forward to seeing how it turns out!

Pretty good actually.
Enforcer is offline   Reply With Quote
Old 06-25-2008, 05:00 PM   #11
Newbie
 
dencker's Avatar
 
Join Date: Jun 2008
Location: Aalborg, Denmark
Posts: 27
Quote: 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!
dencker is offline   Reply With Quote
Old 06-25-2008, 05:20 PM   #12
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,217
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.




Parking Radar USB Test
You need to upgrade your Flash Player

Last edited by Enforcer; 06-25-2008 at 05:28 PM.
Enforcer is offline   Reply With Quote
Old 06-25-2008, 05:30 PM   #13
Newbie
 
dencker's Avatar
 
Join Date: Jun 2008
Location: Aalborg, Denmark
Posts: 27
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!
dencker is offline   Reply With Quote
Old 06-25-2008, 05:53 PM   #14
Confusion Master
 
Enforcer's Avatar
 
Join Date: Sep 2003
Location: If you go down to the woods today, You're sure of
Posts: 10,217
Quote: 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.
Enforcer is offline   Reply With Quote
Old 06-25-2008, 06:04 PM   #15
Newbie
 
dencker's Avatar
 
Join Date: Jun 2008
Location: Aalborg, Denmark
Posts: 27
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!
dencker is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Syncroized 5V@10A power supply POL. Now Taking Orders!!! Beehphy User Innovations 102 09-17-2008 05:07 PM
Core Duo / Core 2 Duo Mini-ITX boards RedGTiVR6 General Hardware Discussion 93 08-11-2008 09:40 PM
Installing a USB Hub up-front? Read this... hd54321 General Hardware Discussion 13 02-09-2007 11:49 AM
Problem with ITPS / hibernation and External USB HD veetid Power Supplies 5 01-02-2006 08:35 PM
My USB/Wifi troubles. JPuma General Hardware Discussion