• 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 output 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? My head/controller doesn’t make use of the temperature data so I’m really not losing anything by getting rid of it.

Relevant Bits:
Bafang G310 hub
King Meter head unit
Arduino Pro Mini 3.3 volt 8Mhz

1. Arduino tested with 555 timer input
2. Signal from the Bafang hub
3. Bafang signal and Arduino output
 

Attachments

  • IMG_8386.jpeg
    IMG_8386.jpeg
    1.8 MB · Views: 4
  • IMG_8391.jpeg
    IMG_8391.jpeg
    2.1 MB · Views: 4
  • IMG_8392.jpeg
    IMG_8392.jpeg
    2.1 MB · Views: 4
Back
Top