Upcycling industrial equipment offers a sustainable approach to reusing highly reliable components. Mobile network operators' cell tower equipment is built to operate 24/7 under harsh conditions, making it compact, efficient, and resilient.
This project focuses on the Huawei R4875G1 48V Rectifier Module, originally designed to power cell tower equipment and battery banks with dependable DC power. Essentially, this is a robust battery charger that can be adjusted between 45V and 58V, powered by an unstable grid or a dirty AC generator input. The R4875G1 module boasts a "Name Plate Output" of 4000W and an impressive Mean Time Between Failures (MTBF) of 500,000 hours. It supports current adjustments, dynamic control, and features hibernation and wake-up functions.
This module is 97% efficient, provides up to 4kW of DC power, and includes short circuit and surge protection, communicating via CAN BUS. These capabilities make it suitable for home battery charging, achieved through reverse-engineering its CAN BUS control.
The ESPHome firmware for this project is built for an ESP32 development board, which natively supports CAN BUS. The ESP32 connects to the R4875G1 via a VP230 CAN-BUS transceiver. Below are the main features:
- R4875G
- R4850G
- R4830G
1) tie CAN-H bus lines together
2) tie CAN-L lines together
3) parallel connect DC-output
- Power State ON/Hibernate/Error
- AC Power In
- DC Power Out
- Grid Frequency
- Input Current
- Output Current
- Input Grid Voltage
- Output Voltage
- Set Maximum Output Current
- Set Maximum Output Voltage
- Output Temperature
- CAN Voltage Set
- CAN Amp Set
- Fallback Amp Set
- Fallback Voltage Set
- Simple Daily Charge Timer
- CAN MAX AC Amp Set (coming soon: preview in latest release)
- LOW and HIGH Voltage Set for auto Wake/Hibernate
- CAN ON Button (Wake-up feature)
- CAN OFF Button (Hibernate feature)
- Fan Full Speed Button
- Fan Auto Mode Button
- Over-temperature Shutdown (Configurable in YAML, does not require Home Assistant or Node-RED)
- Daily kWh Energy Meter for AC input and DC output, monitors energy consumption
- Board-Type autodetect (Detects specific R48xxGx variety)
- Manufacturing Date autodetect
- Serial Number autodetect
- Scaling Factor auto-set
This setup is ideal for charging common 15s and 16s LiFePO4 packs and 14s NMC batteries, making it useful for home battery systems that store solar or off-peak power. It is particularly useful when backing up solar setups with a generator. Additionally, it can serve as a powerful DC bench power supply when paired with a robust adjustable buck/boost converter, as an onboard fast-charger for boats that encounter different supply voltages or as a rapid charger for Ebikes, here is a guy that runs his HAM radio amp equippment with it (clean DC indeed). And for those who want to play along at home, here is a guy that has an innovative approach to use four R4875G1s to create a double conversion system (he is basically planning to run his entire grid import through these rectifiers straight to his batteries, so as far as the grid is concerned he is just using a battery charger, very cool), removing the need for clunky high current relays (changeover switches, ATS), removing the worry about grid backfeed. His story is unfolding here.
For example, the EG4 Chargeverter product is essentially two of these 48V telecom units in a box, with buttons for setting maximum voltage and current. Watch the Chargeverter Teardown.
So, if you want to build an automation-friendly Chargeverter alternative, you are in the right place.
The Huawei R4875G1 power module is controlled as shown below. It can output 35A at 54V continuously at an ambient temperature of 23°C without additional cooling.
PCB edge connectors for the R4875G1 and R4875G5 series are available on AliExpress.
- ESP32 WROOM Development Board
- VP230 CAN-BUS transceiver Board (SN65HVD230)
- R4875G1/G5 Board Edge Connector
- DC Cables: 8 AWG silicone-insulated, supporting up to 40A continuously.
- AC Cables: Rated for continuous 16A supply.
- CAN BUS Connections: White (CAN-L) and Black (CAN-H)
To connect, ensure the TX pin from the ESP32 is connected to the transceiver's TX pin, and the RX pin is connected to the transceiver's RX pin.
Now, you have it all connected and can't wait to try? Go here set it up as in the quick start guide for the ready made .bin :)
For those not using the adapter board, the module can be manually turned on by shorting specific pads to DC-minus.
Connect the following pins together Pin1 to Pin5
Connect the following Pins to DC- (Pin1): 11,12
Connect the folowing pins together (this will allow the full 75A max output currrent to be set, see comment about CAN scaling factor below): Pin9 to Pin10
-
If Pin9 and Pin10 are not connected the CAN message for setting "Current" has a scaling factor of
* 20
and the R4875G can only be set to a maximum of 50A. -
If Pin9 is connected to Pin10 the CAN message for setting "Current" has a scaling factor of
* 15
and the 4875G can be stet to a max of 75A.
please adjust the scaling factor in the YAML code if you have not connected Pin9 to Pin10.
You can use the ESPHome plugin in Home Assistant to create a new device and paste the provided YAML configuration. If you prefer a standalone setup, you can configure the web server component for browser based control.
- MQTT: Uncomment the
mqtt:
block if using MQTT. - Home Assistant API: Uncomment the
api:
block for Home Assistant discovery. - Web Interface: Uncomment the
webserver:
block if a web interface is needed.
If you are looking to go BIG and add another R4875G1 or go three phase hooking several units to your CAN BUS allowing to set values for all units simultaneously and receive the sensor data separately.
Here is a YAML example to control two R4875G units on one can-bus
Here is a YAML example to control two R4850G units on one can-bus
Here is a YAML example to control two R4830G units on one can-bus
Here is the latests YAML example to control two R48xxGx units on one can-bus via MQTT (have to be of identical type) but this version has a single "SETUP" button for Board-Type autodetect.
And here you can find the web-app optimised version.
And here you can find a web-app version where you can drop-down select different R48xxGx models.
Pre-compiled .bin
files are available for direct upload to an ESP32 board if you do not wish to modify the YAML file:
latest release 0.9.5 with "ONE-Click" SETUP Button
https://web.esphome.io/?dashboard_wizard to upload the .bin
Total Off-Grid, Preppers, SHTF: This way to a version of the software to control Huawai R48xxGx that creates a Hotspot on the ESP32 to which you can directly connect with your phone and control the charger. No WiFi network, no Internet, no Home Assistant, all you need is your phone. This version works for all Huawai R4830G, R4850G and R4875G devices there is a SETUP button on the web-app that discovers the amp rating.
- Charger Power State ON/Hibernate
- State Topic:
can-bus01/binary_sensor/charger_power_state/state
- State Topic:
- Charger Power State2
- State Topic:
can-bus01/binary_sensor/charger_power_state2/state
- State Topic:
- Output Current alt
- State Topic:
can-bus01/sensor/output_current_alt/state
- State Topic:
- Output Current alt2
- State Topic:
can-bus01/sensor/output_current_alt2/state
- State Topic:
- AC Power In
- State Topic:
can-bus01/sensor/ac_power_in/state
- State Topic:
- DC Power Out
- State Topic:
can-bus01/sensor/dc_power_out/state
- State Topic:
- Grid Frequency
- State Topic:
can-bus01/sensor/grid_frequency/state
- State Topic:
- Input Current
- State Topic:
can-bus01/sensor/input_current/state
- State Topic:
- Output Voltage
- State Topic:
can-bus01/sensor/output_voltage/state
- State Topic:
- Input Grid Voltage
- State Topic:
can-bus01/sensor/input_grid_voltage/state
- State Topic:
- Output Temperature
- State Topic:
can-bus01/sensor/output_temperature/state
- State Topic:
- Output Current
- State Topic:
can-bus01/sensor/output_current/state
- State Topic:
- Set Max Output Current
- State Topic:
can-bus01/sensor/set_max_output_current/state
- State Topic:
- AC Power In2
- State Topic:
can-bus01/sensor/ac_power_in2/state
- State Topic:
- Combined AC Power
- State Topic:
can-bus01/sensor/combined_ac_power/state
- State Topic:
- DC Power Out2
- State Topic:
can-bus01/sensor/dc_power_out2/state
- State Topic:
- Combined DC Power
- State Topic:
can-bus01/sensor/combined_dc_power/state
- State Topic:
- AC Power In Total (kWh)
- State Topic:
can-bus01/sensor/ac_power_in_total__kwh_/state
- State Topic:
- DC Power Out Total (kWh)
- State Topic:
can-bus01/sensor/dc_power_out_total__kwh_/state
- State Topic:
- Grid Frequency2
- State Topic:
can-bus01/sensor/grid_frequency2/state
- State Topic:
- Input Current2
- State Topic:
can-bus01/sensor/input_current2/state
- State Topic:
- Output Voltage2
- State Topic:
can-bus01/sensor/output_voltage2/state
- State Topic:
- Input Grid Voltage2
- State Topic:
can-bus01/sensor/input_grid_voltage2/state
- State Topic:
- Output Temperature2
- State Topic:
can-bus01/sensor/output_temperature2/state
- State Topic:
- Output Current2
- State Topic:
can-bus01/sensor/output_current2/state
- State Topic:
- Set Max Output Current2
- State Topic:
can-bus01/sensor/set_max_output_current2/state
- State Topic:
- CAN Voltage Set
- State Topic:
can-bus01/number/can_voltage_set/state
- State Topic:
- CAN Amp Set
- State Topic:
can-bus01/number/can_amp_set/state
- State Topic:
- Fallback Amp Set
- State Topic:
can-bus01/number/fallback_amp_set/state
- State Topic:
- Fallback Voltage Set
- State Topic:
can-bus01/number/fallback_voltage_set/state
- State Topic:
How to use: send Text string: PRESS
to activate
- CAN ON Button
- State Topic: `can-bus01/button/can_on_button/state
- Command Topic:
can-bus01/button/can_on_button/command
- CAN OFF Button
- State Topic:
can-bus01/button/can_off_button/state
- Command Topic:
can-bus01/button/can_off_button/command
- State Topic:
- Fan Full Speed Button
- State Topic:
can-bus01/button/fan_full_speed_button/state
- Command Topic:
can-bus01/button/fan_full_speed_button/command
- State Topic:
How to use: The G4857G1 listens to the following MQTT topics. Publishing to these topics; integers (for AMP settings) or floating-point numbers (for Volt settings) will set the respective values.
-
Set MAX Voltage
- Description: Publish to this topic to SET MAX voltage. Expects number input.
- Topic:
home/canbus/voltage_set
-
Set MAX Amps
- Description: Publish to this topic to SET MAX current (amperage). Expects number input.
- Topic:
home/canbus/amp_set
-
Set MAX Fallback Voltage
- Description: Publish to this topic to SET MAX fallback voltage. Expects number input.
- Topic:
home/canbus/fallback_voltage_set
-
Set MAX Fallback Amps
- Description: Publish to this topic to SET MAX fallback amperage. Expects number input.
- Topic:
home/canbus/fallback_amp_set