Select Page

Handlebar Controller (URS / Requirements)

URS

The Handlebar Controller device’s User Requirement Specifications:

  • URS-1: The system shall allow to control GPS application installed on smartphone or tablet
  • URS-2: GPS applications shall be at least: OSMand, Guru Map
  • URS-3: The system shall be available for iOS and Android
  • URS-4: The system shall be Connected with Bluetooth, emulating HID device (keyboard)
  • URS-5: The system shall be used on motorbike and shall be waterproof
  • URS-6: The system shall be used on motorbike and easily usable while riding
  • URS-7: The system shall be powered with motorbike or charge with USB source before being used
  • URS-8: The system shall be usable when motorbike is off
  • URS-9: The system shall receive input commands by one of the following external devices:
    • 3 handle bar buttons device (Up/Down/Select)
    • 1 rotary encoder with integrated push button device (Clockwise/AntiClockwise/Select)
    • the existing motorbike control buttons (Up/Down/Select)
  • URS-10: Basically input device shall control Zoom /de-zoom for GPS Application, but can be affected to other configurable functionality
  • URS-11: Profile shall be used to associated configurable functionalities (for instance ZoomIn/ZoomOut for Android OsMand)
  • URS-12: Switch between different profiles shall be executed with the Select button
  • URS-13: The select button shall be configurable to execute 2 actions, one with short push and one with long push. One of them shall be the profile switch.
  • URS-14: Switch between profile can be displayed with led or OLED display

Hardware requirements

  1. Lolin 32 Pro https://www.wemos.cc/en/latest/d32/d32_pro.html
  2. OLED Shield https://www.wemos.cc/en/latest/d1_mini_shield/oled_0_96.html
  3. I2C Cable https://www.aliexpress.com/item/32867490848.html?spm=a2g0s.9042311.0.0.27424c4dAEbyt2
  4. LiPo Battery 3.7V 650mAh with JST PH 2.0mm 2 pin https://www.aliexpress.com/item/32833075472.html?spm=a2g0o.cart.0.0.14953c00Quf36h&mp=1
  5. MicroSD card
  6. Rotary encoder 
  7. Solid Aluminum Knob Potentiometer https://www.aliexpress.com/item/32753503255.html?spm=a2g0s.9042311.0.0.27424c4dzs5tzC
  8. Universal Light Switch Motorcycle Handlebar https://www.aliexpress.com/item/1005001568694609.html?spm=a2g0s.9042311.0.0.65864c4dB1KehRABS
  9. Plastic Project Box Waterproof https://www.aliexpress.com/item/4000401721859.html?spm=a2g0s.9042311.0.0.27424c4dzs5tzC
  10. Resistors 2 x 10K
  11. Cable 5 wires https://www.aliexpress.com/item/4000570401041.html?spm=a2g0o.productlist.0.0.3b6e2a53CKvL9d&algo_pvid=cbbb324e-29d6-4621-a31e-63c46d31d43c&algo_expid=cbbb324e-29d6-4621-a31e-63c46d31d43c-5&btsid=2100bb4916085039192433619e27a9&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

Cost

IDComponentApproximative Price (Euro)
1Lolin 32 Pro9
2OLED Shield2,5
3I2C Cable0,5
4LiPo Battery 3.7V 4
5MicroSD card 4Go2
6Rotary encoder0,5
7Solid Aluminum Knob Potentiometer3,5
8Universal Light Switch Motorcycle Handlebar4
9Plastic Project Box Waterproof 2,5
10Resistor1
11Cable 5 wires3
 Total29

Software Requirements

Below the list of software applications and libraries requirements.

  1. Arduino IDE https://www.arduino.cc/en/software
  2. Expressif ESP32 library https://github.com/espressif/arduino-esp32
  3. ESP32 BLE Keyboard https://github.com/T-vK/ESP32-BLE-Keyboard
  4. ESP8266 OLED Driver SSD1306 https://github.com/ThingPulse/esp8266-oled-ssd1306
  5. AFArray library https://github.com/TechLabCommunity/AFArray
  6. IniFile library https://github.com/stevemarple/IniFile
  7. SimpleRotary Arduino library https://github.com/mprograms/SimpleRotary

Schematic diagram

LOLIN32 pins

「 RST 
F 「 C 
T F 1 0 C 
「 5 C S 
ADCI H5 
ADCI CH4 
A 0 CI CH6 
DAC 2 
DAC 1 
12C 
ESP32-WROVER 
USB 
Micro 
0S1 
MISO 
SDA 
SCK

Rotary encoder pins

CLK 
GND 
Encoder side 
sw
LOLIN32 pinRotary Encoder pin
3.3V10K resistor to DT 10K resistor to CLK
GNDGND / GND
15DT
2CLK
0SW