I spend a fair amount of time zipping around town on my scooter, and thought it would be cool to add a voltage monitor to warn when the battery might need recharging. Waiting until the electric starter no longer works is somehow lacking. So after an evening with an Arduino Duemilanove, I had a simple programmable voltage divider with 3 LEDs indicating battery low, good, and charging. Done.
That’s when I saw Liquidware’s very cool TouchShield Slide OLED display with touch screen. It was telling me it wanted to be on my scooter. It’s a bit overkill for just battery status, so I added temperature and time/date readouts. I went to Sparkfun.com and found a DS18B20 temperature sensor and a DS1307 RTC chip. Perfect. Oh wait, what’s this…an accelerometer? Sweet! Hey, a GPS chip…
So a few weeks later, here’s what my battery voltage indicator is looking like: You can see in the first photo that the TouchShield display is separated from the Duemilanove / Cell Module / Sensor shields. These are installed “under the hood” of my scooter and provide power and signals to the display module via a standard 8-wire ethernet cable. This keeps the sensors (accelerometer, GPS, cell module, etc.) with the scooter making it functional even without the removable external display, as we’ll see later. (NOTE: this photo was taken before the display was fully mounted inside the enclosure, and is shown without the protective rubber boot.)
- Battery voltage indicator
- Time and date
- Lean gauge with resettable max L-R indicators
- Current speed
- Resettable max speed indicator
- 2 resettable trip meters
- Latitude and longitude readouts
- Compass heading readout
- GSM/GPRS quad-band cellular module
The sensors are mounted on a Proto Shield PCB from Ladyada’s Adafruit Industries (which is also where I get my Duemilanoves). Most of the wiring was done using 30 gauge Kynar solid wire, with heavier gauge used for some power and ground connections. Good mechanical connections are important considering the shock and vibrations this will be subjected to.
I went with breakout boards for the surface mount chips. They take up a bit more real estate on the PCB but are very easy to solder and save a lot of construction time. Note the DS1307 RTC on the underside…the profile is still low enough to allow the parts to fit nicely in the open space between boards when stacked. I soldered a right-angle pin header directly to the pads of the GPS breakout board, and straight pin headers on the others.
You might be wondering why I even included the RTC chip since time-of-day and date can be gotten from the GPS data. The DS1307 RTC chip also has 56 bytes of non-volatile RAM. I’m using these registers for storing the trip meter and odometer values so they can be restored between power cycles.
The GPS uses pins 0 and 1 for its TxD and RxD signals to communicate to the Duemilanove. The TouchShield Slide also uses these pins for downloading sketches. The “Program Switch” is used to disconnect the TouchShield Slide from these pins when not downloading so they’re free for use by the GPS. Fortunately the TouchShield Slide uses pins 2 and 3 during normal operation, which I’m driving with digital I/O pins 4 and 5 on the Duemilanove.
Three devices require serial communications (GPS, TouchShield Slide, and Cell Module), and it was a real challenge getting the Duemilanove to support these at data rates needed for the desired performance. Having the GPS, running at 9600 baud, use the hardware serial port (pins 0 and 1) proved to be the best approach. The TouchShield Slide (19200 baud) and Cell Module (4800 baud) use digital I/O pins, and Mikal Hart’s NewSoftSerial library for ‘software’ interrupt driven serial communications was invaluable in getting these to play nicely together.The GPS chip is powered by the 3.3v regulator. The 10k resistor and 1N914 diode circuit on the serial RxD line of the chip are used to dampen the 5v signal from the Arduino hardware TxD line used to send data to the chip. When that line is high, the diode doesn’t conduct allowing the 10k pull up resistor to apply a 3.3v high to the GPS RxD input. When it’s low, the diode conducts and the line sinks through the TxD driver pulling the line down. The .7 volt drop across the diode is still sufficient for a low to be recognized by the GPS RxD input. A schottky diode with a .2v drop might be an improvement here, but the 1N914 seems to work fine. The GPS is rarely receiving data anyways – data is usually sent only one time to initialize the NMEA sentences to be sent, the baud rate, and the update cycle rate.
The TouchShield Slide is mounted on another Proto Shield PCB. The CAT-5 connector is wired to the PCB using solid telephone wire to provide power and ground, and to connect the RxD and TxD signals from the Duemilanove to the display. Another line is brought up to drive the beeper.
For more detail: Scooterputer
This Post / Project can also be found using search terms: