arduino powered go kart !

My son has an electric go kart 24 V with a 10 Amp motor (2 x 12v batteries)

the speed controller appears to have failed - so i have decided to use the arduino to provide motor control

i want to

run the arduino off a 12v battery fit a potentiometer so i can limit the speed fit a new potentiometer to the end of the throttle cable to allow him to drive it measure motor speed to provide soft start at low rpm

i have a couple of questions

  1. is there anywhere i can get a small linear potentiometer
  2. is there a relay i can use to switch the 24 V to the motor (using pwm) that the arduino can power with no external power

should i be using a mosfet instead if a relay ?

This sounds do-able...

measure motor speed to provide soft start at low rpm

Slightly difficult, but do-able. I'd use an IR LED and phototransistor/photodiode to see when the spindle is at a certain position, then time how long it takes to reach that position again.

is there anywhere i can get a small linear potentiometer

Many places! :D http://www.ebay.co.uk/sch/?_nkw=linear%20potentiometer&rvr_id=258184365255&clk_rvr_id=258184365255 http://uk.rs-online.com/web/c/?sra=oss&searchTerm=linear+potentiometer&x=0&y=0 http://www.maplin.co.uk/search?criteria=linear+potentiometer http://uk.farnell.com/jsp/search/browse.jsp;jsessionid=P13S4FNS2040YCQLCIPZKBQ?N=0&Ntk=gensearch&Ntt=linear+potentiometer&Ntx=mode+matchallpartial&suggestions=false&ref=globalsearch&_requestid=255866 The list goes on :)

is there a relay i can use to switch the 24 V to the motor (using pwm) that the arduino can power with no external power

I wouldn't want to use PWM with a traditional electromechanical relay - the speeds of the PWM would be better suited to a transistor or solid state relay. The arduino will not provide any more than 40mA MAXIMUM without breaking. You will/may need an external power supply, controlled by a transistor, to provide the current needed for the relay.

run the arduino off a 12v battery fit a potentiometer so i can limit the speed fit a new potentiometer to the end of the throttle cable to allow him to drive it

Easy! Solder on the pot to the cable (assuming that is where you want it), make the arduino measure it's value, then produce a PWM signal dependant on the input.

Onions.

Pololu makes a 24V, 15A MOSFET motor controller you could use. Google for Pololu Motor Driver 15A IRF7862PBF. You can get it at SparkFun and others, but it is $40.

If you are using the arduino for control, you could program it for soft start.

A very interesting project you have there. I have a few suggestions that will make your life easier for this type of application.

I wouldn't use a relay, their switching time is too high for what you are lookin for. Use an n-channel FET instead. Go for something in the range of 40V 20A, you are going to be switching a lot of current and reasonably fast. Things that you will need to consider: switching noise getting into your control circuit and heat dissipation. Decoupling caps and heat sinks (if you go for SMD FETs you can use the PCB to dissipate it).

You can then use an arduino nano or mini (if size is a concern). If you are using Lipos, make sure you cut off when you have 3.3V on each cell, if not you will destroy them and could catch fire.

Soft start, you can use the PWM to modulate how much power you want to deliver to the motor. Speed measurement, use a rotary encoder, easy to use and releable. If you also want to limit the velocity, you can do that by SW limiting the PWM to a certain cap.

You can also use anything available in the Market as suggested or even some RC motor drivers (look at Hobby King) they have real beasts.

Sounds like a fun project.

fmalpartida: You can also use anything available in the Market as suggested or even some RC motor drivers (look at Hobby King) they have real beasts.

Unfortunately they almost all made for brushless motors these days. Hobby King sells just two that will work with brushed motors (example) but even this one is only rated for max 12.6V. It certainly is dirt cheap, though.

thanks for the idea's guys

I think i wil use a logic level mosfet and a big heat sink (maybe a cooling fan on it also)

i like the idea of the hobbyking esc but i will probably run this at more than 24V in the future - imagine being able to control the speed via radio control LOL

the motor i think is brushed and if i remember rightly i can read the rpm using one of the example sketches to read a fan rpm

Keep us posted on the project, it sounds like good fun.

project has worked out well

for now the go kart is operated from a switch on the steering wheel - I have a pot on the back of the kart that limits the amount of pwm that is applied so i can adjust the speed of the kart

i use two mosfets in parallel to switch 24v to the motor

i currently power the arduiono with a 9v battery

is it possible to run the arduino from one of the two 12V batterys ?

from checking the voltage after charging the batteries have about 15v each !

what can i use to reduce the voltage to say 9v ?

I plan to fit another pot to adjust the max speed of the motor and then fit a linear pot to the throttle pedal so he gets more power the further he presses it (he can't reach the pedals yet !)

If you use a 7805 voltage regulator to drop 15V (or 12V) to 5V, the regulator may get hot but maybe no big deal for you. In case you are picky, get a switching voltage regulator.

Gadget999: project has worked out well

for now the go kart is operated from a switch on the steering wheel - I have a pot on the back of the kart that limits the amount of pwm that is applied so i can adjust the speed of the kart

i use two mosfets in parallel to switch 24v to the motor

i currently power the arduiono with a 9v battery

is it possible to run the arduino from one of the two 12V batterys ?

from checking the voltage after charging the batteries have about 15v each !

what can i use to reduce the voltage to say 9v ?

I plan to fit another pot to adjust the max speed of the motor and then fit a linear pot to the throttle pedal so he gets more power the further he presses it (he can't reach the pedals yet !)

Using a 10V regulator would be a good way to step down from the battery voltage to something that can go into the Arduino without risk of thermal cut-out. Something like a 7810 regulator...

Also I hope there is a cut-out switch in case your home-made motor controller shorts out - 24V at 10A is a lot of mechanical power and potentially very dangerous if some fails in a way that connects full battery power to motor.

Will a poly fuse be able to act as cut off mechanism? They are kind of nice and you don't have to replace them. As you remove the short, they go back to work. I wonder if there is such a poly fuse rated at 10A. In case there isn't, just get a fuse box and buy a bunch of say 5A fuse so they will burn around 5A.

Thanks for the suggestions. The kart already had a poly fuse and i am still using it. The kart has blown two mosfets already they were rated a 30v and 105 amps! i am going to add a diode across the motor to prevent any back emf.

I will probably add a speed limiter and linear pot to the throttle when he gets a bit bigger :-)

Hi, My kids have similar situation...

Can you post/point to more info / diagram of what you did??

Thanks!

it was quite simple

a variable potentiometer on one of the analogue inputs

a simple switch on one of the digital inputs with a pullup resistor

and one of the pwm digital outputs connected to the gate of a power mosfet

i will have a go at posting up a diagram and code later on

Ok, Thanks...

I wonder if the arduino can switch the FET gates fast enough.. they have a lot of capacitance. Did the FETs get hot??

the arduino switches the mosfet at the speed of the pwm which is about 500 hz approx i think

the mosfet does not appear to get too hot - i have it mounted on a large heatsink

here is some code

void setup() {
   Serial.begin(9600);
   pinMode(2, INPUT);
   pinMode(13, OUTPUT);
 }

void loop() {
   int Switch = digitalRead(2);
   int PotValue = analogRead(A0);
   
   if (Switch == HIGH)
     {   
       digitalWrite(13, HIGH);   // set the LED on
       
       analogWrite(10, PotValue); 
     }
     else
     {
       digitalWrite(13, LOW);
       analogWrite(10, 0); 
     }
 }

Gadget999:
the arduino switches the mosfet at the speed of the pwm which is about 500 hz approx i think

Terry is referring to “how quickly the Arduino can stuff electrons into the gate of the mosfet”. The mosfet will run cooler depending on how quickly you can charge and discharge the gate and keep it out of “half-on” states.

the gate on the mosfet is fully on at 2.5 v - so i guess this mosfet is suited to logic control

i did previously use a different mosfet and that got hot enough to melt the solder on it !

Gadget999: the gate on the mosfet is fully on at 2.5 v - so i guess this mosfet is suited to logic control

I understand. But again, the question is how quickly the microcontroller can charge the gate up past 2.5V. While it's typically treated as an instantaneous action it's not; the voltage always ramps up to 2.5V and during that small period of time the mosfet is generating more heat than when it is fully saturated.

It's common in high current mosfet switching applications to utilize purpose designed gate driver chips to allow for faster charging and discharging of the mosfet's gate capacitance. Such drivers can supply several amps of both sourcing and sinking current and are really a mosfet saver for high current applications. They can be had in small 8pin DIP packages.

Lefty