0% found this document useful (0 votes)
31 views9 pages

Copia de Bilberry Rasp PDF

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

Bilberry Pi

Interface a Raspberry Pi to your car by


Owen Brotherwood.
Introduction
Software
Multimedia
Car diagnostics
Hardware
ALDL
Block Diagram
Daughter Board
OBD-II
Other Stuff
Connecting to M
Optocoupler
Nokia USB Cable
Links...
Introduction
The Raspberry Pi can be used as an intelligent interface to one’s car diagnostics.
Combine with a multimedia sw distribution, a fun in-car computer.
Raspberry Pi Forum link

Software

Multimedia
Given the sucess of ​http://openelec.tv/​ on Raspberry Pi, one might as well use the distro to
base further sw on ...

Car diagnostics
Work in progress for what software to use to support hardware that comes below...
Hardware

ALDL
ALDL​ (Assembly Line Diagnostic Link) was a
proprietary on-board diagnostics system
developed by General Motors prior to the
standardization of OBD-I.
On my car, the data is available as a 8192 baud
asyn stream with 8 bit, no parity and 1 stop bit.
Note that the connection, “M”, is a combined
tx/rx that is TTL “high” with no activity.

Raspberry Pi Forum link

Block Diagram

Daughter board Raspberry Pi


tx/rx pins or other GPIO @
Combine the tx/rx such that 8192 baud/8 bit/no parity/1
the “M” line is not kept high stop bit
● Simple: diode and
resistor
● Complex: pnp’s etc
● Optocouplers

Level changer/Protection for


connection to Pi as non 5v
friendly

Connectors to PI and
My car ALDL connector “M”/Ground
No B and K is for SIR:
airbag diagnostics

On my car, I would not use a ALDL connector to the ALDL connection, rather connect
behind the connector and use a pin connection to a little daughter board that contains some
very basic components as close to the ALDL connector as possible.
1. Don’t have to find and order an ALDL connector …
2. Stabilize the circuitry that is interfacing directly to the car, and hopefully protect the
car ...
3. Provides interface to the Pi tx/rx pins with level changers/protection.
4. Optional: Allow for a testing possibility using a Nokia USB cable so that some
development can be done on other hardware than a Pi.
So, a little piece of soldering for a board that should connect to the ALDL data stream (and
ground), some components and some connectors for connection to PI/USB Cable.
Daughter Board
As a first design attempt, use Optocoupler.
● R1 probably 1k
● May need R2 or could be a diode like a MAX solution
● R’s on Pi side probably 1k
● Some circuits use diode in reverse direction of Opto ”Diode”

Quick RS Parts list


693-5937 opto
628-8931 diode
135-847 resistor
135-910 resistor
OBD-II
OBD-II is a current standard for car interface.
Raspberry Pi Forum link
As I received 2 from obdsol, please ask via forum if y wish to receive one of them (EU only).
You have to have some experience please...
A very productive new owner found in the north east of england: I am pretty sure that
something will come out of it :)

http://www.obdsol.com/stn1110/ As such, the interface to the car can be


controlled by a STN11xx with a MCP2551.

Only a standard tx/rx needed from the Pi


with level conversion.
Other Stuff

Connecting to M
http://lukeskaff.com/?page_id=305 One design issue with the microcontroller UART
is that the transmit pin on the microcontroller is
held high when inactive. Holding the serial line
high when inactive is extremely common and
used in many serial communication methods. If
the transmit pin of the microprocessor was
connected directly to the ECU serial line it would
be held high when the ECU was trying to bring
the line low for communication. A transistor is
used on pin PD1 of the microcontroller, as seen
in Figure 7, to isolate the transmit line. The
ALDL serial line is held high by the ECU, the
PNP transistor only brings the serial data line
low when the transmit pin on the
microcontroller is brought low.
In order to prevent the receive UART from
being filled with data that is being transmitted
from the AVR microcontroller a transistor is use
to isolate the receive line. The microcontroller
sets pin PD5 high when transmitting so the
receive UART on pin PD0 does not see the data
being transmitted. When the microcontroller
brings pin PD5 low the transistor is able to pull
the receive UART pin, PD0, low when the ALDL
line is low. An ALDL serial activity LED was
added for debugging purposes. The LED comes
on when the ALDL serial line is pulled low and
remains off when there is no activity on the line,
since the inactive state of a serial line is high.

A widely used solution to interface to a It is presumed that the diode allows the car
serial port is combining the serial tx/rx on computer to pull the “M” line low.
the TTL level side of a MAX using a diode The resistor has some purpose as well I
and a resistor suppose.
I presume that the data transmitted to the
car is also seen as received: “local echo”
which could be nice as if the program does
not see its own data, it could be a form of
collision.
Optocoupler
http://dk.rs-online.com/web/p/optokobler/69
35937/
ACPL-827-000E
Optocoupler DC i/p 2-CH Trans o/p PDIP8

http://www.planetfall.com/cms/content/open OBD-II
diag-obd-ii-schematics-pcb-layout

http://www.nerdkits.com/videos/obdii/ OBD-II
Nokia USB Cable
A Nokia USB Cable could be used to test against an ordinary computer or provide tty via
USB on Pi. Note that it uses 3.3v

http://jethomson.wordpress.com/2010/02/21 Testing 
/diy-usb-to-serial-cable-for-3usd/ We’re now finished with the phone connector, 
so now we’ll turn our attention to the 
remaining cable which has the USB connector. 
Strip the wires which correspond to pins 6, 7 
and 8. Set your multimeter to measure 
voltage. Attach the black cable to the wire 
which corresponds pin 8 (GND). Attach the red 
cable to the pin 6 wire (TxD). Make sure none 
of the wires are touching one another! Plug in 
the USB connector. The multimeter should 
read ~3.3V (I measured 3.5V). Unplug the USB 
cable. Repeat the previous steps for the pin 7 
wire (RxD). The RxD line’s voltage should be 
less than the TxD line. The other wires are not 
Pin 6 is the cable’s TxD line, pin 7 is RxD line, and  needed for communicating with your 
pin 8 is ground. For my cable pin 6 was white, pin 7  ATmega(Red: Pi); nonetheless the pin 3 wire 
was blue, and pin 8 was black. I also had two  measured 0V and the pin 4 wire measured 
additional wires, one green (pin 3), one red (pin 4). 
However, I can almost guarantee your colors will be  3.0V. Your cable may not have a pin 3 or pin 4 
different so you must perform the steps described  wire. 
above. To be positive we’ve identified the wires  For our second test we’ll temporarily turn our 
correctly we can perform a couple of tests. cable into a loopback cable and use a serial 
communication program to see if we’ve 
identified the wires correctly. Make sure the 
cable is unplugged! Twist the RxD and TxD 
lines together. Make sure none of the other 
wires are touching one another! Plug the cable 
in.

Links...
Most of the information comes from these (including the graphics)
● http://elinux.org/Rpi_Low-level_peripherals
● http://www.thebox.myzen.co.uk/Raspberry/Buffer_Board.html
○ Connectors ala Buffer Board:
■ http://uk.rs-online.com/web/p/headers-p ... es/6811351​ Female
■ http://uk.rs-online.com/web/p/headers-p ... es/6811654​ Male
○ Or more height ala
http://zuzebox.wordpress.com/2012/06/25/raspberry-pi-protoboard-sm-v0-10/
■ http://uk.rs-online.com/web/p/headers-pcb-receptacles/4999702
● http://www.thebox.myzen.co.uk/Tutorial/Inputs.html
● http://lukeskaff.com/?page_id=305
● http://www.ebay.com/itm/Arduino-FT232RL-USB-to-Serial-Module-USB-to-TTL-level-
USB-Cable-dupont-248-/260917151841?pt=LH_DefaultDomain_0&hash=item3cbfdfc
861&afsrc=1#ht_3125wt_732

You might also like