DIY Smart Shunt 80V | 100A DC
by Steve Willson Kujur in Circuits > Arduino
1190 Views, 1 Favorites, 0 Comments
DIY Smart Shunt 80V | 100A DC
Hey everyone, my name is Steve! Today, I'm excited to share with you the detailed process of how I designed and built this advanced Power Meter using an ESP8266 microcontroller and an INA226 Current Sensor. This project has been a fascinating journey of innovation and problem-solving.
First off, let me tell you about the ESP8266. It's a powerful and versatile Wi-Fi-enabled microcontroller, perfect for IoT projects like this one. Coupled with the INA226 Current Sensor, we can accurately measure current ranging from 1mA all the way up to 100A, as well as monitor voltages up to 80VDC. The precision of these measurements is crucial, especially when dealing with sensitive systems or batteries like Lifepo4.
One of the highlights of this Power Meter is its ability to handle negative current measurements, making it suitable for a wide range of applications. By integrating this device with Home Assistant, I've enabled wireless monitoring and control, allowing seamless integration into smart home setups.
I developed the firmware for this project using ESPHome, a powerful framework for building custom firmware for ESP8266 and ESP32 devices. This framework provides an intuitive way to define the device's behavior and connectivity, making it ideal for IoT enthusiasts like myself.
This is actually the second iteration of my Power Meter project. The first version taught me a lot, and I've incorporated numerous improvements into this new design. From enhanced accuracy to better integration capabilities, there's always room for innovation and refinement.
In the future, I plan to explore additional enhancements such as data logging, real-time analytics, and possibly even predictive maintenance features. The possibilities with this project are truly exciting, and I'm thrilled to share my experiences and learnings with you all.
So stay tuned as I dive deep into the technical aspects and share insights on how you too can create your own sophisticated Power Meter using readily available components and a dash of creativity!
Features
Measurement
- 0-80VDC
- 0-100A
Built-in Features
- Wireless
- Extra Ports for Future Expandability
Images
Precesion Samples
I used my lab bench power supply to test it, and it appears highly accurate with minimal errors; furthermore, it can always be calibrated for precision.
Thing I've Used
Aliexpress
- Wemos D1 Mini - http://bit.ly/37x3Jie
- INA226 Current Sensor - http://bit.ly/3k2OUZO
- DHT11 - http://bit.ly/3k2OUZO
- 0.96 Inch Oled Display - http://bit.ly/3k2OUZO
- SMD Resistance - http://bit.ly/3k2OUZO
- SMD Capacitors - http://bit.ly/3k2OUZO
- Female Headers - http://bit.ly/3k2OUZO
- 100A Shunt - http://bit.ly/3k2OUZO
- Load Tester - http://bit.ly/3k2OUZO
- TS100 Soldering Iron - http://bit.ly/3k2OUZO
Amazon
- Wemos D1 Mini - http://bit.ly/3k2OUZO
- INA226 Current Sensor - http://bit.ly/3k2OUZO
- DHT11 - http://bit.ly/3k2OUZO
- 0.96 Inch Oled Display - http://bit.ly/3k2OUZO
- SMD Resistance - http://bit.ly/3k2OUZO
- SMD Capacitors - http://bit.ly/3k2OUZO
- Female Headers - http://bit.ly/3k2OUZO
- 100A Shunt - http://bit.ly/3k2OUZO
- Load Tester - http://bit.ly/3k2OUZO
- TS100 Soldering Iron - http://bit.ly/3k2OUZO
Making PCB
JLCPCB PCB+PCBA from $2, Sign up to Get $60 New User Coupons here: Link
I generally strive for professional results, which is why I use JLCPCB to bring my dreams to life. Speaking of JLCPCB, it's the world's largest PCB manufacturing company and consistently delivers fantastic outcomes. You can refer to the image above for an example.
Now, JLCPCB are offering
- $2 for 2Layer, 5pcs
- $5 for 4Layer, 5pcs
Gerber & Schematics - Download
Why ESPHome
I find Home Assistant invaluable for integrating ESPHome, which offers seamless wireless capabilities. Working with ESPHome is remarkably straightforward; its use of YAML for configuration ensures a user-friendly coding experience. This combination not only simplifies setup but also enhances the flexibility of my smart home system.
Code
substitutions:
devicename: 100a-pm
friendly_name: 100A PM
esphome:
name: ${devicename}
friendly_name: ${friendly_name}
esp8266:
board: esp12e
restore_from_flash: true
# Enable logging
logger:
# Enable Home Assistant API
api:
reboot_timeout: !secret reboot_timeout
# OTA
ota:
# Wifi
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
reboot_timeout: !secret reboot_timeout
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: ${friendly_name} Hotspot
password: "123456789"
captive_portal:
i2c:
sda: 4
scl: 5
# Restart
button:
- platform: restart
name: Restart
# Time
time:
- platform: sntp
id: my_time
sensor:
# Wifi Signal
- platform: wifi_signal
name: WiFi Signal
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 10
update_interval: 60s
# Uptime
- platform: uptime
name: Uptime
update_interval: 60s
- platform: integration
name: AH Data
id: ah
sensor: current
time_unit: h
restore: true
unit_of_measurement: Ah
integration_method: right
accuracy_decimals: 1
filters:
- lambda: return x -160;
disabled_by_default: true
# Getting AH
- platform: template
name: AH
unit_of_measurement: Ah
accuracy_decimals: 1
lambda: |-
return (id(ah).state * -1);
update_interval: 2s
on_value_range:
- above: 161
then:
- delay: 100s
- sensor.integration.reset: ah
# Getting Power
- platform: template
name: Power
unit_of_measurement: W
id: my_power
accuracy_decimals: 1
lambda: |-
return (id(voltage).state * id(current).state);
update_interval: 3s
- platform: ina226
address: 0x45
shunt_resistance: 0.7475 mohm
current:
name: Current
id: current
accuracy_decimals: 1
filters:
- sliding_window_moving_average:
window_size: 100
send_every: 100
bus_voltage:
name: Voltage
id: voltage
accuracy_decimals: 1
filters:
- multiply: 3.24375
- sliding_window_moving_average:
window_size: 100
send_every: 100
max_current: 100A
update_interval: 0.05s
After Gathering All the Parts
Cleaning
After soldering, it's very necessary to clean the flux residue for optimal circuit performance and longevity.
Programming
I used the CH340 chip to program the ESP8266 microcontroller.
Wire
I really like making this wiring harness because it allows me to showcase my precision and craftsmanship in assembling electrical connections.
Preparing
Note - Please see the images for better understanding