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

Yeah just wondering how you were doing it with yours as the trampa one pulls power from the can connector with it’s 4 core.

Thanks for your help. Mines up and running and wifi seems so much more stable and faster.

Also it takes a few times to flash the vesc express firmware onto the esp modules for it to work, once setup I can connect via Bluetooth or wifi.

2 Likes

Sweet :slight_smile: I also made a small one like this for a friend. He uses them for access via WiFi, since it’s more stable, than BT. It needed to be powered via 5V, so I cut the traces from USB to 5V, on the underside and lifted the diode, isolated the pad below and rerouted it (red cable from diode to 5V-pad).

Also isolate between underside of USB-C connector and CAN-tranceiver. If you don’t do this, it will create a short between GND and 5V… Yep it happend to me… :joy:

4 Likes

Yeah thanks, I used double sided tape between the two

Did you isolate the 5v from the USB incase your friend wanted to use it?

I just paralleled the 5v pad on both the canbus transceiver and esp and didn’t bother cutting traces as I won’t use the USB C whilst plugged in anyway.

1 Like

Then you should be all set! If my friend ever want to use USB-C, he can do that, while powering via 5V and GND of his VESC. RX, TX and GND of USB-C are still connected, but I didn’t want to be responsible for frying anything at his side, so I cut the 5V trace, leading to the diode. :laughing:

2 Likes

Amazing project!
Adding wireless connection to my vesc controllers for only about 5€ :fire:

2 Likes

This seems to be the same approach the later VESC Express modules took as well, no power over 5v. It means setting it up without knowing that is a total pain though, because it doesn’t respond to just USB

Works great.

Next step is to figure how to integrate it to be between an existing canbus loop.

I think if I remove the 120ohm resistor on the transceiver it should be fine to put in the loop without messing up the rest

1 Like

You can measure the existing resistance of the VESC. Ideal value is 60 Ohm. Normally you achieve that by having a 120 Ohm on each side.

I had the same issue at first… I solder R0, to connect USB-C to 5V-rail. However normally it’s powered by the VESC and not USB-C.

I made a stupid mistake because I used a can cable with nonstandard colours, so the unit would get power but no data from the CAN bus and no power from USB. I had to have both plugged in to set it up

Just soldered my own.

I want to use 5V from the VESC - no USB connection. As long as I dont plug in my 5V cable AND the USB at the same time I wont have to cut any traces, right?

Edith: already tried and it works just fine. What a nice new feature for my board! Also a great project for a 2h slot on a rainy sunday.
Thank you :pray:

6 Likes

Cool! Welcome to the club! :blush: Where did you change the pins for RX/TX? Did you self-compiled the fw from sources?

Haha nooo I didnt even realise I fucked up :grin: since I didnt want to open up my board yesterday :sweat_smile: I’m gonna switch those.

For some reason I can’t get one of my flashed esp32 C3 to communicate via uart direct to the vesc using gpio0 and 1 instead of using canbus.

I’m answering your question here for the sake of public knowledge. :wink:

In my understanding you have to use GPIO0 and GPIO1 for CAN and GPIO20 RX and GPIO21 TX for UART. Please dont get confused! I messed it up when I did the image of “side-by-side comparison” in my initial post.

Yeah I read through the source on git hub, flashing with vesc express firmware uart is on 20/21 and if you flash with devkit M1 firmware uart is on 0/1 but I can’t get either to talk to the vesc.

Some example LISP-code to toggle the LEDs:

; Red on when powered via USB/5V
(gpio-configure 8 'pin-mode-out) ; LED Blue
(gpio-write 8 1) ; Blue off
(gpio-write 8 0) ; Blue on

3 Likes

Hello Tom,

Do you now the pins that are being used for the GNSS in orther to my PCB be full compatible with Vesc firmware (as first approximation)?

see my project: GitHub - PCBasPRO/PCBasPRO_0003_ESP32C3_CAN_SD_GNSS: PCB to Study the feasibility of ESP32 on https://github.com/PCBasPRO/PCBasPRO_0002_Cheap_FOC2VESC

thanks

2 Likes