OpenSourceEBike.github.io

How to build the display

The following components can be bought in Aliexpress.

Componentes

You will need the following components:

Step by step instructions

1 - 3D print the enclosure:


3D files for 3D printing:

2 - Build the display

Schematic:

The ESP32-S2 is the microcontroller that runs the high level Pyhton (easy and fast to develop) and we can edit/program the Pyhton software text files wirelessly, using our phone or computer.

This ESP32-S2 get his power from the EBike/EScooter board, on the GND and +5V wires. It communicates with that board using the UART TX and UART RX wires. It also communicates with the OLED display using SPI lines, as also it reads the remote buttons state.

Solder the display to the ESP32-S2 board.
You will see that you can insert directly the display pins SPI_CLK, SPI_MOSI, RESET and DATA_COMMAND - this will simplify a lot. But you also need to cut the +5V and GND pins. You can uses wires for this pins.

Here is the final result, with all wires soldered:

Here showing the cables with the connectors. One is to connect to the original Bafang M500 cable and the other to connect to the 3 buttons remote keypad:


And here is the display already inserted on the 3D printed enclosure.
NOTE that you will need to cut one side of the display so it can be inserted on the 3D printed enclosure:

Now it is time to put everything inside the 3D printed enclosure. The big hole at back is enough for the two cables to be inserted. Here an example, and after using transparent silione to keep the cables in place and avoid water entrance:


On the top, to protect the OLED display and avoid watter entrance, you can put large glue tape as seen on the picture. There are enough clearance on the cover 3D printed part to accomodate this tape:


Use the M2x12 screws to tight the cover as also to clamp to the handlebar.

Example of the final result:
(On this picture, not glue tape were yet applied on to of the OELD display).