Helmet Display for Electric Unicycle and EUC World App
by michalpietraszek in Circuits > Gadgets
1337 Views, 8 Favorites, 0 Comments
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:
- Seeed Studio Xiao ESP32 C3 module
- 2 digit 7-segment LED display - 0.3 inch, smd, common anode (KCDA03-107 is used here)
- Resistors (tht):
- 7x 470 ohm
- 2x 20k ohm
- 1x 1k ohm
- 1x photoresistor (10-20k ohm)
- 1x tact switch (preferably waterproof)
- thin wires
- heat shrink tubes (thin, size of tht resistor)
- insulation tape
- adhesive tape
- USB-C cable
- Powerbank
Tools:
- 3D printer
- Soldering iron
- Computer with Arduino IDE installed
Print Body
Use black PETG filament
Downloads
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
Downloads
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.
Connect Resistors
Wiring:
- LED display segment pins:
- D9 - segment A (both digits connected)
- D10 - segment B (both digits connected)
- D4 - segment C (both digits connected)
- D5 - segment D (both digits connected)
- D6 - segment E (both digits connected)
- D8 - segment F (both digits connected)
- D7 - segment G (both digits connected)
- LED digit pins (common anode):
- D2 - digit 1 (left)
- D3 - digit 2 (right)
- Button pins:
- D1:
- pull up by connecting to 3.3V through 20k ohm resistor
- connect to button through 1k ohm resostor
- connect other button pin to GND
- Photoresistor pins:
- D0/A0:
- pull up by connecting to 3.3V through 20k ohm resistor
- connect to photoresistor
- 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
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!
Downloads
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).
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
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:
- 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 "--")
- Use button to switch between values displayed
- After switching, the "bA", "SP" or "tE" symbol will be displayed for approx 2 seconds
- new value is pulled 2 times per second.
- 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