Many Chinese motor controllers can be used without pedalling, which is not allowed for pedelecs. Here we need additional electronics that adds the extra functionality to meet the EPAC standard. I developed a pedelec legalisation device which can be built into the motor controller. In German this is called a Gasgriff Freischalter. It is built with a 1MHz Atmel ATtiny85. The motor runs only when we pedal forward and the speed is below 25kmh. Start up assistance to 6 km/h without pedalling is omitted.
I use a two position speed switch instead of a throttle. This requires special safety precautions against inadvertent switching on the motor, which can be perilous. This is because a throttle, in contrast to a switch, automatically springs back into the off position. A throttle is controlled consciously, a switch can stay in a certain position unnoticed. See also the disclaimer.
The motor is disabled when:
A digital Hall-effect device SS461A is used as PAS sensor and glued with epoxy directly to the bicycle frame. An advantage of the SS461A is the built in reverse voltage protection. Five magnets are glued into the chainring.
The bicycle speed is measured with a speed sensor from a cheap cycle computer (€3); it contains a reed relay and a spoke magnet.
Here is an example of how the pedelec legalisation device is connected to a motor controller. Download the circuit high definition pdf file here.
You can download the code at GitHub.