brake light wiring for cycle analyst with mosfet as a switch

codius

1 µW
Joined
May 28, 2018
Messages
4
ok, so after countless hours of searching, i have not found quite the right thread to assemble this without shorting the controller or cycle analyst.
in the diagram, i have an FQPF 2N60C npn mosfet.
im having a hard time understanding what the mosfet is going to do. i want to use it as a switch, (5v switches it on, and lets the 60v pass through)
there is only one ground on the mosfet. there is 2 grounds i can connect to.

can somebody shed some light on this wiring so i don't fry the cycle analyst, or the controller unit, or make the battery explode? thank you in advance.

if somebody can finish the drawing and repost it, that would be great
 
one other thing that i really want to point out here is that there is 2 separate grounds. one goes to the controller to complete the regen braking loop, the other goes to the battery.
 
Do you have access to any other mosfets? The 2N60C part you mentioned would not work well for this purpose unless your brake light uses very little power. The 2N60C is rated for 600V, much more than what's needed here. It's gate threshold voltage (voltage needed to turn it on) is 2-4V, sometimes 5V is not quite enough for fully turning on mosfets with gate thresholds like this. This mosfet also has an Rds (resistance between drain and source) of up to 4.7 ohms when it's on, so it will get hot depending on how much current your brake light uses.

Anyways here's my modification of your diagram:



I assumed that both grounds are the same since you show them both going into the cycle analyst. You could check this with a multimeter. I also added a 10k resistor between gate and source of the mosfet, to discharge the mosfet gate and turn it off when the brake switch goes off. This resistor value is not critical, you could use other similar values as well.
 
Since the tail light has a DC-DC converter and converts 60V down to LED voltage (presuming this is an LED type light), the current drawn at 60V is pretty low.

MOSFETs are static sensitive (especially the gate) and can be damaged by handling, proper techniques (for static dissipation) need to be followed when constructing the circuit.
 
Controller/CA ebrake inputs work by grounding the input (typically low active) which drags down a pull-up to 5V in the device. You may have the option of selecting high or low active but operating with the application of 5V is non-standard and generally unsupported. Some scooter controllers have +12V brake inputs to be compatible with 12V lighting.

The proposed circuit above relies on high-active application of 5V and will not operate properly.
 
thank you guys for the insight. i will try another mosfet. the 60 volts is very low power consumption, only 2 small leds. the mosfet currently works. the 5v power before the brake handle is pulled (strong enough current flowing before the loop is closed) but when i connect it to the negative side of the loop, it seems like the motor controller is taking all the juice. i'll find a 10k resistor too. thank you all again!

i also found this as an option, which would allow me to run both grounds in their own directions. ifa different mosfet does not work. im going to try it. https://www.amazon.com/KYOTO-ELECTRIC-KF0604D-Relay-Output/dp/B00B888YME/ref=pd_ybh_a_1?_encoding=UTF8&psc=1&refRID=GZTYWB8A1CPDKXS7N2BV
 
ok, new schematic is confirmed working so far. the led lights in the back are a bit dimm, but the regen braking works and the lights turn on when i pull the brake lever!
any input or suggestions would be appreciated!
 

Attachments

  • brake light 2.jpg
    brake light 2.jpg
    41.5 KB · Views: 1,775
Hi all,
This is my first post in this forum,
So first of all, thanks for all this collective cleverness.

Unfortunately I write for a trouble shooting.
On my new bike, I wanted to put a brake light.
So I was happy to find this topic.
I followed the last post scheme,
that was working but when I was braking, the cycle analyst was rebooting. Then I removed the connection to the reed relay, and the braking was recognised, but the screen was a little bit brighter while braking.
I never had a cycle analyst before, so I didn't knew if that was normal or not.
Then I activate regen option, and at the second or third use, the braking signal was not recognised any more by the cycle analyst.
The braking relay is working fine, and the cables too, so I guess the braking input of the cycle analyst is burned. :(

I write this post for saying to others that want to do the same: be more careful than I.
The next time I will not apply something that I don't understand.

The features I used :
- Brand new Cycle analyst 3.1
- braking relay : https://fr.aliexpress.com/item/32606950130.html?spm=a2g0s.9042311.0.0.27426c37D93kFr
- reed relay : https://www.gotronic.fr/pj2-06395-1490.pdf(5v / 1A)
- light : https://fr.aliexpress.com/item/32910135144.html?spm=a2g0s.9042311.0.0.27426c37vPRQjz

Enjoy the sun!
 
Without knowing exactly what your wiring had been, and voltage levels, etc, I can only guess what went wrong. Most likely your wiring put a higher voltage on the CA than the 5v max the ebrake input is designed for. Or if you had isolated grounds between your lighting power and the CA, something in the wiring allowed the ground signals to have a voltage difference on them that put extra voltage on the CA.

You can check the ebrake input on the CA by disconnecting it from anything else, and simply shorting the ebrake signal line to ground on the ebrake connector of the CA. If the little moving-brake-lever icon doesn't appear on the lower left corner of the main screen page, in place of the regular icon there, then it's not detecting that input.

If tha'ts the case, you can open the CA and do the same test on the ebrake pad on the CA board itself. If it works on that pad, then something is wrong in the cable from there to the ebrake connector, usually that's a broken wire right at the back of the connector shell itself.


For the next attempt, you might try this setup, which does not use any voltages on the CA at all, or others elsewhere in the thread.
https://endless-sphere.com/forums/viewtopic.php?f=2&t=75171&p=1562936&hilit=brake+l#p1563369

The 12v in that diagram is the lighting battery 12v (or dc-dc running off the traction pack). If you are using a different lighting voltage, then your relay needs to be designed for that voltage at the coil and contacts. Otherwise, a simple 12vdc (automotive) DPST relay works fine.
 
Thank you amberwolf for your fast and useful answer.

The wiring was the one showed in the last teklektik post.
The leds voltage is 12V.

A good news for me, I replaced the braking relay with an on/off switch and it's works like that.
The braking relay is working also but not recognised any more by the cycle analyst even if i plug it normally (between ebrake an ground).

I will follow your scheme, thanks for it.
 
David Gri said:
The wiring was the one showed in the last teklektik post.
The leds voltage is 12V.
If it is really wired like that, then there's no way it could've damaged the CA's brake input and nothing else, so the CA damage would have to be unrelated, most likely a broken wire or pin backed out of a connector. (too high a load on the 5v line could burn out hte 5v in the CA but that would leave the whole thing dead)

There's also nothing that should cause the CA to reboot. My guess without further info is that you either have *something* wired differently than that post shows, even if you intended it to be wired that way, *or* more likely you used a different relay that isn't internally wired the same way or most likely takes so much more power to turn on the coil that it drags the CA 5v down so far it can't operate anymore. (or you have so much load on the 5v line already that the relay just pushes it over the edge).

(that's one reason I did the circuit I posted the way I did--there is no load at all on the CA's 5v; it all comes from the lighting power so it can't affect the CA operation, *and* it isolates the CA from the lighting circuit completely).


A good news for me, I replaced the braking relay with an on/off switch and it's works like that.
I'm confused. You'd already said your relay setup was working, except for the CA. Are you saying the brake light now works with the switch, but didn't before? Or are you saying the CA brake input now works with the switch? And exactly where is the switch wired? So you need to be completely exactly specific about *what* "works like that" with the on/off switch that *didn't* "work like that" with the relay.


The braking relay is working also but not recognised any more by the cycle analyst even if i plug it normally (between ebrake an ground).

If you mean that the relay's NO contacts are no longer switching, you can test this with your multimeter. Red meter lead on one pin of the relay's NO contacts, black on the other. Set meter to continuity or 2ohms. Meter should read OL until you pull the brake lever. When you pull the brake lever meter should read a very low ohms reading (0.01-0.5), or beep.

As noted previously, you need to test the CA brake input by directly shorting the pins at the plug, and watching for the moving brake lever icon; see the previous post for details. If you have already done this you should state your *exact specific results*, along with *exactly what you did to do the test*, so we can further help you.

FWIW, if you dont' clearly post exactly what has been tested and how, and exactly what the results are, then it's difficult for people helping you to give the right help so you can fix your stuff, without a lot of guesswork. ;)
 
Hi amberwolf and thanks for your complete answer.
most likely takes so much more power to turn on the coil that it drags the CA 5v down so far it can't operate anymore.

I guess it is one part of the issue, the relay need 50mW to work.
But when I test without the relay, so plugged like that :
Capture-du-2020-07-04-07-06-31.png

then the CA screen was brighter while braking.
I checked the wiring, that was the same than in the picture (I'm not electrician, but electro-technician )

A good news for me, I replaced the braking relay with an on/off switch and it's works like that.

I'm confused. You'd already said your relay setup was working, except for the CA. Are you saying the brake light now works with the switch, but didn't before? Or are you saying the CA brake input now works with the switch? And exactly where is the switch wired? So you need to be completely exactly specific about *what* "works like that" with the on/off switch that *didn't* "work like that" with the relay.

Sorry, my English is poor so I make short sentences that takes me a lot of time to write.
I'll do my best to me more precise.
I removed everything, then I plugged an on/off switch between the EBK and Gnd of the cycle analyst, and cycle analyst is working fine like that.
I did it before with only the braking relay (that was working*, and also plugged between the EBK and Gnd) but the cycle analyst didn't recognised it, so I thought the cycle analyst was dead.
* when it is open, the impedance is 0 Ohm, when it is close, the impedance is 13K Ohm

Anyway, I don't use this wiring any more, I'll use this setup when I will find time to do it : viewtopic.php?f=2&t=75171&p=1562936&hil ... l#p1563369

Thanks for the help,
I don't need it any more.
Have a nice day
 
I'm glad you've got it working as you need it to.

The below reply is just for reference for future readers:

David Gri said:
I guess it is one part of the issue, the relay need 50mW to work.
But when I test without the relay, so plugged like that :
Capture-du-2020-07-04-07-06-31.png

then the CA screen was brighter while braking.
I checked the wiring, that was the same than in the picture (I'm not electrician, but electro-technician )
If you have regen braking, then the screen would be brighter as the motor slightly increases teh voltage on the CA until the motor slows enough to not be able to increase the voltage.

If you either don't have regen, or the brightness change happens even at a stop just engaging the lever, I don't know why it would happen with only the standard brake switch connection to the CA brake signal and ground wires.

One possible case that using just the brake lever switch on the CA input *could* cause a brightening of the screen, is if it is accidentally connected across the 5v and ground instead of the ebrake input and ground, as it would short out the 5v, causing the screen to brighten momentarily form the higher current draw, but the CA would blank the screen during brake lever pull, and reboot after you let go. :( So that's probably not what is happening.





I removed everything, then I plugged an on/off switch between the EBK and Gnd of the cycle analyst, and cycle analyst is working fine like that.
Ah. Then that's normal. :)


I did it before with only the braking relay (that was working*, and also plugged between the EBK and Gnd) but the cycle analyst didn't recognised it, so I thought the cycle analyst was dead.
* when it is open, the impedance is 0 Ohm, when it is close, the impedance is 13K Ohm
If by "when it is open" you mean when the relay is off, (brake lever not pulled), then getting zero ohms on that means it's the opposite kind of relay you need, or the wrong set of contacts is being used. To get 0 ohms when relay is off, it would have to be the NC (normally closed) set of contacts, but what you need to use for your system is the NO (Normally Open) set of contacts.

The NC relay is shorted (zero ohms) when off, and high or infinite resistance when on.

The NO relay is high / infinite wehn off, and zero when on. (this is what you want).


Alternately, if what you actualy saw on the meter screen was "OL", that means "overload" or "overlimit", and means the resistance is higher than that range can show you (typically "infinite" or open-circuit, for autoranging meters).

If this is the case, then what you have *is* a NO relay, like you want, but the 13kohm in closed mode is too high, and indicates either damaged contacts, or insufficient current in the relay coil to fully pull it closed.
 
I just wired up a brake light exactly as teklektik posted with the Kyoto relay and I'm getting the brighter screen issue mentioned by David Gri as well. Everything does function as expected - brake light works and the braking icon shows on CA (tested while bike is stationary).

It's drawing .12mA with the normal EBRK to Ground connection and 2.68 mA when wired through the relay. If I touch just the 5v to ground it reboots the CA, so I guess the relay is adding some resistance to the 5v so it's not completely shorting out, but just enough to make the screen brighter? Should I try adding a resistor to the 5v or is anything over .12mA potentially bad? Maybe another place to ground to?

I suppose I could go with another method entirely - just seems like this is so close to working. :(
 
DoTheEyeThing said:
I just wired up a brake light exactly as teklektik posted with the Kyoto relay and I'm getting the brighter screen issue mentioned by David Gri as well. Everything does function as expected - brake light works and the braking icon shows on CA (tested while bike is stationary).

Why would you want to involve the Cycle Analyst with your brake light circuit? All you need is a switch on the lever and perhaps a relay for the light. You don't need to mess with the CA for that.
 
Chalo said:
Why would you want to involve the Cycle Analyst with your brake light circuit? All you need is a switch on the lever and perhaps a relay for the light. You don't need to mess with the CA for that.

That's what I'm going for. Relay to use the CA's full voltage DC plug to power the light (which is working) and I thought I could use the existing brake switch that is already working with the CA to trigger the relay. That brake loop is 5v but doesn't have enough current to trigger this particular relay, so I tried sourcing from the extra 5v wire available at the same brake plug. It does trigger the relay now, but it's brightening the CA screen...which I imagine might burn something out eventually.

Perhaps there's a better source / ground for the 5v I could setup with a separate brake switch?

I'm using the Baserunner L10 for my controller - not sure if that will help.
 
Well, you could use a stick-on brake switch to trigger a brake light relay that is totally separate from the CA.
 
For the front brake lever, I do use a microswitch on the caliper, because it's an Avid speeddial lever that has no built in switch and it was easy to do this:
https://www.endless-sphere.com/forums/viewtopic.php?f=2&t=67833&start=1025#p1617659

For the rear brake lever, I am not using it for mechanical brakes, so it is a cheap ebike ebrake lever with built in NO switch.

Both of the switches on these levers are paralleled, and in this setup, I use two relays (three, actually, but the third is for switching proportional regen stuff). So in my case:

The ebrake switch doesn't connect to the CA at all. Instead, it provides the ground for the 12v (that runs the lights too) that powers the relay coils (12v type), which are both paralleled, with a small diode in reverse across each coil.

The first relay uses it's NO contacts to connect across the CA's ebrake input.

The second relay uses it's NO contacts to ground the brake lights (which have 12v power to them).

So when I pull the lever, the switch turns on both relays, and then the two relays connect their respective stuff, and the CA is isolated (except for ground) from the whole relay system.

A single relay can be used for the purpose if it is DPST-NO or DPDT, and each separate pole is used for one of the two functions.

See this post, already previously discussed in this thread:
https://endless-sphere.com/forums/viewtopic.php?f=2&t=75171&p=1562936&hilit=brake+l#p1563369
which includes a wiring diagram.
 
Thank you for the replies!

I followed a bit more of your thread amberwolf and found the bit about AC to DC power adapters capable of working with DC, so I used that to get the voltage/amperage down enough for the ebrake sensor and relay to handle it.

Here's what it looks like - working great!
BrakeLightWiring.jpg

Thanks for the help!
 
Thank you for the replies!

I followed a bit more of your thread amberwolf and found the bit about AC to DC power adapters capable of working with DC, so I used that to get the voltage/amperage down enough for the ebrake sensor and relay to handle it.

Here's what it looks like - working great!
View attachment 291338

Thanks for the help!
Do you have a link to where you bought that 5v ac-dc power adapter? Thanks!
 
View attachment 238967


OR - Lower current (2A) rating - less expensive
Kyoto Electric KF0602D DC-to-DC Solid State Relay, 32 Volt, DC Input, 2 Amp

Input current rating is a bit high (15ma). Check with DMM and verify the total CA accessory current. If it exceeds the limit called out in the Guide, you may want to steal the +5V from the controller Throttle connector instead of using the CA +5V supply.
This schematic has worked now twice for me when setting up a relay for my ebrake high beam mode. Heck, this relay is still around and super cheap at that.

The only "gotcha" with this configuration is that it seems to brighten the screen of the CA a bit when the brakes are active. Doesn't seem to have any major lasting effects I've been able to notice so far, though, so I'm happy with the setup.
 
The note about current in the part you quoted tells you why it's happening.

If you pull the current from the controller 5v instead of CA 5v, it'll probably fix the issue, since you won't be loading down the CA's regulator (which gets all it's current thru the display LED).
 
Back
Top