Skip to content
/ hd-mcu Public

bluetooth supported mcu for harley davidson 99-03 with raspberry pi pico

License

Notifications You must be signed in to change notification settings

ozgend/hd-mcu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

247 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hd-mcu

bluetooth supported mcu for harley davidson 99-03 with raspberry pi pico

this is not a ecu but a diy -and for fun- project for a monitoring hardware via an mcu since there is no can-bus support for 99-03 models. it replaces the default turn signal module (tsm) to provide monitoring features for battery voltage, rpm, voes, ignition, and external thermo sensors via bluetooth to the mobile application. it does not involve a reverse engineering for the original hd-tsm module.

  • programmable idle timeout for turn signal
  • pcb provides signal switching via h-bridge module or mosfet + oc
  • built-in battery voltage sensor
  • built-in rpm reader
  • built-in temperature sensor via rpi-pico
  • aux inputs for ignition and voes signals (may require custom ignition module ie. ultima/dyna 2000i)
  • vehicle information with editable fields for maintenance records
  • external 6x thermocpouler raiser for max6670
  • supports up to 8x thermocpouler sensors for various purposes

icon

features

  • hardware serial
    • raw ft232 usb serial
  • bluetooth serial
    • raw bluetooth serial (hc-06 @ 9600 bps)
    • mobile app
  • data polling/broadcasting
    • reduced power consumption
    • reduced cpu clock usage
  • turn signal flasher module
    • left/right turn signal flasher
    • hazard flasher
    • flash on startup
    • adjustable flash rate
  • throttle control module
    • linear hall sensor input
    • servo pwm output
    • adjustable base parameters
    • adjustable idle speed
    • [ ]
    • adjustable throttle curves
  • supported sensor inputs
    • multiplexed thermocouples
      • up to 8 thermocouples
    • direct sensor inputs
      • uptime counter (onboard)
      • mcu voltage (onboard)
      • temperature (onboard)
      • vbus input (onboard)
      • battery voltage input
      • rpm input
      • speed input
    • tpms
      • 433mhz receiver implementation
      • tpms decoder / man-i or man-ii (tbd)
    • ignition module
      • dyna 2000i / ultima 2000i timer & pickup
      • programmable ignition advance
        • advance curve
        • temp compensation
        • rpm compensation
        • wideband o2 sensor for afr

software

mobile app

  • platform

    • react 18.2.0
    • react-native: 0.73.2
  • react-native

    • android
    • ios

mobile app ui

back

mcu firmware

hardware

assembly

  • 12v-5v buck converter / switching regulator
  • raspberry pi pico
  • hc-06 bluetooth module
  • TSM / turn signal module
    • (option-1) - with mosfet extension board
    • (option-2) - l298n h-bridge driver module
  • THE / thermocouple module
    • cd4051 multiplexer
    • max6675 thermocouple digitizer
      • datasheet
      • k-type thermocouple (maximum of 8)
  • TCM / throttle control module
  • 5v super capacitor
  • 5805 voltage regulator
  • 33k resistor
  • 10k resistor
  • 7.5k resistor
  • 4.7k resistor
  • 1k resistor
  • 1n4001 diode

pcb

front front

back back

blueprint raw

setup & building & installing

  • initialization

    git clone
    npm run install
  • cook everything

    npm run build
  • create mcu firmware

    npm build:mcu
  • flash firmware to pico

    npm run flash:mcu -- /dev/tty.usbmodem2XXX
  • create mobile app

    • create local build

      npm run build:app
    • create distributable bundle .apk

      nom run bundle:app

usb serial interface

  • usb: 115200 bps
  • bt: 9600 bps

service interaction

  • query only: [SVC]+[CMD]\n
  • set svc data: [SVC]+[CMD]=[DATA]\n

service list:

service description
SYS mcu information system
THE thermocouple sensor module
TSM turn signal module
TCM throttle control module
VHC vehicle healthcheck module
VHI vehicle information system

command list

command description
INFO get information from service
DATA get data from service
SET send data to service
START start monitoring
STOP stop monitoring

TSM extended command set

command description
LEFT left turn signal
RIGHT right turn signal
ALL hazard signal
NONE turn signal off

module interaction

  • query only: [MOD]+[CMD]\n

module list:

name description
M0 main mcu module

command list

command description
DIAG execute diagnostic
START start ON_DEMAND services in module and publish data
STOP stop ON_DEMAND services in module and stop publishing data
LIST_ALL list all registered services in module
LIST_RUN list running/active services in module