motorcycle universal gear indicator

Upload: daviderantze

Post on 02-Jun-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Motorcycle Universal Gear Indicator

    1/15

    Motorcycle Universal Gear Indicator

    author: Vassilis Papanikolaou- vpapanik gmail.com

    Introduction

    This is a new design for a universal gear indicator that can be fitted to any

    motorcycle as an aftermarket accessory. Its main advantage is that its operation

    depends entirely on the gear shift lever movement, instead of connecting to

    speedometer and tachometer sensors (found in expensive commercial devices),

    which are rarely available in older motorcycles. It consists of a main circuit

    http://www.electronics-lab.com/projects/automotive/006/A.jpg
  • 8/10/2019 Motorcycle Universal Gear Indicator

    2/15

    including a 7-segment LED indicator, two Hall sensors that are attached to the

    motorcycle frame, and a small magnet placed on the gear shift lever.

    The main circuit is based on an AVR ATTINY25/45/85 microcontroller, which reads

    the signals of the two Hall sensors and the neutral switch and outputs the current

    gear number to a 7-segment LED indicator, through a 4026 counter/decoder.

  • 8/10/2019 Motorcycle Universal Gear Indicator

    3/15

    Download schematic in .pdf format

    Download EAGLE files in .zip format

    The source code is written in AVR-GCC (WinAVR) and can be programmed withthe default fuses using an AVR programmer (default : ATTINY25 microcontrollerand USBTiny programmer). Moreover, the constant TOP_GEAR 5should bechanged to 6for six-gear motorbikes.

    Download source files in .zip format (v1.3 - 12 Aug 2010)

    The suggested implementation for the main circuit is a small size, double-sidedPCB, with SMD packages for the microcontroller and the decoder ICs. The 7-segment LED is placed in a secondary PCB, connected vertically to the main onein a modular fashion (see pictures). Two PCBs for different Kingbright LEDfootprints (red and blue) are also provided.

    http://www.electronics-lab.com/projects/automotive/006/Schematic.pdfhttp://www.electronics-lab.com/projects/automotive/006/Schematic.pdfhttp://www.electronics-lab.com/projects/automotive/006/Gear_Indicator_EAGLE_files.ziphttp://www.electronics-lab.com/projects/automotive/006/Gear_Indicator_EAGLE_files.ziphttp://www.electronics-lab.com/projects/automotive/006/Gear_Indicator_v1.3.ziphttp://www.electronics-lab.com/projects/automotive/006/Gear_Indicator_v1.3.ziphttp://www.electronics-lab.com/projects/automotive/006/Gear_Indicator_v1.3.ziphttp://www.electronics-lab.com/projects/automotive/006/Gear_Indicator_EAGLE_files.ziphttp://www.electronics-lab.com/projects/automotive/006/Schematic.pdf
  • 8/10/2019 Motorcycle Universal Gear Indicator

    4/15

    Download PCB top layer in .pdf format

    Download PCB bottom layer in .pdf format

    Download PCB silkscreen in .pdf format

    Parts List

    Part Value Comments (for suggested PCB)

    R1

    10 to 220 W

    Depending on preferred LED brightness

    R2, R3 10 W

    C1 220 F / 35V Electrolytic capacitor

    C2 100 nF MKT/polyester capacitor

    MCU ATTINY25/45/85 Mouser Part556-ATTINY25-20SU

    COUNTER 4026 Mouser Part595-CD4026BPWE4

    IC1, IC2 Hall sensor MelexisUS5881LUA(available fromadafruit)

    IC3 7805 5V Regulator TO-220

    BLUE Kingbright 0.3" Mouser part604-SC03-11PBWA/A

    RED

    Kingbright 0.3"

    Mouser part604-SC03-12EWA

    JPx Pin connectors As shown in silkscreen and pictures

    http://www.electronics-lab.com/projects/automotive/006/PCB_Top.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Top.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Bottom.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Bottom.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Silk.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Silk.pdfhttp://gr.mouser.com/ProductDetail/Atmel/ATtiny25-20SU/?qs=8jWQYweyg6Ne6mWXNq20wQ%3d%3dhttp://gr.mouser.com/ProductDetail/Atmel/ATtiny25-20SU/?qs=8jWQYweyg6Ne6mWXNq20wQ%3d%3dhttp://gr.mouser.com/ProductDetail/Atmel/ATtiny25-20SU/?qs=8jWQYweyg6Ne6mWXNq20wQ%3d%3dhttp://gr.mouser.com/ProductDetail/Texas-Instruments/CD4026BPWE4/?qs=YxwvVplHM%2fmZPbjDskdW1w%3d%3dhttp://gr.mouser.com/ProductDetail/Texas-Instruments/CD4026BPWE4/?qs=YxwvVplHM%2fmZPbjDskdW1w%3d%3dhttp://gr.mouser.com/ProductDetail/Texas-Instruments/CD4026BPWE4/?qs=YxwvVplHM%2fmZPbjDskdW1w%3d%3dhttp://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=158http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=158http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=158http://www.adafruit.com/http://www.adafruit.com/http://www.adafruit.com/http://gr.mouser.com/ProductDetail/Kingbright/SC03-11PBWA-A/?qs=S%2fDyAMLKE9jldUZgSwf1Rg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-11PBWA-A/?qs=S%2fDyAMLKE9jldUZgSwf1Rg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-11PBWA-A/?qs=S%2fDyAMLKE9jldUZgSwf1Rg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-12EWA/?qs=85uWm5%252bqJhUIXYRe%2fZqSeg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-12EWA/?qs=85uWm5%252bqJhUIXYRe%2fZqSeg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-12EWA/?qs=85uWm5%252bqJhUIXYRe%2fZqSeg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-12EWA/?qs=85uWm5%252bqJhUIXYRe%2fZqSeg%3d%3dhttp://gr.mouser.com/ProductDetail/Kingbright/SC03-11PBWA-A/?qs=S%2fDyAMLKE9jldUZgSwf1Rg%3d%3dhttp://www.adafruit.com/http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=158http://gr.mouser.com/ProductDetail/Texas-Instruments/CD4026BPWE4/?qs=YxwvVplHM%2fmZPbjDskdW1w%3d%3dhttp://gr.mouser.com/ProductDetail/Atmel/ATtiny25-20SU/?qs=8jWQYweyg6Ne6mWXNq20wQ%3d%3dhttp://www.electronics-lab.com/projects/automotive/006/PCB_Silk.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Bottom.pdfhttp://www.electronics-lab.com/projects/automotive/006/PCB_Top.pdf
  • 8/10/2019 Motorcycle Universal Gear Indicator

    5/15

    ossible improvement

    In the current design, when the neutral switch is open (there is a gear on), there

    appears to be a very small current (< 0.5 mA) sinking through R3, due to the

    voltage difference between the neutral switch connection (TO_POWER-4) and the

    microcontroller. If the neutral indicator is of LED type (not a resistor bulb), there

    is a possibility that it stays dimmed, instead of being completely off. In that case,

    a small switching diode (1N4148) can nicely replace R3 (on the same PCB) in

    order to block this small incoming current when the neutral switch is open, as

    shown in the figure below :

    For a better insight in the above issue, the following script can be imported in Paul Falstad'sexcellent circuit simulator

    http://www.falstad.com/circuit

    $ 1 5.0E-6 10.20027730826997 62 5.0 50

    R 192 96 192 48 0 0 40.0 5.0 0.0 0.0 0.5

    R 512 96 512 48 0 0 40.0 12.0 0.0 0.0 0.5r 192 96 192 176 0 10000.0

    x 231 142 309 145 0 12 internal pullup

    x 125 25 277 31 0 24 Gear Indicator

    x 456 26 571 32 0 24 Motorcycle

    M 192 176 96 176 0 2.0

    x 65 157 118 160 0 12 AVR Input

    w 192 176 192 256 0

    162 512 96 512 160 1 2.1024259 1.0 0.0 0.0

    r 512 160 512 256 0 470.0

    d 512 320 512 400 1 0.805904783

    x 413 388 499 391 0 12 protective diode

    s 512 400 640 400 0 1 false

    g 640 400 640 448 0x 539 422 615 425 0 12 neutral switch

    x 309 240 391 246 0 24 1N4148

    x 132 377 269 380 0 12 in place of R3, and watch

    d 304 256 400 256 1 0.805904783

    r 304 336 400 336 0 10000.0

    x 337 371 367 377 0 24 R3

    S 192 320 272 320 0 1 false 0

    w 192 256 192 320 0

    w 304 256 272 256 0

    w 272 256 272 304 0

    w 304 336 272 336 0

    w 400 256 400 304 0

    w 400 304 448 304 0w 400 336 400 304 0

    http://www.falstad.com/circuithttp://www.falstad.com/circuithttp://www.falstad.com/circuit
  • 8/10/2019 Motorcycle Universal Gear Indicator

    6/15

    w 448 304 512 304 0

    w 512 304 512 320 0

    w 512 304 512 256 0

    x 131 359 276 362 0 12 flip switch to insert a diode

    x 134 394 272 397 0 12 current drop to zero when

    x 134 412 254 415 0 12 neutral switch is open

    ... or click here for direct Circuit Simulator Link

    Contributed by Brett Walach

    Photos

    http://www.falstad.com/circuit/#%24+1+5.0E-6+10.20027730826997+62+5.0+50%0AR+192+96+192+48+0+0+40.0+5.0+0.0+0.0+0.5%0AR+512+96+512+48+0+0+40.0+12.0+0.0+0.0+0.5%0Ar+192+96+192+176+0+10000.0%0Ax+231+142+309+145+0+12+internal+pullup%0Ax+125+25+277+31+0+24+Gear+Indicator%0Ax+456+26+571+32+0+24+Motorcycle%0AM+192+176+96+176+0+2.0%0Ax+65+157+118+160+0+12+AVR+Input%0Aw+192+176+192+256+0%0A162+512+96+512+160+1+2.1024259+1.0+0.0+0.0%0Ar+512+160+512+256+0+470.0%0Ad+512+320+512+400+1+0.805904783%0Ax+413+388+499+391+0+12+protective+diode%0As+512+400+640+400+0+1+false%0Ag+640+400+640+448+0%0Ax+539+422+615+425+0+12+neutral+switch%0Ax+309+240+391+246+0+24+1N4148%0Ax+132+377+269+380+0+12+in+place+of+R3%2C+and+watch%0Ad+304+256+400+256+1+0.805904783%0Ar+304+336+400+336%20+0+10000.0%0Ax+337+371+367+377+0+24+R3%0AS+192+320+272+320+0+1+false+0%0Aw+192+256+192+320+0%0Aw+304+256+272+256+0%0Aw+272+256+272+304+0%0Aw+304+336+272+336+0%0Aw+400+256+400+304+0%0Aw+400+304+448+304+0%0Aw+400+336+400+304+0%0Aw+448+304+512+304+0%0Aw+512+304+512+320+0%0http://www.electronics-lab.com/projects/automotive/006/C.jpghttp://www.falstad.com/circuit/#%24+1+5.0E-6+10.20027730826997+62+5.0+50%0AR+192+96+192+48+0+0+40.0+5.0+0.0+0.0+0.5%0AR+512+96+512+48+0+0+40.0+12.0+0.0+0.0+0.5%0Ar+192+96+192+176+0+10000.0%0Ax+231+142+309+145+0+12+internal+pullup%0Ax+125+25+277+31+0+24+Gear+Indicator%0Ax+456+26+571+32+0+24+Motorcycle%0AM+192+176+96+176+0+2.0%0Ax+65+157+118+160+0+12+AVR+Input%0Aw+192+176+192+256+0%0A162+512+96+512+160+1+2.1024259+1.0+0.0+0.0%0Ar+512+160+512+256+0+470.0%0Ad+512+320+512+400+1+0.805904783%0Ax+413+388+499+391+0+12+protective+diode%0As+512+400+640+400+0+1+false%0Ag+640+400+640+448+0%0Ax+539+422+615+425+0+12+neutral+switch%0Ax+309+240+391+246+0+24+1N4148%0Ax+132+377+269+380+0+12+in+place+of+R3%2C+and+watch%0Ad+304+256+400+256+1+0.805904783%0Ar+304+336+400+336%20+0+10000.0%0Ax+337+371+367+377+0+24+R3%0AS+192+320+272+320+0+1+false+0%0Aw+192+256+192+320+0%0Aw+304+256+272+256+0%0Aw+272+256+272+304+0%0Aw+304+336+272+336+0%0Aw+400+256+400+304+0%0Aw+400+304+448+304+0%0Aw+400+336+400+304+0%0Aw+448+304+512+304+0%0Aw+512+304+512+320+0%0
  • 8/10/2019 Motorcycle Universal Gear Indicator

    7/15

    http://www.electronics-lab.com/projects/automotive/006/E.jpghttp://www.electronics-lab.com/projects/automotive/006/D.jpg
  • 8/10/2019 Motorcycle Universal Gear Indicator

    8/15

    Connections

    http://www.electronics-lab.com/projects/automotive/006/F.jpg
  • 8/10/2019 Motorcycle Universal Gear Indicator

    9/15

    A successful circuit build will do a self-test when connected solely to 12V power

    (pins TO_POWER_1 and TO_POWER_2), by cycling through all digits on the 7-segment display (see video below). After the self-test, the current gear will beshown and can be changed by the shift lever movement. Note that a gear ischanged when the magnet's southpole is drawn awayfrom the sensor (northpole will not work). Moreover, if a neutral gear is detected (from the neutralswitch connected to TO_POWER_4), the display resets to zero (also acting as aself-calibrating feature if anything goes wrong). Finally, when the power is turnedoff, the last shown gear is stored in the MCU's flash EEPROM and restored whenthe device is turned on again.

  • 8/10/2019 Motorcycle Universal Gear Indicator

    10/15

    The following video shows the initialization procedure of the gear indicator :

    Download self test video in .avi format

    Sensor cable

    The following photos show the construction of the 4-wire sensors cable that is

    plugged to the TO_SENSORS connector. The visible sensor pin parts should be

    covered with plastic lacquer for protection as well.

    http://www.electronics-lab.com/projects/automotive/006/Self%20Test.avihttp://www.electronics-lab.com/projects/automotive/006/Self%20Test.avihttp://www.electronics-lab.com/projects/automotive/006/Self%20Test.avihttp://www.electronics-lab.com/projects/automotive/006/Self%20Test.avi
  • 8/10/2019 Motorcycle Universal Gear Indicator

    11/15

  • 8/10/2019 Motorcycle Universal Gear Indicator

    12/15

  • 8/10/2019 Motorcycle Universal Gear Indicator

    13/15

    Custom Housing

  • 8/10/2019 Motorcycle Universal Gear Indicator

    14/15

    Installation Videos

    Installation1.avi

    http://www.electronics-lab.com/projects/automotive/006/Installation1.avihttp://www.electronics-lab.com/projects/automotive/006/H.jpghttp://www.electronics-lab.com/projects/automotive/006/G.jpghttp://www.electronics-lab.com/projects/automotive/006/Installation1.avi
  • 8/10/2019 Motorcycle Universal Gear Indicator

    15/15

    Gear shifting by hand

    Installation2.avi

    Real gear shifting with engine on

    Installation3.avi

    Storing last gear in EEPROM

    Action Video

    Thanks for reading !

    Designed and built by Vassilis Papanikolaou 2010

    http://www.electronics-lab.com/projects/automotive/006/Installation2.avihttp://www.electronics-lab.com/projects/automotive/006/Installation2.avihttp://www.electronics-lab.com/projects/automotive/006/Installation3.avihttp://www.electronics-lab.com/projects/automotive/006/Installation3.avihttp://www.electronics-lab.com/projects/automotive/006/Installation3.avihttp://www.electronics-lab.com/projects/automotive/006/Installation2.avi