Arduino powered Speedometer

geoff57

10 kW
Joined
Apr 25, 2007
Messages
752
Location
England
Hi
This has been done in the past but not for 5 years as far as I can find.
I want to make a speedometer using an Arduino and one of the hall sensors from a sensored brushless motor.

So far I have managed to solder a wire onto one of the hall pads inside the speed controller, when measured on a voltmeter turning the wheel by hand very slowly the meter read either 5v or very close to 0v.

I connected an Arduino to this wire and to ground using an interrupt to read the signals coming from the motor, I used an lcd display so I could see what was happening.

First I turned the motor by hand to establish the number of poles in the motor this worked fine one revolution and I had a reading of 22 to 24 it must be in there I will just have to make accurate marks to mesure one revolution.

I then started turning the motor using the throttle very slowly. That’s where everything went haywire the readings went rapidly into 4 figures and I had only done a few revolutions where have I gone wrong?

I know the cycleanalyst uses the same thing as I have another bike with the same controller on it and using the same connection.

Geoff
 
do you have a RC filter on the Hall signal, close to your arduino? could be you are picking up noise from the phase wires.
 
I had a feeling it was interference from the phase Coils causing the numbers to go haywire.

I just googled what you said RC filter and got back resistor capacitor filter, is this correct and what sort of values do I use electro or ceramic.

Geoff
 
Yes, what you want is a low pass resistor capacitor filter. Ceramic cap should be good. Cap around 100nF and resistor something like 100 Ohm
 
Thanks for all the help you have given with the problem of getting the hall information from the controller to the Arduino .

I now have another problem or should I say question.
I used the program I wrote to find the number of poles in one revolution, I started by just doing one revolution then realised that if I do 10 and decide the results by 10 the answer will be more accurate the results were 23.
My question is can you get a motor with 23 poles in it?
Geoff
 
23 pole pairs is possible (46 poles)
23 poles is not possible, the number of poles should always be divisible by 2 (always a N pole and S pole magnet)

the best way would be to temporarily install a spoke magnet, and then count the amount of hall pulses for one spoke magnet pulse. less human error. then print the count after each spoke pulse. this way you only need to give the wheel a whirl and see if all the counts are the same. (should be LOL)
 
Back
Top