USB-C to VESC CAN-forward adapter - cheap and DIY!


Thanks for sharing, made one as well, it was fairly easy and works spot on!

4 Likes

Hi @Tomblarom !! I really appreciate your DIY approach, even because I just to do the same!!!

I am using ESP32 and running Python firmware on them (CircuitPython) and I build my EBikes and Scooters using VESC + ESP32 running Python firmware, DIY boards!!. I also build my displays using the same approach.
I prefer Python because is faster to develop and reuse between projects, as also I can connect wireless to ESP32 and edit the firmware on my phone or PC, including seeing the terminal / prints for debug.

I also use ESPNow wireless to communicate between the main board to the display, or to the lights board and also the BMS anti-spark switch board!! So, as long I use ESP32 n my boards, I can use the ESPNow wireless communication between them and so avoid wires!!

The NRF52840 board is like 5x more expensive than ESP32-C3, to add wireless connection to VESC Tool.

Pictures of my DIY displays:

And my EBike – ugly wiring but I use the same CANBUS module as you:

And my Xiaomi M365 scooter, with ESP32-S3 board to read the throttle and brakes signals only. And the VESC 75100:

3 Likes

I got the ESP32-C3 detected on VESC tool, but that was not easy. Here the steps I took:

  1. On VESC tool, after I put the ESP32-C3 on bootloader mode, the serial port were detected on the tab ESP Programmer. But the buttons for flashing were disabled. So, I could understand that is needed to flash the bootloader, partition and application firmware files, that I download from the VESC tool repository, here:

Then I used the esptool.py to flash that firmware files. Each one needs to be at a specific address, the bootloader is at 0x0 and the others the address are here on the VESC Tool, tab ESP Programmer:

Here a screenshot of flashing this firmwares:

  1. VESC tool now were able to detect the VESC express serial port and then connect to it. As I was interested to use the Bluetooth or Wifi connection, on VESC tool I then find this options were I can enable the Bluetooth, Wifi or configure the CAN. I configured the Bluetooth and I then were able to connecto VESC tool byt Bluetooth - now I don’t need anymore the NRF52840, wich is 5x more expensive than ESP32-C3.

2 Likes

When I connect pins 21 and 22 of ESP32-C3 to VESC UART, VESC tool don’t show the motor configuration tabs, only the VESC express tabs.

For what I can understand, this firmware works both with UART on pins 21 and 22 and CAN module on pins 1 and 2.

Can someone please confirm this firmware also works with UART communication with VESC???

Not sure if this has changed since then, but seems there may not be enough pins to do CAN, gps and uart?

1 Like

For DIY, would be much better to use UART instead of CAN, because for CAN we need to add that extra CAN module board + 4 wires, meaning it increases the possibility of mistakes, makes the final board bigger. Also if I hadn’t that CAN module board in stock, I would need to wait 3 weeks for the shipping time from Aliexpress.

Thank you @jaykup!! You were correct, now with CAN it is working as expected. By the way, I am also using the information and firmware you shared on the other post!!! <3

Thank you to everyone that contributes to VESC and thank you @Tomblarom.
And I share here the details in the hope to help others, this is my contribution.

Here is the board connected to this VESC 75200:

And here is the VESC tool that now finds this VESC on the CAN bus and so let me configure and control the motor, as usual when I used NRF52840 board for Bluetooth → UART connection to this VESC:

And the details of the board:

Finally I will be able to ride again my micro escooter Fiido Q1S :heart_eyes: :motor_scooter:

4 Likes

I am glad that the mini-project is taking off and that more and more people are discovering the advantages of this approach for themselves!

Happy tinkering! :star_struck::stuck_out_tongue:

3 Likes

@Tomblarom just want to be sure here. if i want to use the can ports, i need to connect the tx and rx from the taj to the rx/tx on the esp32? or other pins? thanks in advance

Yes, the output of the tranceiver is CAN_H and CAN_L, that go to the VESC :wink: