Build Log: Waterproof longboard 10s LiFe with Vesc

That looks sick with the LED light

1 Like

My board is officially complete! :grinning: Here are some pictures of it:

Here are the measured specs: top speed: 20 mph range: 11 miles (farther than I expected) charge time: about an hour (charging at 1C) weight: only 15 pounds

I meet all the goals I set for this build. It’s (most likely) completely waterproof. I’ve only rid it through puddles so far but it’s been doing fine. It’s easy to charge with the BMS. The batteries are a safe chemistry (LiFe) so they shouldn’t ever catch on fire. The ground clearance is great, and the winning remote is working pretty well for me (I’ve only had a few drop outs when I’m pulling lots of amps. I am gonna try more loops around the ferrite ring).

Also I haven’t posted anything about my Arduino battery meter here yet. I wanted an easy way to see how much battery life I had left so I made this:

This circuitboard has @JdogAwesome’s mosfet switch and an arduino that I’ve programmed to read the battery voltage and display it on 5 LEDs on the outside of the board.

I’ve found that just reading voltage isn’t the best way to monitor LiFe batteries because their voltage goes up and down a lot depending on load but it works good enough. :grinning:

I’d like to thank all these people for making this board possible: :slight_smile: @JdogAwesome for the mosfet switch @torqueboards for the wheel pulley kit @chaka for the vesc and motor Benjamin Vedder for designing the vesc @stealth71 for the kydex enclosure idea @onloop for making this forum possible and everyone else here for posting their builds and ideas.

Some things I still want to add in the future: a headlight for seeing the road better at night a handle change from 9mm to a wider belt a gps tracker (any ideas for this?)

8 Likes

Board looks really clean man, love it!

1 Like

Wow this board is beautiful! Im happy you liked the design of my switch and I hope it fits your needs!

1 Like

Nice :slight_smile: We have 12mm Kegels now btw. They are a much nicer/durable fit than the previous versions.

1 Like

I’ve had a few people ask me how I did the Arduino battery meter so here’s how I did it: :grinning: I’m writing this assuming basic arduino programming knowledge and goodish math knowledge.

This is how the Arduino reads the battery voltage:

The Arduino analog pins can read anything from 0 to 5 volts so I just used resistors to drop the main voltage down before connecting to an analog pin. The voltage will still be proportional to the main voltage.

So now that the arduino can read the battery voltage it just needs to know what voltage correlates to what capacity. Since my LiFe batteries don’t discharge linearly I had to find an equation for the discharge curve. To do this I charged my battery fully then rode my board until it died, checking the battery voltage with a multimeter every mile and writing it down (I used the app Strava to know how many miles I had gone).

Once I had a table of data (distance traveled and voltage) I put the data in my calculator and used the calculators built in quartic regression to find an equation for the curve:

I put 5 LEDs on my board so I decided my battery meter would have 6 states: (1 means LED on and 0 means LED off)

Then I just had to use the equation to find out what the battery voltage would be at every increment.

The arduino analogRead() function doesn’t directly read the voltage. It only reads a fraction of the voltage determined by the resistors used in the first picture. It also doesn’t return the value of the voltage, it returns a number 0 through 1023 (0 being 0 volts and 1023 being the reference voltage(the reference voltage is really close to 5 volts)).

So now I had to find an equation that relates the battery voltage to the number the arduino analogRead() function returns. This is way easier than the last equation because it will be a linear one. I just needed two data points:

first data point: battery voltage: 0 analogRead(): 0

second data point: battery voltage: 33.6 analogRead(): 748

To find the second data point I just measured the battery with a multimeter and used the arduino serial monitor to display the results of analogRead().

Then I plugged these into my calculator and used linear regression to find an equation. I used that equation to translate all the battery voltage increments into what analogRead will say at those voltages:

So now I know what increments to change the LEDs at, time to program the ardiuno! The ardiuno code is really simple, here it is:

//longboard battery meter code //Nick Wallick 10/20/16

int delayTime = 100; int battery; int flashingTimer = 0;

void setup() { // put your setup code here, to run once: pinMode(A7, INPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); pinMode(12, OUTPUT);

startupAnimation(); startupAnimation(); }

void loop() { //reads pin attached to resistors and battery battery = analogRead(A7);

//BATTERY AT 5 BARS/////////////////////////////// if (battery >= 750){ digitalWrite(8, HIGH); digitalWrite(9, HIGH); digitalWrite(10, HIGH); digitalWrite(11, HIGH); digitalWrite(12, HIGH); } //BATTERY AT 4 BARS/////////////////////////////// if (battery < 750){ if (battery >= 741){ digitalWrite(8, LOW); digitalWrite(9, HIGH); digitalWrite(10, HIGH); digitalWrite(11, HIGH); digitalWrite(12, HIGH); } } //BATTERY AT 3 BARS///////////////////////////////// if (battery < 741){ if (battery >= 737){ digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, HIGH); digitalWrite(11, HIGH); digitalWrite(12, HIGH); } } //BATTERY AT 2 BARS/////////////////////////////// if (battery < 737){ if (battery >= 734){ digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, LOW); digitalWrite(11, HIGH); digitalWrite(12, HIGH); } } //BATTERY AT 1 BAR/////////////////////////////// if (battery < 734){ if (battery >= 724){ digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, LOW); digitalWrite(11, LOW); digitalWrite(12, HIGH); } } //BATTERY AT FLASHING/////////////////////////////// if (battery < 724){ if (battery >= 683){ if (flashingTimer > 2000){ digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, LOW); digitalWrite(11, LOW); digitalWrite(12, LOW); }else{ digitalWrite(8, HIGH); digitalWrite(9, HIGH); digitalWrite(10, HIGH); digitalWrite(11, HIGH); digitalWrite(12, HIGH); } flashingTimer = flashingTimer + 1; if (flashingTimer > 8000){ flashingTimer = 0; } } } //BATTERY AT FAST FLASHING/////////////////////////////// if (battery < 683){ if (flashingTimer > 500){ digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, LOW); digitalWrite(11, LOW); digitalWrite(12, LOW); }else{ digitalWrite(8, HIGH); digitalWrite(9, HIGH); digitalWrite(10, HIGH); digitalWrite(11, HIGH); digitalWrite(12, HIGH); } flashingTimer = flashingTimer + 1; if (flashingTimer > 1000){ flashingTimer = 0; } } }

void startupAnimation() { digitalWrite(8, HIGH); delay(delayTime); digitalWrite(8, LOW); digitalWrite(9, HIGH); delay(delayTime); digitalWrite(9, LOW); digitalWrite(10, HIGH); delay(delayTime); digitalWrite(10, LOW); digitalWrite(11, HIGH); delay(delayTime); digitalWrite(11, LOW); digitalWrite(12, HIGH); delay(delayTime); digitalWrite(12, LOW); digitalWrite(11, HIGH); delay(delayTime); digitalWrite(11, LOW); digitalWrite(10, HIGH); delay(delayTime); digitalWrite(10, LOW); digitalWrite(9, HIGH); delay(delayTime); digitalWrite(9, LOW);
}

The code just reads the A7 pin and turns the right number of LEDs on depending on what A7 returns.

When writing the code I decided to add fast flashing, in addition to normal flashing, if the battery gets way too low so I know to turn it off. I also added a startup animation just cause it looks cool :slight_smile: .

Hopefully this helps some people figure out how to make a battery meter!

Also here’s my full electrical drawing of the circuitboard I soldered the arduino to. The wires going up on the right go to the LEDs. This circuit board also has this mosfet switch.

10 Likes

This is one of the most beautiful builds I’ve seen with external enclosures.Your enclosures along with buttons and leds just look professional. The builds I love the most are the stealth builds with a hollow wooden deck, but you have the added advantage of leaving some flex in the board for comfort!

The only thing I think you should do make it actually waterproof is getting rid of the connector between the enclosure, and making an enclosure/spray-shield for your motor so water doesn’t spray in to it. I’m also going to do a waterproof build so yours will definitely serve as inspiration!

1 Like

Thanks so much! It would look better without the connector between the enclosures but I kinda need it for ease of maintanence. It should be fine getting wet though.

A splash guard for the motor would be good to protect the motor bearings from water. Or I can change the motor bearings with ceramic ones.

Do you have a complete list of all the parts you used?

Hey @ndwallick I love the schematic for the board and how you implemented everything, only thing I would suggest is using a small buck converter instead of the Linear one because they are 100x more efficient. Also I purchased these for headlights and they seem pretty bright, though I haven’t tested them on my board in real conditions yet. And for the GPS thing, I’ve had an idea in dev for a little while now which would have a GPS module as well as UART communication with the VESC and connect via BT to your phone to get accurate info on your VESC as well as GPS based info, but don’t expect anything any time soon lol.

EDIT: you may also want to slightly bump your positive side MOSFET gate driver voltage divider resistor a little, like 12K ohms because ATM gate is being given 17V which is a little closer to the max of 20V for the 3034. You should be fine at 17V but if you wanna make sure I’d go with 12K resistor. And if you really want to perfect it you could use a 12V Zener instead to give it a constant 12V.

Here you go @LivingLongboard I meant to post this earlier. All the parts I bought and their prices: https ://docs.google.com/spreadsheets/d/1z52R29VjZmLlpdBmYNeP7w5TYLwirt2lKW2v7VQmexs/edit?usp=sharing

Edit: just remove the space after https. The link was causing problems

@JdogAwesome I do plan on switching to a buck converter. At first I thought a linear voltage regulator would be fine cause it is only powering an arduino but it does get pretty warm. Il also switch to the newer higher voltage mosfets that you suggested in your post and I’ll change out the resistors according to whatever those mosfets need.

I’ll probably just make a whole new circuitboard with all the changes and add whatever circuitry for headlights I may need. Il definitely check out those headlights they’re super cheap.

Also looking forward to your GPS module!

Fantastic build, @ndwallick!

I’m looking at getting the same deck and 5065-200kv motor. Have you found the flex of the deck to be a problem? Also, how hot does the motor get during a riding session?

In hindsight is there anything you would’ve done differently with this build?

Thanks

Thanks! The deck has a medium flexiness to it. When I attached the kydex it definitely got stiffer but the flex didn’t cause any problems.

The motor gets pretty warm but never too hot to touch.

The main thing I changed since I finished the board is upgrading to this 12mm pulley kit because I already had a 9mm belt break.

Good luck with your build

Great, thanks for the info. What range are you getting with your 10S2P LiFe pack?

Right when I finished the build I did a range test and got 11 miles, but I was likely not pushing it very hard since I was still getting used to it. I also live in an area with no hills. So I’d guess a little less than that. The board only weighs 15 pounds so there’s definitely room for more battery.

1 Like

Hi! what type of mounting hardware you are using? Can you share the site, where you bought it?

general waterproofing question i’ve always wondered, are outrunner motors inherently waterproof? do you just need to watertight and insulate the connections coming off of them?

That is correct.

@laikiux I designed the motor mount myself and got a friend with a machine shop to machine it for me. Here’s the design and here’s the final product. It turned out pretty good, I just had to cut off a corner with a saw after to get more ground clearance.

@osbor Outrunners are inherently waterproof. I believe even if the connections coming off of them get wet it will be fine. Regular water isn’t conductive enough to screw them up electricaly. The motor bearings could rust though if they aren’t ceramic. Water mostly causes problems with sensitive smaller electronics like circuitboards and possibly sensors on an outrunner (haven’t tried those wet yet). Salt water however is more conductive and could cause problems. Here’s a good video on the topic.

Sorry, but I asked for enclosure mounting hardware :smiley: