ARDUINO - help and ideas thread

It sounds really great !!

I was wondering about how build a database for collecting datalog from VESC Monitor app. I built a Excel sheets with macros to make the analysis fast and easy with lot’s of calculated parameters (like range). It’s still in beta since I need more .txt files from longer runs than mine (1km, 3min :smile: ). But anyway, it could be awesome so share the file directly from the app to the database and then see charts and average data etc.

The link of Excel sheet : https://dl.dropboxusercontent.com/u/47746996/VESC%20Monitor%20Analyser.xlsm

Wait… Are we building the eskate Google ? :smile:

1 Like

I have to send this to ‘‘our programmer’’. Unfortunately, at this stage I am more of a ‘‘coordinator’’ and ‘‘inspirer’’ than the one who does all the work!


@deathcookies is the one doing the hard work now (technical things).

I think, to make this even further he have to contact @makevoid and some of the high experts of this forum, to progress the project further.

As of right now we have only finished the platform, where to put all the info and text files / pictures etc… the next step with converting files and uploading them in an easy to look at result would probably take some extra effort… it is a question about human resources, now, I think :slight_smile:

Would it be possible for you to summarise what has been done so far?

(For reliabily recording and exporting data from vesc)


I opened the thread but it is way too intense and detailed for me to start readin it now… perhaps someone who has gone through all the thread can do the simple work of outlining:

  • How well does it work?
  • Is it easy to set it up?
  • What exactly is required besides Vesc, the app to make it working?

Answers to all of this would be great! So far the only ‘‘shortcut’’ and easiest way to see some live data from vesc and also export it is to use the bluetooth module. So I am not so sure how much easier it is to do it on a SD card.

I don’t have any skill in web or database coding, but I’ve another skill : I love to learn :slight_smile: So if I can join the dev process, let me know. I’m also beta-tester of VESC Monitor app and report issues to the dev. I could be a link between both platform if needed.

There are lot’s a talent guys here, but it seems that some of them work only on their own (sometimes with the hope of making money…). If only we could all put effort together, we should be able to ride our board just with our mind. :smile:

1 Like

ha ha :smiley: nice future concept and something to strive for! :smiley:

Dunno how fast this ‘‘brain impulse’’ technology will come in everyday use, though there are some applications where it is already happening, like with the paralyzed people and such…


I wrote a message to @deatchookies (our dev), will see what he tells us… though, we will probably need more than one person involved in this one… since it was a somewhat hard toll on @deatchookies to do it alone, partly of wrong initial planning, though, with more people in the team, this should be doable…

Though, I do hope that all of us (the interested parties) can come up with a plan and find a way to collaboate with each other… will be hard if everyone is coding and doing their own project alone…

Some ideas and suggestion for the first initiatives on what should be done, would be great!


So far, I’ve got to understand how much progress have been made so far…

As of now it looks like there is:

  • Working bluetooth module, with the option to make an app for android, too, not just iphone

  • Way to write vesc data to an SD Card (not 100% in tune, but that’s what I understand)

  • Somewhat finished Esk8 database for storing and displaying info with a few functions and design things still missing (should be updated&improved over time!)

Haha, the other thread is the summary already … :innocent: suppose there is so much information in this forum now … I only chimed in because I wanted to avoid that somebody develops code to store data on an SD card. It there already.

In short

Here the summary again: Hardware:

  • Arduino connected to VESC via UART
  • Standard SD Card shield

Code:

This code logs data in a JSON time series format.

Power the arduino off the VESC or use a common ground. The code runs on the Arduino device and pulls the data out of the VESC. The data is then stored on a standard SD card shield connected to the arduino. You need to set the VESC to ppm + uart mode and you only get the right data if the remote controller is on and connected. If you want to analyze the data, the SD card needs to be removed. You can then analyze the data either using the JSON data to GIF generator or the graph tool mentioned below or some other app that understands JSON. If there are enough requests, makevoid might add a CSV format as output.

@makevoid also made a program that takes the JSON time series and generates a text gif to embed in videos Code:

The program runs on Linux, opens the log file VESC_LOG.TXT and creates a GIF image based on the data in the log file. This image can be included in videos.

@makevoid JSON to graph app to make video overlays Software:

2 Likes

Suggestion (even though I’m not the OP or a moderator):

  • stick to ARDUINO help and ideas in this thread
  • Love the idea of VESC logging an ESK8 DB, however there are already a lot of threads covering this topic. Please use these threads

@Okami That’s who gave me the idea being honest, I was asking questions and not really getting much information back so I decided I’d just give it a go myself. Turns out it is not actually that difficult as Arduino’s are great for outputting a PWM signal for servos. All I did was buy a starter kit from Amazon for £40 which had solderless breadboards, wires, a servo, LED’s etc and get going. There are a few guides on the internet but I found a good sketch that uses interrupts to time the PWM signal from the receiver that turns out to be a lot more efficient than using the function available in Arduino (http://www.benripley.com/diy/arduino/three-ways-to-read-a-pwm-signal-with-arduino/) Writing to the servo is the easy part as there is a servo library already. The code to implement smoothing was also easy as that is available on the Arduino website.

So right now the sketch I have will read the signal from the RX, average out the last 10 results and output the PWM pulse to the servo. The smoothing is needed as the PWM pulse from the receiver does vary slightly +/- 5 microseconds. Took me about 2 hours to actually get working but I have watched a lot of youtube video’s and tons of reading (all stuff I don’t fully understand) to get this far. The hardware side is piss easy as long as you remember to use a common ground.

What needs to be done is the following - Setup a routine so the Arduino knows the neutral, max and min pulses from the RX (like you do with ESC’s) Write the throttle/brake ramping code (the hardest part of the project) Implement variable resistors to tune things like max throttle, throttle ramp speed, brake ramp speed.

Once that is working then it’s easy to create different ramping curves, preset modes etc. Only thing after that would be some kind of display.

I don’t mind giving people the code as it is but I have just been copy pasting chunks of code and the comments all need fixing as I have made changes. It also needs to be split into smaller functions as there is a lot going on in the loop() right now.

@Pimousse There is probably better platform to use other than Arduino but for the cost and ease of use I quite like it. Try adding a 1 to 10 millisecond delay between the routines and see if it solves the issue. I don’t think a delay that short is going to be noticeable or really affect the output.

2 Likes

@PB1 Yes i agree, threads for specific topics should be maintained. It makes it much easier to keep track of the discussions. @EssEnn you know im looking forward to seeing the ideas and possibilities your project could open up. Input from the community could make this idea the next best thing for the hobby since the vesc :slight_smile:

We are still only batting ideas around here so we can just keep this one a random arduino thread with no specific direction. Any direction you want to go is a good direction!

@Okami made a good suggestion to me about a sub category for arduino, would one of the mods be able to confirm if this is something that could be looked into (or if its even possible? im sure it is) as there seem to be quite a few arduino related threads popping up and it would make it easier to keep track of them in the electronics category.

Same here. Asked in private message for more details, never got any reply :confused:

I think we need to develop this into somewhat ‘‘diy kit’’ or a module you can buy and install… otherwise too many ppl dont get the chance to set their boards to ‘‘beginner’’, ‘‘intermediate’’ or ‘‘pro’’ mode…

Especially true for 10s and 12s boards, I believe, where it is quite easy to loose control and push too much of a throttle…

@Okami Once the code is done then anyone will be able to build one. It sounds difficult but the wiring to the UNO is well easy. If you can build a DIY esk8 then this is just as easy, just smaller. I have no idea about producing a shield for the uno for the project but looking what some people have done in this thread it can be worked out in time. First got to get the code working. I want it to work in a way that anyone can edit variables in the code so anyone can fine tune it and lastly optimise the code so it can have other functions added without affecting performance. The code is going to need to be robust as the last thing allowed is it to go haywire and hurt someone. This is the main reason all the code & designs are going to be freely available to anyone.

God I have been thinking about this WAY too much. 2 weeks ago I had never coded an Arduino and now my brain is going overdrive about it. Once things calm down at work I’ll be able to actually spend some time on this as I find i’m reading a lot, thinking a lot but not doing a lot. I will be meeting a friend in a few weeks who does code C++ and Arduino’s who said he would help so fingers crossed hey

Hey, that’s great news! Im really happy someone has decided to make this public! (arduino code & instructions on how to fine tune the PPM/PWM signal)


I first heard about this ‘‘throttle ramping’’ on an instructable about making electric scooter. The guy who wrote it had some serious background in robotics and he was also studying at MIT or a similar level school. Too bad he did not give much instructions on how to make one, though.


Good to hear you will get some help, I have very limited arduino knowledge, I’ve turned on some basic matrix displays, did ultrasonic and light sensor things, perhaps a few other little tweaks but nothing major so far… I would appreciate if arduino code and all the instructions / functions were more easy to understand as it gets quite intense and non - understandable fast :slight_smile:

Also takes a lot of time, patience and endurance to find what is not working! Once I spent about 3 hours to get some basic lights working :smiley:

Well I had a quick look at my code and added a few comments to try and make it clear, you can grab it here - https://drive.google.com/drive/folders/0B9G-85jU01X5RUZoNGpRczRNcms?usp=sharing

I have only tested this with a servo at the other end but it does work. Pin 2 is the signal pin from the receiver and pin 3 is the transmit pin for the servo. The UNO cant supply enough juice for the receiver and is only 5V not 6V so I have 4 AA batteries in series to give me 6V. The servo seems to need to be powered from the UNO (otherwise strange things happen) and you must have a common ground or nothing works.

I’m going to split the parts of the loop into functions and get that working hopefully tomorrow or over the weekend.

A lot of the comments are from the original writers of the code that I have copy/pasted and modified so it works. I’ll compile a list of sources and add them so I can give credit where credit is due.

yes thats exactly what I’m thinking. I just got one of the modules and I’m researching vesc/ble for an android vesc app.

Once i have the data, i might make an online tool to upload directly/compare trouble shoot… This is all very early stage ideas tho. not sure when i’ll feel like coding…

1 Like

is this close enough? I think i used arduino for the wired version, so its still on topic :wink: http://www.electric-skateboard.builders/t/touchless-power-glove-control-working-interested/10718

I’ve been trying to get data from vesc via uart but still not receiving anything from the VESC. I have an arduino uno connected to a small lcd, which displays the voltage and rpm. The uno is hooked up to a lipo on the uno’s 5v vcc pin and GND pin. Only the vesc’s rx and TX pin are connected to the arduino.

Could that be that problem?

did you enable ppm+uart? also, im not sure about this since i haven’t done any vesc uart dev but i believe you have to query the vesc?

Also, its a good idea to have a common GND from the vesc to the arduino. And since the vesc can provide 5v you can just use 5v, GND, TX, RT from the vesc.

Yes, I have ppm+uart enabled; baud rate is also identical.

I should add that plugging in a Bluetooth module to the VESC’s uart works with the VSC Monitor app (by solarturtle?). Also, what’s “query the VESC”?(Im a noob)

you need a common ground forsure.

other then that I think the vesc only give data as a response. so you have to send a request code, and it will send back the data you want.

i’m not sure what the codes are yet tho… working on it.

Example code for.getting data from vesc and arduino library https://github.com/RollingGecko/VescUartControl?files=1