logo elektroda
logo elektroda
X
logo elektroda

Rectangular generator for the bicycle PAS sensor

yogi009  Cool? (+11)
📢 Listen (AI):
Small PCB with electronic components for bike assistance, next to a matchstick for scale.

A few years ago I electrified my old Dutch bicycle. Regulation motor, regulation method of control based on detecting the rotational movement of the pedals. The principle is simple: you turn the pedals, the motor supports you a little (the level of support can be set). You don`t shoot, you don`t drive :-) On the pedal support axis there is a PAS sensor and a wheel with a certain number of magnets. Turning the pedals moves these magnets over the PAS sensor (or, more precisely, over the two Hall sensors that detect the magnetic field). In simple terms, the PAS sensor "produces" a rectangular digital waveform (i.e. alternating "high" and "low" logic states). Empirical measurements have shown that a good frequency of these pulses is around 6-7 Hz (then the rest of the bike`s electronics feel good). I also made the PAS sensor for this electrification myself, because... original chinese (but it was an oxymoron) it started the engine even when I turned the pedals... backwards. By the way, the filling of the rectangle is responsible for detecting the direction of rotation of the pedals - it should be significantly different from 50%.

Last summer, the power steering failed, I removed it and rode without it. But it`s winter, so I have some time to analyze the extent of the damage. Generally, I assume two possibilities: the main Chinese controller is dead (and then it fails), or my PAS sensor is dead (or making another copy is simple and cheap). In order to diagnose it, you need to feed this square wave (approx. 6-7 Hz) to one of the inputs of the main controller. I could do this using a service generator, but I decided it would be better to make a small, self-contained generator board. It will allow me to diagnose damage to the PAS sensor, but it will also serve as a backup source of the square wave signal in case my pedal sensor fails, e.g. 45 km from home. In this case, just plug in this little "device" and the bike "thinks I`m turning the pedals" :-) This is a form of fraud.

Here we have a diagram, a preview drawing of the board and the PCB with the elements themselves (Top layer). As you can see, this is a really small module.

Electrical schematic of a homemade square wave signal generator. PCB layout of a small pulse generator. Diagram and drawing of a PCB with components marked as Top layer.

Well, today I finally launched my small but very useful project. Oscilloscope measurements showed that the results are very good, I measured a frequency of 6.4 Hz with a duty cycle of 20% on one output and 80% on the alternative output.

So I already have the test module, all I need to do is assemble the bike`s support elements and perform a diagnosis of the whole thing. I recommend this "rescue" module to everyone who has this type of drive. Controllers usually have one harness for the PAS sensor (three wires: +5V, ground and rectangular signal). In this project, we have two outputs to choose from: a signal with a 20% duty cycle and its inversion (i.e. an 80% duty cycle) - I added the second output due to different interpretations of the signal by different controller models.

If you look at the diagram, it is easy to see that by changing the 4.7uF capacitor and the values of both resistors (you can also draw potentiometers here), we will determine the frequency and filling of the rectangle we need.. So this is quite a useful diagram. The construction cost is practically non-existent.

Please don`t be picky about the photo, this time it was taken with a cell phone, and it`s a test module, so it`s a bit snotty with tin - these tests have to be done somehow. :-)

Edit:
The module has proven to be excellent in practice.

About Author
yogi009 wrote 14586 posts with rating 2603 , helped 846 times. Been with us since 2006 year.

Comments

krzbor 08 Feb 2024 13:54

Personally, I would connect one of the free gates to the "reverse output" and then the "output" would be created from it. In such a case, the generator itself would not have an external outlet - nothing... [Read more]

yogi009 08 Feb 2024 14:00

In its current shape, the first gate ends with a TTL output, the second one was used as an inverter and here we have an inverted signal. In the PAS system, similarly to PWM control, the bypass currents... [Read more]

Anonymous 08 Feb 2024 15:19

An alternative is to connect the shifter in addition to the PAS sensor, many Chinese controllers have the ability to use both. I understand that then it will be an illegal method of control - but in fact,... [Read more]

yogi009 08 Feb 2024 16:58

Illegal is one thing and uncomfortable is two. My friend doesn`t know the principles of these PAS systems. The frequency and width of the pulses are not linearly translated into support force or speed.... [Read more]

Anonymous 08 Feb 2024 17:03

ok, although I have the impression that this is not the case everywhere - in the bike that I built using a Chinese controller, the speed of turning the pedals affects the support, i.e. turning the pedals... [Read more]

yogi009 08 Feb 2024 17:06

I won`t insist on my opinion, but considering the controller and motor in one of the wheels purchased from different suppliers, I don`t really see the possibility of such control. A strain gauge sensor... [Read more]

Anonymous 08 Feb 2024 17:24

I don`t know, I`m far from insisting, there are thousands of no-name controllers from Aliexpress, I don`t even know the name of my model. In any case, it responds to the speed of turning the pedals, i.e.... [Read more]

yogi009 08 Feb 2024 18:43

This is a big disadvantage. Imagine that you are standing at a red light and you involuntarily turn your pedals backwards... And the bike lurches forward. This was the reason for me to make my own PAS... [Read more]

Ryszard1960m 09 Feb 2024 10:02

chart [Read more]

Mastertech 09 Feb 2024 15:46

That`s why you have a sensor on each brake lever that will disconnect the drive when it detects a low condition (brake LOW) I also converted a Dutch one into a Chinese one, twice, because the first one... [Read more]

yogi009 09 Feb 2024 16:50

I don`t need that. Somehow, I haven`t moved the pedals when braking for years :-) Added after 20 [minutes]: I don`t really feel the logical need for such a function, but if it is useful to someone...... [Read more]

rafcio363 11 Feb 2024 17:30

How is that possible without Arduino? [Read more]

yogi009 11 Feb 2024 18:00

Well, I don`t know, it just worked out that way... sorry :-) [Read more]

Mastertech 11 Feb 2024 22:22

I will make one on Arduino, I will implement Police Mo0de, which will turn the bike into an angel when I get off the saddle. They have taken up scooters with saddles and bicycles with levers like never... [Read more]

%}