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

I’m also having trouble getting the waveshare SD module. Would this one work? Stemedu 2PCS Micro SD Card Module TF Card Memory Storage Adapter Reader Board SPI Interface with Integrated Circuit Breakout for Arduino for Raspberry Pi : Amazon.ca: Electronics

I also found this one that’s smaller: https://a.co/d/02ytrR6

Here are my design files for the adapter: https://a360.co/3NivFuu

2 Likes

I accidentally got an ESP32-C3 mini-1, would it work? It’s a bit larger and has Micro-b instead of type-c.

2 Likes

Thanks for sharing, I made a variant that fits a 4 Pin PH2.0 connector. This way it can be powered with 5V over the can connector.
Only connect power either over usb or from VESC, not from both sides at the same time!
If you need both connections, cut the 5V from VESC.

4 Likes

If you order the esp32, be aware that there are some faulty boards sold, I just got a bunch and wondered why my second adapter did not work correctly (lost connection all the time).
The left one is a working one, the one on the right has the oscillator too close to the antenna.
For more information see here: Some stores are selling broken ESP32-C3 Super Mini's - RoryHay.es

6 Likes

I lost all my soldering stuff, would I be able to buy one of these off someone here?

2 Likes
4 Likes

Here a link to the stl of the body: USB-C_2_VESC_body.stl - Google Drive

The lid was not changed so you can use the original one.



I had to bend the pins of the 90degrees ph2.0 so the connector can be moved to be in front of the PCB. The GND and 5V (pin 1 and 4) go through the fixing holes of the serial to can board. Hot glue also helps to keep things in place…

3 Likes

Got some new ones, these do work: US $1.68 | 1/5PCS ESP32-C3 Super Mini Development Board ESP32-C3 Module Mini Wifi BT Bluetooth Module RISC-V 32-Bit Single-Core Processor
https://a.aliexpress.com/_ExaypJW

2 Likes

@tech.shit and @Pinky have you had any luck hooking up the SD card? :slight_smile: I want to use mine for logging and maybe add GPS as well.

I wish I saw this earlier. The ones I just got in the mail have the oscillator/antenna issue. Soldered one up anyway and yeah, the connectivity is ass.

3 Likes

Hello,
I am quite surprised.
You are using a 5V CAN transceiver (TJA1050) in direct connection with an ESP32C3.
However, according to the datasheet, the ESP32C3 inputs are not 5V tolerant (at all). As stated in the TJA1050 AN00020 document chapter 3.4, the RXD output pin is push pull based (to 5V) and there is even a pull up resistor to 5V on the TXD input.
For a reliable system, you are better of using a 3.3V transceiver (from TI) or one with a VIO pin (mcp2562).

3 Likes

Has anyone ever measured the voltage level on the RXD pin while connected to VESC?

That is correct, and I had a issue reading ESP32C3 ADCs and then I found it was because that CAN transceiver were pulling the IO lines to over 3.3V!!

I will be using this 3.3V CAN transceiver module (SN65HVD230), that is equally cheap and small, from Aliexpress:

Thanks for the heads up…! I picked the TJA1050 board because it was small, cheap and had a good form to fit on the back. Totally oversaw, that it has a 5V logic level. It’s strange that it worked like this until now and nobody noticed… :joy: However, I also had certain issues, which might be related to this.

I’ll change the design from the typical TJA1050 (1122mm) this SN65HVD230 (1416mm).

1 Like

Other than a different footprint, is the IC directly compatible or do we have to change anything smd wise?

A new vescexpress clone: Flipsky FSESC EXPRESS ESP32 VESC CAN Adapter Supports Connection to VE – FLIPSKY
So cheap it might not be worth building it yourself any longer. It is bigger, but has an sd card slot and gps connector.

5 Likes

Incredible, thanks for this. Definitely not worth making my own, I’ll figure out something else to do with the ESP32s.

1 Like

Thanks for sharing! This looks prone to errors… I’d recommend sticking with the original. It’s expensive, but will work reliably.

1 Like

Sorry to sorta necro this.

Im actively working on. The pre-compiled BIN as best I can tell is using hw_xp_t designated C/H files (assumption based on the fact these are the ones active in the conf_general.h file in the github).

When you look at the hw_xp_t.h file you’ll see the pinout which for the C3 Mini isnt correct for SPI. CAN and UART are fine, but SPI not so much.

Adjusting those and rebuilding the firmware is easy enough as long as you install the exact same esp-idf version as described in the github (5.2.2). Many of the driver/libs are removed/deprecated into 5.2.5 and beyond.

This is where I am at currently, LispBM is something im still working on but it shouldn’t be difficult to get my head around. Once I have SD card working, Ill try to get UART GPS running as well.

Edit: Quick update because I dont want to just make whole new reply. Recompiling the firmware, and installing the latest VESC Tool. the LispBM commands for sd-card functionality are working. I was able to format (externally) the sd card to FAT and was able to connect, read and create a new directory on the SD Card via the C3-Mini. At this point its just a matter of writing the code to collect relevant data from canbus and write it to the SD Card.

Side note, anyone know of a way to either generate bunk can-data for debugging/dev or if there is a way to save the canbus data and replay it as an emulated device? Would make this process significantly easier for me but if not it is what it is.

1 Like