Showing posts from 2018

LunchBox ESkateboard Part 4 : Android App Software

Note: Due to the complexity of Android Application, this blog post will not explain the code in detail. If you are not familiar with Android programming, maybe it is better to learn fundamentals from android websites.

I made an application to control the ESkateboard via bluetooth.  It automatically scans my skateboard and tries to establish connection and it allows speed control from volume up/down button or touch screen(currently disabled as I found that using volume button was good enough for me). The full code can be accessed from my Github.
The UI of my application looks like this:

The application was modified from Android Bluetooth Low Energy example project from here. The structure of the application consists mainly two parts: the main activity and a service that bound to it. The activity takes care of all the input handling and UI display while the service takes care of Bluetooth communication. 
Section 1: Bluetooth Communication

Upon clicking the connect button on the top righ…

LunchBox ESkateboard Part 3 : Arduino Software

Unlike radio receiver, Arduino needs to be programmed manually to output correct PWM signal to ESC. The skateboard ESC I used expected to receive pulse every 20ms (50Hz) and the minimum time of the pulse is 1ms while the maximum is 2ms. (This is the standard PWM signal for controlling servo). Because I configured the ESC mode to be forward with brakes, a signal with duty cycle above 50% (1.5ms~2ms) will rotate the motor forward while a signal with duty cycle below 50% (1ms~1.5ms) will trigger the brake. If ESC receives a signal with duty cycle 50%, it will not output any command to motor and therefore allowing it to rotate freely. 
Luckily, Arduino has a ready-to-use servo library for outputting the desired PWM signal. So in my code I initialized servo with minimum and maximum as required by the PWM signal.  #include <Servo.h> Servo mServo; const int minPulseRate = 1000; const int maxPulseRate = 2000; mServo.attach(pwmPin, minPulseRate, maxPulseRate);
After the above initializa…

LunchBox ESkateboard Part 2: Electronics

The electronics of the E-skateboard is quite straightforward. The overall structure was summarized nicely by vlad pomogaev in his video

while random88ish uploaded an awesome video to explain everything extensively

And here is a picture of my system in the lunchbox. The only difference is that instead of radio receiver, I used Arduino101 for Bluetooth control.

In summary, the key to choosing the right motor is that choose a motor with the proper kv value so that it could deliver your desired top speed and starting torque.  The formula for top speed is
wheel rpm = kv * voltage of battery * gear ratio * efficiency speed(km/h) = wheel rpm * wheel circumference(cm) * 60 min/h / 1000000 is a online calculator that can be used to calculate speed easily.
For starting torque, The torque per armature current is inversly proportional to kv of the motor

meaning that for constant current, a lower kv motor would generate larger torque. Normally, from experience, suitable kv valu…

Lunchbox ESkateboard Part 1: Mechanics

The skateboard itself was purchased from TAOBAO for 10 SGD. It is the cheapest I could find as I am quite new to skateboard and do not have specific needs for good quality.  
The mechanic hardware of the electric skateboard are all purchased from TAOBAO from a vendor that sells complete DIY kits to modify your normal skateboard to electric version. The kit includes wheels, pulley, belt, trucks and necessary screws and nuts. 

Assembling the kits was quite straight forward although the vendor didn't provide any manual or instruction. Moreover, there are numerous videos on Youtube that describes the procedures in details such as this:

Overall, I am quite satisfied with the quality of the DIY kit except the following two parts.
1. Due to the pulling force of the belt, the wheel that connects to motor could not be mounted straightly, resulting in friction against the truck. I had to purchase lubricant oil to reduce the friction so that wheel could rotate properly.

2. Provided screws w…