The power and control hardware on this DIY electric skateboard is divided into an electrical system and the control electronics. The electrical system consists of the batteries that supply current to both the control electronics and the motor and the wires that link the battery and the motor to the control electronics. The control electronics consists of the Electronic Speed Controller (ESC), the Arduino microcontroller (the “brain” of the skateboard), and the receiver for the wireless nunchuck remote.
Wiring the electrical system of the skateboard is fairly simple. Before you start however, it is best to lay out the different physical parts on the longboard to visualize where fastener attachments and wiring connections will be made. This step also helps determine what length the wires connecting the battery to the electronics will have to be.
Use the following diagram to place your components on the skateboard and make the electrical connections between them:
First, use the 12 AWG wire and some connectors that match the connectors on your battery to make a connection from your batteries’ terminals. We’ll wire the two batteries in series to create a 22-volt power supply for the skateboard.
The “thin” side of one bullet connector housing connects to the “thick” side of the other. By connecting the positive lead of one battery to the negative lead of another, we can create a “6S” or 6-cell series battery out of two 3S batteries.
Connect the other end of the power and ground wires coming from the batteries to the power and ground wires of the ESC. The ESC will in turn supply power to both the motor and the Arduino. If the wires from your motor are not long enough to plug into the 3-phase wires from your ESC, create jumpers to connect the ESC and the motor using this same 12-gauge wire.
Putting together the control electronics is slightly more complicated. The Arduino receives its power directly from the ESC’s inbuilt Battery Eliminator Circuit (BEC)—an inbuilt circuit in the ESC that converts the input battery voltage to a lower voltage to run controllers and receivers connected to the ESC.
Use the following diagram to connect all the electronics!
The servo cable coming out of the ESC’s case has three wires of distinct colors: red, the power line from the BEC of approximately 5 volts; white, the signal line from the speed controller via which the Arduino will send a Pulse Width Modulation (PWM) signal to the speed controller to modulate the motor speed; and black, the ground line from the BEC.
Now that you’ve make all the connections between ESC and the Arduino, we can focus on interfacing the Arduino with the Wii Nunchuck—the handheld remote that the rider will use to control the skateboard. The nunchuck is designed to connect to and communicate with the Wii remote, so we’ll have to hack it to serve as a controller for the skateboard. If you look closely at the receiver that comes with the wireless nunchuck, you will notice that its male connector has six pins inside. This is a pinout for the connector:
We’ll use the nunchuk extension cable to access and connect to each of these pins individually.
Once you have determined which pins correspond to which wires, you’ll need to single out the Power, Ground, Data, and Clock wires and connect them to the Arduino. The fifth pin will not be used in this project.
Since the Arduino communicates with the nunchuck receiver via I2C, we will have to make the data and clock connections from the extension cable to the Arduino’s I2C pins, Analog Pin 0 and Analog Pin 1. To learn more about I2C communication, check out this tutorial.
We’ve finished putting together the electronics for our DIY electric skateboard! To make the electronics more compact and neater, I used a small piece of perfboard to hold all the connections between the peripheral electronics (the ESC’s and the nunchuck receiver) and the Arduino:
It’s time to take a look at the software that will be running on the Arduino to translate inputs from the nunchuck joystick into a motor speed to actually drive the skateboard.