In the last post, I said I would release the schematic of the devices I am working on.
I am now releasing a very preliminary schematic drawing (Eagle CAD) of the VID card featured in yesterday's post. The only variation is the physical location of the tactile UP/DN/ACTION switches. This drawing shows the resister pull-ups for the switches only. In fact, the switches are (currently) located on the VID card.
As the reader can see, the circuit is really quite simple and straight forward. It consists of a total of three ICs and one 5 volt regulator. There are a three molex style header, and one DB-9, connectors on this card. The three molex connectors are designated as X3,X1, and X4. The DB-9 is shown as X2.
Starting with the power/signal connector: X4. Connector X4 brings vehicle power from a switched connection point near the cruise control card (CC) to the VID. The VID vehicle ground connection is also obtained at the CC card, as is, the vehicle speed sensor input. The other connection point on X4 is the fuel injector input (INJ). In this application, the INJ signal is obtained from tapping one of the fuel injector signals near a block ballast resister device located under the hood, and delivered to the VID card via X4. The decision to tap the the ballast resistor was made for purposes of expedience. In most applications, the best place to obtain this signal is at the ECM connector--- located below the front seat passenger's feet. Electrically, the VID input circuit will respond to the signal from either location. Also tapping at the ECM would eliminate the postive 4 volt offset that is seen when tapping at the ballast resister.
From connector X4, vehicle power is converted to logic +5 volts by the LM7805 regulator called IC3. Logic ground is also established at pin 2 of IC3 by way of connector X4. On the VID, both engine signals are each buffered by two 1K resisters. In any PCB layout, the input resistors should be placed in such a way so as to limit the chance that any short circuit condition could affect the integrity of either signal. I would recommend that one resister (for each signal) be placed at the connector, while the other as close to IC3 as possible. My tests have shown that 2K in addition the the input impedance of IC3 works well. Also, by splitting the resistance here, it would be possible to add filter capacitance-- if that became necessary.
The VSS signal is fed to one the high impedance non-inverting inputs of the quad comparator: IC1. While, the INJ signal is fed to another inverting input of IC1. The reference voltage for both comparators is established by dropping vehicle power down to about 9.1 volts using a zener diode and a 100 ohm resistor. The outputs from each of the comparators are pulled up to logic VCC by 3.3 k resistors. In this way both 12 volt signals are converted to proper logic 5 volt levels. When the INJ signal is inverted by IC1, both output levels are active high at the CPU inputs. The schmitt trigger inputs of the comparator also define sharper rise and fall times for the CPU edge sensitive interrupt inputs.
The VSS output from IC1 is connected to the PIC's timer1/counter1 via pin 11 on the 18F2520. The INJ output from IC1 is connected to the PIC's via pin 21 of the CPU. The processor monitors the INJ signal using one of its high priority interrupt inputs. Using it to constantly compute the ratio of pulse on-time to the total period duration. In this application, PIC Timer 1 is used as a counter. Using Timer 1, the program merely reads the count total each second, reset it, and and allows the count to build up again. For each second of operation, the processor tabulates both INJ duty cycle and VSS counts The results are placed in one of four internal data structures after it finishes computing RPM, MPH, distance traveled, and gallons used, and the like.
The other IC on the VID card is IC2. IC2 is a Maxim 232 RS-232 interface chip. Four, 1.0 uf capacitors allow IC2 to provide the necessary negative going signal voltage to make the output signals comply with the RS-232 standard. The RS-232 signals can connected to the host computer via connector X2. NOTE: the published picture of the prototype card features a standard PCB DB-9 style connector, the proposed PCB might opt for a header style connector instead.
Upon, start up, the VID is programed each second (by default) to compute the necessary data elements and send the contents of data structure #1 to the host through the serial port as message #1. If a proper request is initiated from the host software, VID can also send one of the other (requested) data structures as messages 2,3, or 4 before resuming default operation.
Data Message #1 consists of the following data items: MPH, RPM, GPH(gallons per hour) and preliminary MPG. Message #2 sends accumulated tank information: gallons used, distance traveled. Message #3 sends raw data on injector pulse on time and period width information.
Message #4 sends accumulated trip information. (the same as message 2--but for trip)
Future versions could also provide additional messages. Such as the status of the analog inputs on the PIC18F2520. With the extended memory capability of this chip, there is almost no limit to the vehicle data acquisition capability of this architecture.
In addition to the serial port, the VID provides a custom two-wire output format via connector X3 to either a LCD or LED display card. In its' current state, the two-wire interface connects to a LED based card. Connector X3 also provides connection points for the status of three tactile switches for UP/DN and ACTION to the VID. While the pull-up resistors are located on the VID, the switches will be located on the display card.
The two wire interface consists of a BCD_DATA line and a BCD_CLOCK line. This two wire interface is very similar to well known I2C style interface, except that it does not provide for read back capability. The two-wire interface in this application sends one eight bit byte for each digit used on the BCD card. Embedded in each byte is a four bit address and four bits of actual BCD data. Using this format, allows the device to send up to 16 BCD digits of data to any properly equipped card. In the proposed application, the VID would send 3-4 digits of BCD data along with one byte of status and decimal point information. Please refer to the writeup on the BCD card for more information on the two-wire format used here.
Connector X1 provides for In Circuit Programming capability for the PIC 18F2520.
Below is a preliminary BOM or parts list for the VID.
9.1V 1/2 watt zener diode
C1 1 uf 20 v polarized capacitor
C2 1 uf 20 v polarized capacitor
C3 1 uf 20 v polarized capacitor
C4 1 uf 20 v polarized capacitor
C5 0.1uf ceramic capacitor
C6 0.1uf ceramic capacitor
C7 0.1uf ceramic capacitor
C8 10 uf 25 v polarized capacitor
C10 0.1uf ceramic capacitor
U$1 PIC18F2520 28 pin cpu
IC1 LM339N Quad comparator 14 pin dip
IC2 MAX232 RS-232 interface chip 16 pin dip
IC3 7805T 5 voltage regulator
R1 3.3K 1/8 watt resistor
R2 2.2K 1/8 watt resistor
R3 1K 1/8 watt resistor
R4 100 Ohms 1/2 watt resister
R5 1K 1/8 watt resister
R6 1K 1/8 watt resister
R7 2.2K 1/8 watt resister
R8 3.3K 1/8 watt resister
R9 2.2K 1/8 watt resister
R10 15K 1/8 watt resister
R11 2.2K1/8 watt resister
U$1 PIC 18F2520 28 pin dip
X1 22-23-2041 molex header
X2 22-23-2041 molex header
X3 22-23-2081 molex header
X4 22-23-2041 molex header
The image above represents one possible PCB layout for this card.As I said before, the code for the PIC 18F2520 can be obtained by contacting me via email.
KEYWORD: Mileage, Fuel, Trip Computers
References:
wiki: http//ecomodder.com/wiki/index.php/MPGunio
No comments:
Post a Comment