How to add a throttle to a Carrera Vengeance E Spec

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,993
Basildon
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
You haven't got a flyback diode on the relay. Did you try it like that?
 

jokskot

Pedelecer
Jul 14, 2018
159
47
76

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
So I had a chance to get into the Controller box of my bike last night and it turns out the PAS connector is actually 4 wires not 3! Its Black/White/Yellow/Green how can I make this work with the circuitry designed from the 3 wire connection.

Is that extra wire the torque sensor? I saw the post by Woosh member mentioning it is most likely the torque wire.

Could I still do the wiring without using the torque wire?
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
Could I still do the wiring without using the torque wire?
The simplest way to wire in your throttle is really using a microcontroller. A discrete circuit will work but involves more logic to do in hardware whereas an arduino can do that without you doing extra design work. You need to connect to your arduino board all 4 wires on the sensor side, the same 4 wires from the controller side and 3 wires from the throttle. Vcc and Ground are common. You have 3 input signals, cadence, torque and throttle, and your code will make two synthesised outputs, cadence and torque.
For the frequency of the cadence output, it can be self learning from reading the maximum input cadence.
For your synthesised torque output, you can logically decide to use either the input torque voltage or the throttle voltage.
 
  • Like
Reactions: Jon H

vfr400

Esteemed Pedelecer
Jun 12, 2011
9,822
3,993
Basildon
The red and black wires are 5v supply. One of the others gives a 1.2v to 3.8v signal from the torque sensor. Thats the same signal as a throttle, so you could splice in a throttle to those three wires. The 4th wire is a pulsing signal that I guess is to indicate the pedals are turning. I don't know the frequency, but I'm going to guess that it's in the range of a noemal PAS.

Wire in a throttle and test whether it works when you pedal.

I gave the exact wire designations above somewhere, so it shouldn't be a surprise to you that there are 4 wires.
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
Wire in a throttle and test whether it works when you pedal.
For proof of concept, instead of splicing the wires, I would connect the controller side first to the arduino and make the wheel spin with code.
 

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
For proof of concept, instead of splicing the wires, I would connect the controller side first to the arduino and make the wheel spin with code.
Yes I will attempt this but first i need to source some connectors and appropriate wires so I don't have to cut any wires already connected to the controller.
 

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
Going back to the original diagram I now have 4 cables (the addition of the torque cable) running into the Arduino board which input (Digital/Analog) would this cable be plugged into? And I now also have an extra cable input required for the Controller (4 cables not 3 as it was accepting the Torque cable). So any advice on what inputs on the board i should use for this extra cable (the torque input and output).
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
post some pictures - you will make the project easier to follow.
1. of the connector controller side
2. your arduino board

step 1: connect the red (controller 5V) and black wire (controller ground) to the arduino Vcc and Ground pins. Make sure that the self test blinking routine works.

step 2: connect the controller PAS wire to a digital output pin and the controller torque wire to an analog output pin. Make sure that the self test blinking routine still works.

step 3: write and debug your code until you make the wheel spin.
step 4: connect the throttle. Debug your code until the throttle works as you like it.
step 5: connect the sensor side wires to the board. Debug your code until the whole system works as you like it.
 

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
post some pictures - you will make the project easier to follow.
1. of the connector controller side
2. your arduino board

step 1: connect the red (controller 5V) and black wire (controller ground) to the arduino Vcc and Ground pins. Make sure that the self test blinking routine works.

step 2: connect the controller PAS wire to a digital output pin and the controller torque wire to an analog output pin. Make sure that the self test blinking routine still works.

step 3: write and debug your code until you make the wheel spin.
step 4: connect the throttle. Debug your code until the throttle works as you like it.
step 5: connect the sensor side wires to the board. Debug your code until the whole system works as you like it.
This is brilliant, I should be ready with cables and photos by end of the week I'll take some pictures and post on here, some quick questions. The self blink test would I do this either with power to the Arduino with USB power or bike battery power? Or does it not matter for this test.
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
This is brilliant, I should be ready with cables and photos by end of the week I'll take some pictures and post on here, some quick questions. The self blink test would I do this either with power to the Arduino with USB power or bike battery power? Or does it not matter for this test.
it should blink when you turn on the LCD.
 
  • Like
Reactions: rajeshtailor

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
I have a query regarding these JST06R-JWPF-VSLE-D connectors, does anyone think it could cause problems if i changed them to Julet connectors (still running the same 4 cables), it just makes experimenting a lot more easier. I have made the connectors but I am not convinced that they are 100% perfect due to my lack of skills in crimping cables connections.

However I have done what i can with the connectors (without soldering as they are designed to be used without soldering). I'll share pictures of the connectors later.
 

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
Wanted to share some photos of work in progress

next steps is to carry out some soldering and then do blink tests. I’ll share the schematics once I’ve finalised.

1. The first photo is the connection of the existing PAS to the Controller.
2. Second photo shows the connectors I’ve assembled for a plug and play solution
3. The rest are photos of the Arduino Nano with wires connected but not soldered.

F28BFE8C-F549-41C7-9F05-9B546113BBE0.jpeg
A75E122D-875F-4797-BCD3-E4B74E48179B.jpeg53D7D060-977D-422D-9654-24D8D993B0FF.jpeg2C4EA728-54F2-48C5-BB00-B68E97A064E6.jpeg
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
what do you connect the 5V and VIN pins to?
 

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
I have connected the VIN pin to the Controller 5v and the 5v pins to the PAS+Throttle. Following the original schematics and your suggestion.
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
The throttle has 3 wires.
Where did you connect them to?

I would suggest you solder the throttle input, 5V, VIN and GND wires to the board.
Remove D4 and D7 and their counterparts (torque and cadence wires) - join them as they were before you unplug the connectors.
The bike should work like before, except this time you borrow the power to power the arduino board.
After checking the bike, you should be able to test the blinking LED.
Try to modify the code to make the LED blink frequency vary with the throttle input.
 

rajeshtailor

Pedelecer
Jun 5, 2020
170
3
Essentially what you’re suggesting is to pass the values of cadence and torque straight from the PAS directly to the Controller bypassing the Arduino board, right?

if I do this would that mean that I can’t pass a synthesised cadence pulse to the controller when using the throttle? Or are you thinking that may not be required?

I was going to do exactly what you’re suggesting but in the code basically take the input reading and pass it directly to the output pin straight to controller but I don’t know if the Arduino board will do anything strange with the values.
 

Woosh

Trade Member
May 19, 2012
20,228
16,820
Southend on Sea
wooshbikes.co.uk
Essentially what you’re suggesting is to pass the values of cadence and torque straight from the PAS directly to the Controller bypassing the Arduino board, right?
no, it's just one added precautionary step which I borrow from vfr's earlier post #105.
The extra initial step lets you write the code and test it while the bike still fully working.

if I do this would that mean that I can’t pass a synthesised cadence pulse to the controller when using the throttle? Or are you thinking that may not be required?

I was going to do exactly what you’re suggesting but in the code basically take the input reading and pass it directly to the output pin straight to controller but I don’t know if the Arduino board will do anything strange with the values.
we still stick to the original plan.

To recap:

Arduino PinControllerSensorThrottle
GNDblackblackblack
VINred
5Vredred
A1yellow?
A2yellow
A3green
A4yellow
A5green
LED pin 13


Connect only VIN, 5V, GND and throttle signal first (which colour is the signal wire on your throttle?).
Let's make sure that everything still works as it should.
Then write your code to make sure you can see and control the output before connecting the sensor's and controller's yellow and green.
 
  • Like
Reactions: rajeshtailor

Advertisers