Introduction: Helmet Display for Electric Unicycle and EUC World App

Note: Check the upgraded veresion of the display here - Helmet Display for Electric Unicycle and EUC World App (v2 With Battery) : 8 Steps - Instructables

This is a simple LED display that shows one of most important parameters of electic unicycle: speed, battery or temperature. You can switch between parameters using tact switch. Ambient light sensor allows to automatically adjust LED intensity.

The device connects to EUC World app for Android using wifi (access point enabled on mobile phone), and EUC World's data feed api. More details on data feed: https://forum.electricunicycle.org/topic/23095-euc-world-api-for-3rd-party-apps-plugins/?do=findComment&comment=368865

Supplies

Parts:

  1. Seeed Studio Xiao ESP32 C3 module
  2. 2 digit 7-segment LED display - 0.3 inch, smd, common anode (KCDA03-107 is used here)
  3. Resistors (tht):
  4. 7x 470 ohm
  5. 2x 20k ohm
  6. 1x 1k ohm
  7. 1x photoresistor (10-20k ohm)
  8. 1x tact switch (preferably waterproof)
  9. thin wires
  10. heat shrink tubes (thin, size of tht resistor)
  11. insulation tape
  12. adhesive tape
  13. USB-C cable
  14. Powerbank

Tools:

  1. 3D printer
  2. Soldering iron
  3. Computer with Arduino IDE installed

Step 1: Print Body

Use black PETG filament

Step 2: Print Transparent Cover

Use transparent PETG filament as the light sensor is placed underneath.

Switch:

  • Connect wires to the tact switch
  • the switch can be secured using hot glue or sillicone
  • protect tact switch connections with insulation tape

Step 3: Connect Wires to LED Display

Note: Connect only A-G pins and common anode pins. DP pins of the display are not connected as we are already using all 11 GPIO pins of the ESP32 module.

Step 4: Connect Resistors

Wiring:

  1. LED display segment pins:
  2. D9 - segment A (both digits connected)
  3. D10 - segment B (both digits connected)
  4. D4 - segment C (both digits connected)
  5. D5 - segment D (both digits connected)
  6. D6 - segment E (both digits connected)
  7. D8 - segment F (both digits connected)
  8. D7 - segment G (both digits connected)
  9. LED digit pins (common anode):
  10. D2 - digit 1 (left)
  11. D3 - digit 2 (right)
  12. Button pins:
  13. D1:
  14. pull up by connecting to 3.3V through 20k ohm resistor
  15. connect to button through 1k ohm resostor
  16. connect other button pin to GND
  17. Photoresistor pins:
  18. D0/A0:
  19. pull up by connecting to 3.3V through 20k ohm resistor
  20. connect to photoresistor
  21. connect other photoresistor pin to GND

Note:

  • make sure bare resistor wires do not tough ESP32 module metal shield - some insulaiton tape and heat shrink tubes may help here.
  • external antenna can be connected at this point although the device also works without it as the phone is typically close enough

Step 5: Load the Program

Additional libraries used:

  • WiFi
  • ArduinoJson - for parsing json
  • AsyncHTTPRequest_Generic - for making non-blocking, asynchronous http requests
  • SevSeg - to control 7-segment display

Notes:

  • ssid, password: the Access Point name and wifi password are currently hardcoded. Update these 2 values before loading the program.
  • url_host: 192.168.43.1 will typically be used as server address on Android devices. Adjust this value if your phone is using different address.

Make sure the "Web Server" feature of EUC world app is enabled and your phone is not connected to your local WIFI before enabling mobile access point!

Step 6: Assemble All Parts

Small screws for plastic (the ones from micro-servos) are used here.

Use some silicone to make the device more waterproof (makes sense only when using waterproof tact switch)

The device requires external power source (powerbank).

Step 7: Attach to Helmet

Use adhesive tape to attach the device in non-destructive way.

The display on the picture is used together with Oneal Sierra helmet, Zefal Sping mirrors and the custom adapter: Zefal Spin mirror adapter for Oneal Sierra helmet by chrochodyl - Thingiverse

Step 8: Basic Usage

Note: Make sure that "Web server" feature of EUC World app is enabled!

There are 3 values that can be displayed:

  • wheel battery level: bA
  • wheel speed: SP
  • wheel temperature: tE

How it works:

  1. When the WIFI, Euc World and the EUC itself are connected, the battery level will be displayed (note that the max value displayed will be 99 as we have only 2 digits here, out of range numbers are displayed as "--")
  2. Use button to switch between values displayed
  3. After switching, the "bA", "SP" or "tE" symbol will be displayed for approx 2 seconds
  4. new value is pulled 2 times per second.
  5. if the value is not available for 2 seconds (wifi, app or wheel disconnected or other error), only the "bA", "SP" or "tE" symbol will be displayed continously

Adjustments:

  • adjust BRIGHTNESS_MIN, BRIGHTNESS_MAX, BRIGHTNESS_MIN_ANALOG, BRIGHTNESS_MAX_ANALOG values to tune the ambient light sensor behavior
  • adjust BRIGHTNESS_DELAY to speed up/slow down the auto-adjustment of LED display brightness. It's adjusted in 1-step increments