EasyDIY OpenSource display for EVs: TSDZ2 and Bafang M500/M600 EBike motors

General Discussion about electric vehicles.
casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 07 2021 7:16am

endlessolli wrote:
Dec 07 2021 6:44am
Hi casainho;
is there any chance that you would port your open source display to the ESP32 (instead of the nRF52840)?
I know, it would than lack the Ant capability, but in my case (and I could imangine also a lot of other people), I am much more familiar with the ESP; it is much cheaper (and more readily available) and I don't need Ant capability (as I don't have any Ant devices)
Other than that: Great Project! (As all your your other ones, which are in itself great, but also are the foundation of many additional great TSDZ & KT projects)
No, I will keep with NRF52840 because ANT is very important as it can control and receive data wireless from devices usually used on EBikes and EVs, to communicate with remote controls, battery BMS, control the lights, read tire pressure sensors, etc. I really hope in future to use this wireless capabilities and this display is ideal to show data like from each battery cell voltage, turn lights on/off and even show the tires pressure.

The NRF52840 board is cheap and is available on Aliexpress, Ebay and dedicated electronic components shops.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

endlessolli   1 W

1 W
Posts: 55
Joined: Jul 31 2020 11:55am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by endlessolli » Dec 07 2021 8:43am

casainho wrote:
Dec 07 2021 7:16am
endlessolli wrote:
Dec 07 2021 6:44am
Hi casainho;
is there any chance that you would port your open source display to the ESP32 (instead of the nRF52840)?
No, I will keep with NRF52840 ....
I kind of guessed already that you would say that - but I had to ask :-)
(Just for claryfication: I did not mean to ask to completely replace the NRF..., but make an ANT-less ESP32 branch available).

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 07 2021 9:34am

endlessolli wrote:
Dec 07 2021 8:43am
(Just for claryfication: I did not mean to ask to completely replace the NRF..., but make an ANT-less ESP32 branch available).
That is not realistic, at least for the time I have available for this projects. My life time is very precious and I would not use it to keep parallel branches of the project.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

shimrod   100 µW

100 µW
Posts: 8
Joined: Aug 18 2021 5:25am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by shimrod » Dec 08 2021 7:04am

Hi,

I am probably being dumb but I cannot find the firmware for the display bootloader. At least I cannot find a hex file do you have to build it from source or is there a direct link to the hex file ?

thanks

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 08 2021 7:13am

shimrod wrote:
Dec 08 2021 7:04am
Hi,

I am probably being dumb but I cannot find the firmware for the display bootloader. At least I cannot find a hex file do you have to build it from source or is there a direct link to the hex file ?

thanks
here https://github.com/OpenSourceEBike/ev_d ... t/releases

if you find more missing information, please report or make a pull request.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 08 2021 7:46am

Note to enter in DFU to flash the firmware, after flashing the bootloader, you need to keep pressed the UP and DOWN buttons for at least 10 seconds, imediatly sfter power up the display.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

shimrod   100 µW

100 µW
Posts: 8
Joined: Aug 18 2021 5:25am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by shimrod » Dec 08 2021 8:40am

casainho wrote:
Dec 08 2021 7:13am
shimrod wrote:
Dec 08 2021 7:04am
Hi,

I am probably being dumb but I cannot find the firmware for the display bootloader. At least I cannot find a hex file do you have to build it from source or is there a direct link to the hex file ?

thanks
here https://github.com/OpenSourceEBike/ev_d ... t/releases

if you find more missing information, please report or make a pull request.
Thanks for that I find github pretty confusing at times

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 10 2021 12:15pm

I built the 3rd display and this will go to my MTB, where sometimes I need to use the Garmin Edge GPS display.

This time I used the more expensive 860C display keypad, because it has 4 buttons and will use the button four to work as ANT+ Controls, to change the page on the Garmin Edge - this means this remote (and display) will control both the display as also the Garmin Edge.
The button to control the Garmin Edge costs 50€ on the market, so this feature will bring a high value for the ones like me.

This 850C keypad is big, it seems it would be better on a electric motor cycle and not on a small and light MTB ebike.

The firmware is not yet developed, but we did it on the TSDZ2 fully wireless remote, so should easy to port it to this display.

Image
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 11 2021 6:15pm

So I just compared this third display with the others (the Vcc of the OLED display is now connected to 5V instead of 3.3V) and this is well noticeable that is better on the outdoors.

Soon I will update the schematic to reflect this change and I recommend everyone that already built the display to go and do this change.

Image
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 13 2021 6:50pm

I made a new firmware release, that seems mostly stable for me. Changes from latest release:
- increased assist levels to 20
- reset of battery Wh counter is now only checked once at startup

https://github.com/OpenSourceEBike/ev_d ... ag/v0.10.0

I also updated the schematic so the OLED Vcc line is now connected to 5V and this is a good improvement on the brightness, visibility on the outdoors:

Image
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

shimrod   100 µW

100 µW
Posts: 8
Joined: Aug 18 2021 5:25am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by shimrod » Dec 20 2021 5:53am

Hi,
I am afraid I have another question re the display.
I have got all the bits and thought I would start making it after Christmas.
I had a quick look at the display software and see it uses a SSD 1306 driver chip. My 1.3" display has a SH1106 driver chip as do all the other 1.3" displays I can find. Are these compatible ? In a small Arduino project I did I had to use different libraries to get it to work.
If there is a problem I will use a .96" display instead.

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Dec 20 2021 6:07am

shimrod wrote:
Dec 20 2021 5:53am
Hi,
I am afraid I have another question re the display.
I have got all the bits and thought I would start making it after Christmas.
I had a quick look at the display software and see it uses a SSD 1306 driver chip. My 1.3" display has a SH1106 driver chip as do all the other 1.3" displays I can find. Are these compatible ? In a small Arduino project I did I had to use different libraries to get it to work.
If there is a problem I will use a .96" display instead.
Yes, I started with SSD1306 and then saw that I also needed the DISPLAY_SH1106. One is for 0.96 inches and other for the 1.3 inches.

The firmware is ready for both, as also SPI or I2C, for both. That is why you will find 4 firmware HEX files on the download firmware.

Good luck and please post pictures during the build, the details as also final build.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

shimrod   100 µW

100 µW
Posts: 8
Joined: Aug 18 2021 5:25am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by shimrod » Dec 20 2021 9:05am

casainho wrote:
Dec 20 2021 6:07am
shimrod wrote:
Dec 20 2021 5:53am
Hi,
I am afraid I have another question re the display.
I have got all the bits and thought I would start making it after Christmas.
I had a quick look at the display software and see it uses a SSD 1306 driver chip. My 1.3" display has a SH1106 driver chip as do all the other 1.3" displays I can find. Are these compatible ? In a small Arduino project I did I had to use different libraries to get it to work.
If there is a problem I will use a .96" display instead.
Yes, I started with SSD1306 and then saw that I also needed the DISPLAY_SH1106. One is for 0.96 inches and other for the 1.3 inches.

The firmware is ready for both, as also SPI or I2C, for both. That is why you will find 4 firmware HEX files on the download firmware.

Good luck and please post pictures during the build, the details as also final build.
Thanks for that I will post some pics if successful ( not assured with my track record )

andyb   10 mW

10 mW
Posts: 28
Joined: Oct 26 2021 3:42am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by andyb » Jan 19 2022 10:39am

Hello, can someone please help me. Is this device a wired one, with BT and ANT capabilities or do I need to build the EBike wireless controller along with this.

Thanks.

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Jan 19 2022 10:45am

andyb wrote:
Jan 19 2022 10:39am
Hello, can someone please help me. Is this device a wired one, with BT and ANT capabilities or do I need to build the EBike wireless controller along with this.
???

This is just a display. Although it supports Bluetooth and ANT, that features are there on the firmware but disabled, as there is no mobile app developed. Would need some developer to develop and maintain a mobile app for we get that feature.
As for ANT, again, it needs more developing and testing, so it will only happen if some developer want to do it.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

Fischer   1 µW

1 µW
Posts: 1
Joined: Jan 21 2022 1:48am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by Fischer » Jan 22 2022 10:11pm

Are there any known alternatives to the BTS4140N power switch? They seem to be sold out almost everywhere. Or maybe a note of the important specs I can use to search for an alternative? Thanks!

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Jan 23 2022 3:44am

Fischer wrote:
Jan 22 2022 10:11pm
Are there any known alternatives to the BTS4140N power switch? They seem to be sold out almost everywhere. Or maybe a note of the important specs I can use to search for an alternative? Thanks!
You can find it on AliExpress.

I am not good at electronics so I can not find a replacement.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

barthchris   1 mW

1 mW
Posts: 10
Joined: Jan 25 2022 6:22pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by barthchris » Jan 30 2022 7:46pm

Wow!!! I just discovered your smartESC project then discovered this!!! Awesome and just what I need.

I have a pile of NRF52840 dongles from both sparkfun and adafruit. A pile of the OLED displays as well. Need to buy a few of the buck converters. Glad you jumped up to 5V, I have several other uses for 5V

ptrj   10 µW

10 µW
Posts: 6
Joined: Jan 13 2022 6:07am

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by ptrj » Feb 06 2022 9:33am

This looks like a fun thing to start with. Found a promising buck converter and a Adafruit SSD1306 oled 128x64 yesterday to start with. Eveything is solderd and running I think. Currently headless since I cant get the android 'EBike Wireless' app to connect/pair when on firmware or get the display to work.
Adafruit seems to have the I2C address @ 0x3D. Do I have to change this value somewhere? Started out in SPI but no luck so I also tried the I2C mode. Dispaly is working with my arduino.
Whats the procedure to connect 'EBike Wireless'? When in bootloader mode I can atleast see it on phone but not connect.
Have a nice day!

edit:
found this in SSD1306.h
#define SSD1306_I2C_ADDRESS (0x3C) // 011110+SA0+RW - 0x3C or 0x3D
// Address for 128x32 is 0x3C
// Address for 128x64 is 0x3D (default) or 0x3C (if SA0 is grounded)

So, either change #define SSD1306_I2C_ADDRESS (0x3C) to #define SSD1306_I2C_ADDRESS (0x3D) or ground the A0 pin.

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Feb 06 2022 2:55pm

ptrj wrote:
Feb 06 2022 9:33am
This looks like a fun thing to start with. Found a promising buck converter and a Adafruit SSD1306 oled 128x64 yesterday to start with. Eveything is solderd and running I think. Currently headless since I cant get the android 'EBike Wireless' app to connect/pair when on firmware or get the display to work.
Adafruit seems to have the I2C address @ 0x3D. Do I have to change this value somewhere? Started out in SPI but no luck so I also tried the I2C mode. Dispaly is working with my arduino.
Whats the procedure to connect 'EBike Wireless'? When in bootloader mode I can atleast see it on phone but not connect.
Have a nice day!

edit:
found this in SSD1306.h
#define SSD1306_I2C_ADDRESS (0x3C) // 011110+SA0+RW - 0x3C or 0x3D
// Address for 128x32 is 0x3C
// Address for 128x64 is 0x3D (default) or 0x3C (if SA0 is grounded)

So, either change #define SSD1306_I2C_ADDRESS (0x3C) to #define SSD1306_I2C_ADDRESS (0x3D) or ground the A0 pin.
Good that you found the way to use the display. Would be better if you ground that pin and use the original firmware, so we will have the same hardware.

I think the current firmware has Bluetooth disabled, as there is no compatible app.

The only think you can see in Bluetooth is the bootloader. Once you have the bootloader running, then you can flash the firmware, see here how to do it: https://opensourceebike.github.io/dfu.html

Please report later and take some pictures to show here!!
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

dogstoevski   1 µW

1 µW
Posts: 1
Joined: Mar 21 2021 8:00pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by dogstoevski » Feb 14 2022 2:51pm

casainho wrote:
Dec 10 2021 12:15pm
I built the 3rd display and this will go to my MTB, where sometimes I need to use the Garmin Edge GPS display.

This time I used the more expensive 860C display keypad, because it has 4 buttons and will use the button four to work as ANT+ Controls, to change the page on the Garmin Edge - this means this remote (and display) will control both the display as also the Garmin Edge.
The button to control the Garmin Edge costs 50€ on the market, so this feature will bring a high value for the ones like me.

This 850C keypad is big, it seems it would be better on a electric motor cycle and not on a small and light MTB ebike.

The firmware is not yet developed, but we did it on the TSDZ2 fully wireless remote, so should easy to port it to this display.

Image
Hi. Thank you for all the info and your effort.
Does the 860C controller switch have five pins? Which pins did you solder to which pins on nRF52840?

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Feb 14 2022 5:21pm

dogstoevski wrote:
Feb 14 2022 2:51pm
casainho wrote:
Dec 10 2021 12:15pm
I built the 3rd display and this will go to my MTB, where sometimes I need to use the Garmin Edge GPS display.

This time I used the more expensive 860C display keypad, because it has 4 buttons and will use the button four to work as ANT+ Controls, to change the page on the Garmin Edge - this means this remote (and display) will control both the display as also the Garmin Edge.
The button to control the Garmin Edge costs 50€ on the market, so this feature will bring a high value for the ones like me.

This 850C keypad is big, it seems it would be better on a electric motor cycle and not on a small and light MTB ebike.

The firmware is not yet developed, but we did it on the TSDZ2 fully wireless remote, so should easy to port it to this display.

Image
Hi. Thank you for all the info and your effort.
Does the 860C controller switch have five pins? Which pins did you solder to which pins on nRF52840?
The extra pin compared to 850C remote switch, I connected to P0.17. Still, I did not yet develop the firmware to use that extra button for Garmin change page.
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

gfmoore   100 W

100 W
Posts: 165
Joined: May 01 2021 4:48pm
Location: Stoke-on-Trent, UK

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by gfmoore » Mar 09 2022 4:38am

Hi,
does anyone have the juliet pinout and/or wire colour codes for the850C remote keypad readily available?

If not I'll get off my backside and go get a multimeter! :D
Known purveyor of useless questions :roll:

casainho   100 GW

100 GW
Posts: 5778
Joined: Feb 14 2011 2:43pm

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by casainho » Mar 09 2022 4:50am

gfmoore wrote:
Mar 09 2022 4:38am
Hi,
does anyone have the juliet pinout and/or wire colour codes for the850C remote keypad readily available?

If not I'll get off my backside and go get a multimeter! :D
If you get that information, share here and I will add to the page.

And I hope you can share pictures of your display build!!
- TSDZ2 and OpenSource EV display: 128x64 OLED display, easy to build as DIY, Bluetooth and ANT, OTA wireless updates, easy to repair and customize for other EVs.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: OpenSource EV display, Wireless EBike standard ANT+ and Bluetooth, TSDZ2 OpenSource firmware, KT motor controllers and displays.

User avatar
SUPERJC   10 mW

10 mW
Posts: 27
Joined: Mar 04 2022 10:13am
Location: FRANCE

Re: DIY OpenSource display for EVs, TSDZ2 EBike motor and Xiaomi scooter

Post by SUPERJC » Mar 09 2022 11:04am

casainho wrote:
Dec 11 2021 6:15pm
So I just compared this third display with the others (the Vcc of the OLED display is now connected to 5V instead of 3.3V) and this is well noticeable that is better on the outdoors.

Soon I will update the schematic to reflect this change and I recommend everyone that already built the display to go and do this change.

Image
For my Bafang BBS I try DIY display Oled and TFT
Outside the TFT is a little more readable
…and life is better in color :mrgreen:
Image

Post Reply