• Hello ES! We could use some help to get us past the finish line on building the new knowledgebase for the forum.
    Can you donate? Please see our fundraising page. Thank you!

Converting Bafang pulses 6 per rev to 1

fxsvelo

New here
Joined
Aug 23, 2025
Messages
5
Location
Jedi8lucky*s4lunch
I have a speed sensor mismatch between the hub (6 pulses per rev) and the controller (1 pulse per rev). The speed sensor setting in the controller is locked out and CAN NOT be changed.

The Bafang hub sensor uses 3.3 V logic so I have a 3.3 V Arduino Pro Mini that is programmed to look for a FALLING edge on the input signal, count 6 of them and then pull the output line LOW for 10 ms to match what the Bafang signal is.

This works correctly when tested with an input signal from a 555 timer at 4.8 Hz.

The problem is the temperature data “noise” on the dual sensor/temp lead is triggering extra pulses on the output.

How can I filter the data noise and just get speed sensor pulses?

I have:
Bafang G310 hub
King Meter head unit
Arduino Pro Mini 3.3 volt 8Mhz
 
Looks like a "standard" G310 does not have temp signal over the speedsensor wire? Maybe yours is a "specialized" version coming from GRIN Technologies? If you still have no solution maybe you can ask them how to filter it.
Or if you will never need it, open motor and see what you can do to disable the temp sensor.
 
Back in my day, I'd hunt up a logic gate with a schmitt trigger input to clean up the signal. If the speed sensor signal is open collector like the Hall sensors, maybe you can pull it higher to 6-8 volts,
 
Back
Top