ARDUINO - help and ideas thread

Could be nice also !

How do you measure the voltage via arduino?

I get this info through the communication with the VESC.

1 Like

Did you manage to implement the CAN forward to get data from both VESC’s?

Ok this seems like as good a place as any to ask:

I was looking at creating my version of a nunchuk using arduino (and maybe some ESP8266s) doing something similar to the RollingGecko code in talking to the VESC (very nice BTW). I wanted to simulate the nunchuk to get the “cruise control” type features, but I also wanted to get some stats/figures from the VESC as well.

From what I have worked out: the nunchul needs to talk to the VESC via i2c, and to get the stats/figures from the VESC I need to use the UART. Given that they share pins (on the VESC) this is not going to be possible.

I guess my solution now is to create my own pseudo-cruisecontrol based on the RPM that I’m reading and output an appropriate PWM signal like a normal remote from the “base” module (which connects directly to the VESC, and talks wirelessly with the controller).

Thoughts?

Do I have it wrong?

I’ve done lots of reading around here (and reading of RGeckos code) and I don’t think I have seen a nunchuk/display implementation.

At the end of the day: PWM (PPM?) is not so bad… just a bit twitchy which can be addressed in arduino code (ramping./filtering).

Hey there, i think you got most of it right, but the nunchuck doesn’t necessarily have to talk via i2c. In RollingGeckos code you can see that he sends the nunchuck values over serial, so everything can work off of one serial port. You essentially have to build a remote package and send it to the vesc. It’s in ArduBoardControl if you want to see the code.

2 Likes

Hey guys, I’ve got some questions for you:

I am planning to make a connection between a VESC 4.10 and an Arduino UNO through the UART system I’ve read about in this forum. What kind of data can the Vesc send? Is it possible to read RPM if the motor is sensored?

Second question: do I need to send PWM signals from ARDUINO to VESC if I want to control motor speed, am I right? Thanks

EDIT: I am currently reading the whole thread, in case i find some useful info and answer my questions by myself

Have a look at RollingGecko’s arduino library (https://github.com/RollingGecko/VescUartControl).

Heaps of stats/figures can be read from the VESC.

Also I found this library quite useful (works with ESP8266/ESP32): https://github.com/bastianraschke/ESP8266VESC

I’m currently building a VESC -> ESP32 -> NRF24 -> ESP32 (inside controller).

1 Like

Hey the ESP Library looks nice, haven’t seen that until now. But it doesn’t work with fw 3.xx versions, does it?

I’m talking to one of the Turnigy VESCs (new new) which I believe are v3.10.

I was unable to get the RollingGecko library to work but I think it’s mostly because of the ESP8266 incompatibility.

I am a little lazy and just didn’t want to spend the time trying to get it to work.

1 Like

I bring this thread back to life for a simple question : Did somebody already try to set an Arduino as a gateway between VESC and bluetooth module ?

I mean, the BT module is the master and sends commands to the VESC through the Arduino (pass through). When the VESC replies to COMM_GET_VALUES commands, the Arduino passes through but also handles the packet for some purpose (e.g. embedded LCD screen).

That way, on a single setup (= one VESC), it would be possible to display monitoring values on embedded display and still allows using an app. :slight_smile:

1 Like

Would you mind sketching a quick graphic how you think the communication should work? I think I did something like this but I‘m not sure yet :wink:

If I understood he wants UART splitter or etc so he could still send and receive data from VESC even then bluetooth is connected

Would that also enable the use of a BT module when a Nunchuck is used? That would be awesome.

@mrplaygood : yes, I will. Sorry if it’s not clear enough.

@Maxid : I don’t think so unfortunately. Or with a heavy trick.

EDIT : Here is a drawing. Hope it helps to understand my concern. I’d call it a VESC UART “sniffer”.

1 Like

I have tried this (as a replacement for using RF24, using ESP32 that has built in BT), but I’m pretty sure I was having latency issues i.e. too much of a delay.

Maybe I was doing it wrong but I rage quitted and went back to using RF24.

Also: I was trying to send objects across BT and not just using strings. Much more difficult, and the BT stack is a bit new on ESP32.

But if it’s only for monitoring, this is not a big concern, right ? IIRC, metr.app uses a 2Hz refresh rate. That lets a comfortable amount of time for the Arduino I guess.

Hello, I`m doing an automated electric skateboard project and this seems like a good place to ask. The idea is to add some sensors via arduino. Is it possible to connect arduino to VESC UART port and send signals from arduino to VESC? As far as I researched, there are projects to read pwm from vesc, but I want to send signals, for example to slow skateboard down. Sorry for my english :slight_smile:

Yes there definitely is.

Go here and here. There are many projects on here that do this as well.

There is not a lot of project doing what you want to do (send signals to VESC) but I know someone did a cruise control mode on his remote and I guess it send signals to VESC. The problem I see doing this is “reliability” (what if something goes wrong and the board accelerates in the middle of a crowd ?)