Tuesday, June 28, 2011

OBD-II Port DetailsTyco/AMP produces the in-car (female) side of the plug as part numbers 179631 or 348822, and both use the same pins, either P/N 776001 or 1827012. Molex has a similar offering; the pins are P/N 50420, and the housings are 51115 (with a 51117 retainer) and 51116 (with a 51118 retainer). Delphi/Packard's part numbers are 11210250 for the housing and 12129373, 12129484, 13525297, and 15317769 for the pins (female Metri-Pack 150). The client-side connection is pretty ubiquitous. The Molex P/Ns are 57964 for the pins, and 68503 for the housing. Delphi shows 12110252 as the P/N for the housing, and 12040993, 12047581, 12059894, 12092165, 12110502, 12160811, 15305307, or 15326725 for the pins (male Metri-Pack 150), depending on the size you need. OBD-II Port DetailsCAN Bus Location in Fiat Linea

#include <18F4550.h>#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN#use delay(clock=48000000)#use rs232(baud=9600, xmit=PIN_E1,rcv=PIN_E2)//not used only for diagnostic#define LED PIN_D1

#include <18F4550.h>#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN#use delay(clock=48000000)#use rs232(baud=9600, xmit=PIN_D1,rcv=PIN_E2)//not used only for diagnostic#define LED PIN_D1

Saturday, June 25, 2011

I generally tend to spend a lot of time working on my PC, not realising what the time it is. A bit of ponder made me realise that I did not have a clock in my room (Thats the Xcuse!!).. Clock in the deskbar/panel/Taskbar is so Uncool.. So I decided to make a custom made digital clock.

An immediate rummaging of my component inventory revealed that I had the necessary gear to accomplish the task..

So here's the part list:-

PIC 16F628A

RTC DS1302

HD44780 Compatible 20x4 LCD Display

Rotary/Quadrature Encoder

Resistors

Capacitors

Diodes

LM7805

Prototyping Board

Trimpot 10K

Patience

Development Platform: MPLAB using CCS C Compiler and a PICKIT3 Programmer/Debugger.

Cool Factor: No Buttons for Menu. Only a single Quadrature Rotary Encoder accomplishes all required menu operations.

Thursday, June 23, 2011

While browsing www.hackaday.com I came across TI deal giving 50% off along with free shipping for their TI MSP-EXP430FR5739 Experimenter's Board. At $14, this board is a steal for budding hobbist like me in India. So I decided to try my luck and use the discount coupon shown on Hackaday site and order the board.

To my surprise, the good (I am duty bound to call them so) guys at TI accepted my order and shipped it the same day for delivery at Delhi, India. They shipped the order on Monday 20 Jul 2011 by FedEx and it was delivered to my doorstep by today 23 Jul 2011 noon. 4 days for delivery, I am super impressed.

No sooner than I came home, I saw the box (unboxed) at home and promptly jumped to open it. So here it is for all prospective buyers.. the unboxing of TI MSP-EXP430FR5739.

Main Box (Small Package)

Rear View

Package Dimensions

Inside Contents

Experimenters' Package

Thats all folks.... I will update you all on progress on the actual usage of the board. Thanks for the read

Saturday, June 11, 2011

This post I am going to explain how I went about decoding / hacking a COTS Ultrasonic Car Parking Sensor. This project idea primarily stemmed out of sheer curiosity after reading a similar post at MP3Car.com. The the original hack was done by one of the forum members at MP3car and he had explained his hack in great detail, surprisingly the author has withheld the firm ware for the micro controller and is available on sale only.

Being a electronics enthusiast with decent programming skills, I decided to venture in recreating this hack and most importantly release the code in open source.

I sourced the a parking sensor from ebay.in. And as the luck would have had it, I got the same parking system as the original author had.

The parking sensor communicates with the display console over an rf link. In my case I screwed up my RF receiver in the display console due to hurry and 'bad engineering practises'. So the only option left was hard wiring to my micro-controller dev. board.

Decoding the Communication Protocol

The system uses PWM (Pulse Width Modulation) to communicate. The shorter pulse in logic 0 and the longer pulse is logic 1.

Since I have no high end development tools at my home to estimate pulse width, I used my devel. board to estimate the pulse width. I used a slightly modified EX_CCPMP.C example available in CCS compiler library to estimate the pulse width. Following is the code

Using this I realised that the pulse widths were
3599 us -> Logic Zero
7198 us -> Logic One.
They might be wrong due to wrong setup of CCP module (due to my ignorance). But it doesn't matter till the time you get two distinct pulse widths.
Once this step was over the next step was to make a bit stream out of this pulse width outputs. I slightly modified the above code to dump the bit stream on a serial console

Bit StructureTotal data packet of each sensor consists of 24 bits (3bytes x8) The first byte is the sensor address and consists of 2 nibbles which are complementary of each other (1111 0000).
The second byte is the complement of third byte. and third byte contains the distance data (in centimeters)

Sensors are numbered as 0,1,2,3 so in the binary representation along with the nibble part they become:-A=11110000 (1111 0000)B=11010010 (1101 0010)C=11100001 (1110 0001)D=11000011 (1100 0011)

Another hidden thing (which the original author did not mention). Each data frame is transmitted twice and the readings are not repeated. So the bit stream is like AABBCCDDAABBCCDD........

Once we are done till here... the last step is only to write the code to search the bit stream for those golden characters mentioned above.The logic is as follows