Today is the 40th anniversary of the launch of Apollo 11 from Pad 39A at the Kennedy Space Center in Florida. I remember that day well. I was 17 at the time. I was working this particular summer at the local hospital as a combination grounds keeper / painter. On this day, I commandeered one unused patient room on the third floor. I then setup my RCA cassette tape recorder on one of the bedside tables-- just barely in audio range of the black/white TV set hanging over head. I closed the door, and hang out up there until the Apollo 11 crew made it into parking orbit.. Of course, some people heard the TV and before I knew it-- the room had a number of interested people standing around. I still have that recording---somewhere?
Today I want to introduce the new version of the VID circuit board. I also want to explain in detail, how it works.
Pictured to the left is the latest [http://www.cadsoftusa.com/] schematic drawing of what I am currently calling the VID short for----Vehicle Information Device. It could also be called YAM-- for Yet-Another-Meter.
The first thing the reader will notice about this design is my choice of an Microchip 18F2520 micro controller. Indeed, some might be tempted to question why I did not use a smaller processor for this "simple application." When I started this project, I used a 16F648A. The first generation VID actually worked quite well running at 4 Mhz and constrained by the 4 K limit on program memory.
However, all things being equal, I decided to move up to the 18 series for this application---mostly to focus on getting things done- rather than worrying about running out of memory at any second. In this application, the 18F2520, runs on its own internal 8 MHz clock.
Looking at the circuit diagram the reader will notice that I am using four connectors to tie the VID to the world. There is one connector called X4 for power/ground/and vehicle signals. X1 is the in circuit programming connector (ICP) used for in-circuit programming--allowing the user to eventually modify the VID firmware. X3 is the BCD connector is used to connect the VID to the display card. Finally, there is another four pin connector called X2. X2 is wired as a dedicated RS-232 port.
X4 is a four pin connector used to bring vehicle power, vehicle ground, vehicle speed sensor, and vehicle fuel injector signals on to the board. The battery power pin is connected directly to the input of a LM7805 (IC3) 5 volt regulator. The ground pin is wired to the center pin of IC3-- this is the official ground point on this card.
The vehicle speed sensor (VSS) pin is connected through R6 series resister before connecting to (non-inverting) IC1A pin 5 of a LM339 linear comparator. Pin 6 of IC1A is tied to resistors R2 and R12-- which together, form a voltage divider. R2/R12 provide approximate 50 percent of the vehicle battery voltage level as a voltage reference for the VSS half of the circuit. The output of IC1A, being an open collector type, is pulled up to VDD/VCC via R8. This output line is then connected to pin 11 of the IC1. Pin 11 of the CPU is the input to the Timer1/Counter1.
It can not be emphasized enough-- the series resistors on both the VSS and INJ line serve to limit the possible current that could be drawn should one or both of these lines go to ground. Nevertheless, each of these lines should also feature an in-line fuse (positioned as close to the vehicle connection point as possible) of about 250 milliamp rating to protect things---just in case.
The (user) selected vehicle fuel injector (INJ) is connected to the VID via a voltage divider formed from resistors R5 and R3. Together, they drop the maximum voltage seen by the inverting input of IC1B to about 3.2 volts. The reason, the injector signal level is reduced is because this version of the VID features what I will call dynamic injector level sampling. This means that I use the internally programmable voltage reference supplied by the CPU to provide a reference voltage for the external comparator.. Since,this reference voltage is only capable of being driven to some percentage of VDD/VCC, I ether had to amplify this signal, or scale down the other. Therefore, I scaled down the injector input level to match this level. Dynamic injector level sampling allows the user to configure the VID to adapt to almost any vehicle fuel injector condition. For example, with vehicles with saturated type fuel injectors, the injector reference level can be set and forgotten, peak and hold types often require two different levels per pulse cycle. This circuit there, allows the CPU the option of managing the reference level on the fly. It can should, therefore, handle most P&H type systems. The reader will note, the divided signal injector input is also connected to pin 2 of the CPU. This (feature) will allow the CPU to read the analog level of the signal. Thus, the operating battery voltage of the vehicle can also be ascertained and sent to the user. (I might note: this system is capable of reading up to a total of 4 analog voltages in this fashion.) Having this analog input also allows the processor to potentially decide for itself what reference voltage levels to issue to the external comparator. The output from IC1B is pulled up to VCC though R7, and also connected to the CPU at pin 21. In this application, pin 21 is configured as a high priority interrupt. Each time, this pin changes logic state, the CPU generates an interrupt. This interrupt is used to either start or stop the 62.5- 125 microsecond clock. In this fashion, the device determines the pulse and period width of the fuel injector input within less than 250 microseconds of precision. Using this measurement granularity, and taking into account other factors, the device should be able to measure fuel usage to within a few percent of actual.
The other components on the VID are used to connect the VID with either the BCD display board, or to a host computer via either, the serial interface connector, or the on-board Blue Tooth module--by radio.
IC2 provides the necessary interface between logic level serial signals provided by the CPU and the NRZ signals required by RS-232. IC2 is a Maxim 232. The 232 uses 4 polarized capacitors to produce the necessary voltage levels required by RS-232 interface
The two-wire interface to the display board uses IC4C and IC4D. IC4 is a CMOS compatible AND gates of the 7400 logic family. In this application, each of the four gates are simply used as buffers. In addition to BCD_CLOCK and BCD_DATA pins, X3 also provides connections for three remote tactile switches. The three switches are normally located on the display card. X3 also provides power and ground to the display card.
The final element of this version of the VID is the [ http://www.connectblue.com/products/bluetooth-products/oem-modules/oemspa310/] Blue Tooth module. Shown at the bottom of this schematic. In this configuration, the Blue Tooth module merely copies all outbound serial traffic and relays it to any compatible Blue Tooth device within range. The VID Connect Blue module is configured as a server. Other Blue Tooth devices will connect as clients. The default baud rate for the VID is set at 57600. (The Blue Tooth module will currently function at only 57600 baud.) The reader may also notice a jumper labeled: SJ1. This is left open unless the IC2 is removed from the board. At that time, the Blue Tooth device can be configured to receive commands and traffic from the Blue Tooth client. IC4A and IC4B and gates are used to interface the 3.3 volt [Connect Blue] module with 5 volt logic circuits.
The final version of the VID will feature full-duplex communications via the Blue Tooth interface. But at the present time, the VID Blue Tooth communications is outgoing only.
Final note: The latest VID design features provisions for adding filter capacitors and protection diodes to the two signal input lines. While, in my case, the signal lines were clean, I wanted to add these to the design in case others did not fair as well.
One possible PCB layout is shown above.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment