Help please with smart power supply design.

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
Hello from a wintry Scotland!

I recently bought myself an e-bike which came with a 'smart' charger for its 750mAh li-ion 36v battery. As far as I can tell, the limit of its smartness is that it cuts off power once the battery reaches 100% capacity. Very good, but could be smarter! The project I am trying to build is a sensor and relay combination that will cut power to the battery automatically once it reaches a healthy 80%, or any other selectable level, 60% for storage for example. I think the charger works on the constant current variable voltage principle, so starts off at around 38v and gradually rises to about 42v. It's easy enough therefore to find what equates to 60 or 80%.

The charger, a Bosch BPC3400, has 2 outputs; a 5v feed to a relay to sense the presence of a suitable battery and the nominal 36v charge feed. I left the 5v feed alone but wired in a 6-60V DC Battery Control Module (XH-M604) to the 36v feed. Setting the upper limit to the desired voltage cuts power to the battery. It works! However,....

As soon as power is removed from the battery it shuts down which in turn shuts down the charger. The voltage drops below the minimum threshold for the control module which then reapplies power and the charger starts the cycle again. Not what I want. My ideal scenario is the charger charges to the desired setting then permanently cuts off.

My attempt at a solution to this involves adding a 12-36V DC Battery Low Voltage Disconnect Module (XH-M609) wired into a clever latching relay circuit. Btw, as you might have gathered, none of this is my invention; I have learned all this from various forums and videos, and adding the two modules together is the only step out on my own. The idea is that pressing the momentary switch will provide power to close the relay which then stays closed while power is available. My hope was that the power supply running down would trigger the low voltage disconnect module and remove power to the control module until such time as I pressed the button again. It doesn't work. Thinking the battery was powering the low voltage disconnect module I tried adding a Schottky diode to the positive feed to the battery, but this did not work either.

I'm out of ideas! Can anyone help please? Many thanks!

Chris

Images show the 2 modules with suggested wiring, the 'latching relay' circuit and an image of my project (with diode removed)
XH M604 Battery Charger Control Module.jpegXH-M609.jpglatching relay.jpgSmart Project-min.jpg
 

sghioto

Joined Dec 31, 2017
8,633
I'm out of ideas! Can anyone help please? Many thanks!
If I'm following this correctly I believe the below setup will work with the addition of RL1
Initially the charger has no AC power and the +input to the XH-M604 Charge Control Module is disconnected via the open relay contact from RL1.
When Start Button Sw1 is pressed RL1 is activated connecting the XH-M604 to the +battery/charger output.
This starts the charge cycle energizing the S1 switch in the module which latches RL1.
When the charge has reached the desired cutoff voltage S1 and RL1 will drop out disconnecting AC power to the charger and battery voltage to the XH-M604. The XH-M604 will retain settings when power is disconnected.
RL1 Relay
1768015784646.png
 
Last edited:

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
Thank you, sghioto. Unfortunately, I now realise that the diagram I used to show the wiring of the XH-M604 module is incorrect; there is no Vin connector (bottom right) at least not on my version. I am also reluctant with my level of skill to start messing with 240 volts.
Can you tell me please which software/app you used to draw your schematic? I'll try to do the same with the actual wiring I have as that should make the whole thing a lot more clear.
 

sghioto

Joined Dec 31, 2017
8,633
Can you tell me please which software/app you used to draw your schematic?
Windows Paint.
Could try this setup.
Initially the battery is disconnected from the charger and the XH-M604.
When the Push to Start button is pressed and the battery voltage is below the Start setting S1 closes and activates RL1.
This applies power from the charger to the battery via contact RL1A and latches RL1 coil through contact RL1B while maintaining the battery connection to the XH-M604.
When the battery voltage reaches the Stop setting S1 opens, RL1 drops out and battery is once again disconnected.
1768065777454.png
 
Last edited:

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
Relay has finally arrived, wired up, checked, re-checked and powered on. Nothing.

My last attempt at an input to get this fixed before I give up completely is this:

When I bypass my attempt and connect the power supply direct to the battery there is a relay click inside the power supply. I'm assuming that's where the 5v feed comes in, checking that it is the correct battery connected. But there must be more to it. Could it be that the power supply itself needs 36v from the battery in order to switch itself on and supply power to the battery? A means of not putting a charging voltage into a dangerously run down battery? If that's the case a complete rethink is required as currently the relay being open prevents any current returning to the power supply.

Again, any help unlocking this would be hugely appreciated!
 

sghioto

Joined Dec 31, 2017
8,633
If wired correctly the DPDT relay should energize when the Start button is pressed and the XH-M604 should power ON, is this happening?
Need to see how you have it wired.
Post actual photos of the complete setup as seen in post #4 please.
Link to this DPDT relay you ordered.
What does the voltage read on the battery when not connected to anything?
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,164
Questions: Have you verified that the battery is actually a good battery, capable of accepting a charge. 25 volts is not the charging voltage of a 36 volt battery. AND that seems like a small battery capacity for an E-BIKE.
 

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
Hi MisterBill2,
Many thanks for your questions.
Yes, the battery is only a few months old and happily takes a charge when my circuit is bypassed. I'm not sure where you're seeing a reference to 25v; it is a 36v battery receiving a nominal 36v output from the charger.
 

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
If wired correctly the DPDT relay should energize when the Start button is pressed and the XH-M604 should power ON, is this happening?
Need to see how you have it wired.
Post actual photos of the complete setup as seen in post #4 please.
Link to this DPDT relay you ordered.
What does the voltage read on the battery when not connected to anything?
I think the problem here is that we are not dealing with a simple battery and simple power supply. If that were the case you would be able to directly measure the output voltage of the power supply when powered on, even if disconnected from a battery, and likewise be able to measure the battery voltage even when not connected to a power supply. Neither is the case here; they are both Bosch ‘smart’ devices. The power supply has a relay built in which, it appears, only supplies power when the battery confirms that it is in a suitable condition for charging. The battery itself also disconnects itself such that when connected to the charger without the charger being plugged in to a mains supply, there is zero voltage.

So this circuit is not going to work as it is because the battery is not connected to the power supply to start the ball rolling. Maybe a second momentary switch could connect the battery to the power supply just to get it all started, then the second switch to close the relay contacts? Or a diode to provide a one-way route from battery to power supply?

The DPDT relay is 36v DC ‘LY2NJ’ from AliExpress.
DPDT relay attempt.jpgLY2NJ.jpg
 

MrChips

Joined Oct 2, 2009
34,628
Just a comment after reading your introductory post.
I recently bought myself an e-bike which came with a 'smart' charger for its 750mAh li-ion 36v battery.
750 mAh makes no sense for an e-bike. Are you sure that you are not missing a extra zero?
 

sghioto

Joined Dec 31, 2017
8,633
You had the relay coil and the battery hookup in reverse.
The relay coil connects to the "IN" terminals.
Follow the numbers I show for the relay coil and contacts
1769355079399.png
1769355316266.png
 

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
Well spotted! Errors corrected. Still no action from the relay. I have tested it with a bench power supply and the contacts close at 31v, which is as high as my supply goes. With this corrected configuration the module displays the battery voltage when I press the button, but with no relay to hold it on it just goes blank again as soon as I release it. No relay clicks from the power supply or LY2NJ.

PXL_20260125_160939476.jpgPXL_20260125_160741387.jpgPXL_20260125_160830202.jpg
 

sghioto

Joined Dec 31, 2017
8,633
With this corrected configuration the module displays the battery voltage when I press the button, but with no relay to hold it on it just goes blank again as soon as I release it. No relay clicks from the power supply or LY2NJ.
That's telling me that the battery voltage is above the START setting on the XH-M604, therefore the relay in the XH-M604 will not activate to then activate the DPDT relay.
What are the START and STOP settings?
1769365507896.png
 
Last edited:

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
It's not an XH-M604; it's an HCW-M634 (battery charger control module). The start charging voltage is set to 36v and the stop charging voltage is set to 40v.
The two cables are the power supply cables taken from downstream of the transformer and control relay and fed into the charger control module circuit and then out back to the power supply output plug for the battery.Image Resizer-Photo Compressor_0370058d-5da8-4174-bbe0-e3cc15d93ad4.jpegImage Resizer-Photo Compressor_dcfdf59e-beda-46d8-8e33-c267c05f1357.jpeg
 

sghioto

Joined Dec 31, 2017
8,633
It's not an XH-M604; it's an HCW-M634 (battery charger control module).
I have a XH-M604 and they look identical along with the connections and operation.
That black box is the BCP3400 charger with the two outputs you mentioned in post #1?
I looked at the manual for the BCP3400 and I don't see those two cables coming out that you show, did you hack into the charger?
I see only one cable out with a 4 pin plug that plugs into the receptacle on the battery.
1769442319576.png
 
Last edited:

Thread Starter

Chris Williams

Joined Jan 9, 2026
21
Apologies - I thought we had crossed wires there (appropriate metaphor!), but both XH-M604 and HCW-M634 appear to be the same thing.
Yes, I unscrewed the 4 screws, desoldered the 36V output cables and rerouted them via a small hole in the case, as shown in my pics. If I fit the 2 connectors to each other I get back to the original charger, so no loss if this project fails.
 
Top