Aquaticus

Projects for geeks

Gear Position Indicator

11 Nov 2010

Gear Position Indicator displays gear number for motorcycles, scooters or cars.

Features

  • Displays gear number without delay
  • Cool animation modes
  • LED matrix display
  • Automatic brightness
  • Temperature sensor
  • Celsius and Fahrenheit scale
  • Software display rotation
  • Many configuration options

Hardware

Everything is controller by Atmel ATmega88 microcontroller. Temperature is measured by 1wire sensor DS18B20. To control brightness of LED matrix phototransistor is used. One micro-switch is used to control menu and other functions.
The device can be powered from 8V to 20V.

Schematic

Software

The control program is written in AVR GCC C language. The resulting code is 8kb. Summary 1500 lines of C code (without comments).

Functions:

  • Temperature displayed when button is pressed
  • Temperature displayed on N and 6th gear after specified time (can be disabled)
  • 3 gear animation modes: up/down, left/right, none
  • Display angle: 0°, 90°, 180°, 270°
  • Celsius and Fahrenheit scale
  • Temperature display with fraction part or integer
  • Automatic brightness
  • Manual brightness mode
  • Configuration mode
  • Self-test mode

How to modify

The schematic and software do not suit any specific motorbike model. To make use of this device you must modify schematic and the software.
First you must modify gear box interface. The reference design uses 2 ADC lines of microcontroller. One accepts voltage from 0 to 5V (GEAR), the second one accepts voltage from 0V to 12V thanks to voltage divider. If your gearbox require more lines to read current gear use AUX1 to AUX3 lines (not connected in reference design).
Second thing is to modify source code to mach your gearbox interface. Simply modify function GetGear() in file adc.c.

How to build

Safety note

You are responsible for properly interfacing gear position indicator with gearbox. Note that improperly connected gear position indicator may affect work of the engine and your safety on the road may be in danger.
Schematic and software is presented “AS IS” without warranty of any kind.

Components

  • U1: microcontroller ATmega88 SMD TQFP32
  • U2: darlington driver ULN2803 SMD SOL18
  • U3: voltage regulator LM2993 TO92
  • U4: temperature sensor DS18B20
  • T1: phototransistor HPTC3C-44J
  • C1: electrolytic capacitor 470µF 16V
  • C2: electrolytic capacitor 470µF 16V
  • C3: ceramic capacitor 100nF SMD 0805
  • C4: not used
  • R1-R8: resistors 100Ω SMD 0805
  • R9: resistor 100Ω SMD 0805
  • R10: resistor 150Ω SMD 0805
  • JP1: pin header 1×4
  • JP2: pin header 2×3 (Atmel ISP 6 pin)
  • S1: micro switch
  • Red LED matrix 8×8 common cathode 18×18mm

NOTES

  1. U1 can be any Atmega8 family chip with 8kb or more flash, e.g. Atmega8, Atmega88,
    Atmega168, Atmega328, Atmega88P, Atmega168P, Atmega328P. Preferred Atmega88p or Atmega88.
  2. Photo-transistor T1 is optional. When not used LED brightness can be set manually. Any
    replacement is acceptable. Parameters of HPTC3C-44J: 3mm 570nm 30V 110° flat.
  3. Value of C1 and C2 is not critical anything from 100µF should be OK. Suggested low
    profile elements.
  4. LED matrix used in reference design LM-88HR07-CC

Source code

Download or clone on GitHub: https://github.com/aquaticus/GearPositionIndicator

Gallery