You haven't got a flyback diode on the relay. Did you try it like that?E-bikes sold in the UK and Europe are only allowed to provide assistance from the motor when the pedals are turned. All new preassembled e-bikes are sold without a throttle, other than the “walk” facility which allows movement of the bike to be assisted at 6kph, usually by depressing a button on the display.
Many pedelecers while rarely requiring a throttle would welcome one for hill starts, for better accelaration at road junctions and to maintain movement while clipping in to the pedals.
E-bike kits will often have a facility to include a throttle so that the motor can be energised using either the bottom bracket PAS or the throttle.
In some instances it may be possible to fit a throttle to new preassembled bikes by connecting to the controller, but not all controllers will have suitable connection pads and in many instances the controller circuits will be encased in silicone to prevent water ingress thus preventing user access.
The PAS sensors fitted to many e-bikes rely on rotating magnets at the bottom bracket creating electronic pulses, in a Hall sensor, which energises the controller and activates the motor.
The first post of this thread provides an Arduino based circuit and code to create pulses to mimic those generated by the PAS and thereby activate the motor. I have spent some time trying to get this (and another Arduino based solution described in my recent post) to work without success.
Using the circuit attached consisting of a momentary switch to supply 5v from the PAS supply lines to an NE555, wired as an astable oscillator, and to activate a relay to disconnect the signal line from the PAS to the controller, I have been able to mimic the PAS and energise the motor without having to turn the pedals.
The throttle is either On or Off, there is no intermediate control, but this exactly the same as the normal PAS.
The NE555 was bought as a board from eBay for a little over £2 (see second attachment) and offers a wide range of signal frequencies and duty cycles using dip connectors and fine tuning using the variable potentiometers.
I have found a 7Hz frequency and a 55% duty cycle to be effective, but this does not need to be precise.
View attachment 40514
View attachment 40517
Using Flyback Diodes in Relays Prevents Electrical Noise in Your Circuits
What is a flyback diode, and how does a flyback diode protect a circuit? When used properly, flyback diodes can reduce electrical noise and prevent flyback voltages from building up.
resources.altium.com