Apologies for the repost of some of this, but this single post can be a single point of reference for the rim magnet derestrict.
My build is based on an Ardunio microcontroller, reed switch and electromagnet. I removed the bike's rim magnet and instead placed a traditional magnet on the disc rotor. The Arduino then uses the reed switch to sense the true RPM of the wheel, delays the time between magnet passes by a fixed multiplier and then activates the electromagnet at the new interval accordingly. The electromagnet is positioned up against the motor case.
With ~100 lines of code, everything is working great. I've got the multiplier set to 1.4 (eg where true speed is 20kph, motor will be shown 20/1.4= 14.3kph), giving a new max assisted speed of 35kph. The multiplier could be set to anything, say 2 would give assist to 50kph.
The beauty of this setup is the simplicity: no interruption of sensors from the motor, reducing chance of detection. So long as you don't go crazy with the multiplier, it'd be very difficult for the motor to detect this manipulation, as there are so many real-world variables which will mask it; rider weight, gear ratio, terrain etc. Some things may give it away though. For example, if you use a large multiplier, you may reach a point where for a given cadence it's just not physically possible to be traveling so slowly. Also if you use location tracking through the Eplus app, it may compare wheel speed with GPS speed and flag a discrepancy.
Some FAQ:
- YES it will disrupt your total trip distance and odometer, but it's a simple multiplication to get the true figures. ie reported trip distance * chosen multiplier = true trip distance.
- YES it should work on setups without the rim sensor. Instead of positioning the elctromagnet against the motor case, position it against the speed sensor.
- Total power usage when the magnet is firing is ~2.4watts, and negligable when it's not firing (ie when the bike is stationary). Magnet is firing only around 8% of the time.
Here's a quick tutorial so you can build your own derestrictor for the smart system with rim magnet.
Components:
Of course there's plenty of equivalent components you can substitute here, so go with what's cheap/easy to get locally.
Wiring Schematic:
Reed switch: D8 and Ground
Transistor: Base > Ground, collector > electromagnet, emitter > D3
Electromagnet: 5v and transistor's collector leg
Voltage regulator: 5v and Ground
View attachment 105957
The Arduino nano has a built in regulator, so you can also wire the ~13v from the Bosch low power port direct to the Vin and Ground pins in order to omit the voltage regulator above. I had a spare regulator so figured I'd use it to monitor temperatures.
Note that you'll need your Bosch dealer to enable to the low power port before it will be powered.
I was also able to build my own electromagnet with some enameled copper wire. You need a coil resistance of ~15ohms. I used 100 turns around some pvc pipe ~ 25mm in diameter and a 0.5watt 10ohm resistor.
View attachment 105975
These work just as well as the commercial electromagnet and offer better flexibility of placement. If i was starting from scratch, it'd use this rather than the off the shelf product.
Programming
Load the attached code to the Arduino Nano with Arduino IDE. You can download it
here.
You can update the Multiplier variable in the code (line 26) to alter the maximum assistance speed. I've got mine set to 1.4. This slows the actual wheel rpm by a factor of 1.4, moving the maximum assistance speed from 25kph to 35kph.
Installation
Snap the magnet on to the rear disc rotor. Mount the magnetic switch on the swing arm so that it's close to the rotating magnet.
The placement of the electromagnet is a bit tricky as the motor measures the strength of the magnet field, not just if a field exists. I found it best to mount the magnet facing AWAY from the motor (ie magnetic face towards the rear of the bike). Refer to the pics attached for my placement location. I'm using some foam to wedge it in place.
Once wired, the Arduino Nano and all wiring gets pushed into the frame.
Good luck and let me know if there are any questions.
View attachment 105963 View attachment 105964 View attachment 105965 View attachment 105976 View attachment 105977