Voltage monitor with ESP8266

Everything about esp8266 and more.

Moderator: leecollings

Post Reply
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Voltage monitor with ESP8266

Post by MartHale »

Using a voltage divider I was able to make a voltage monitor with the ESP8266, with ADS1115.

The Outback charge controller was a real pain to give me the voltage in any form that I could use with Domoticz, but now I have a complete status even on my cell phone. I love this program, combined with Espeasy.!!!!
Attachments
chart.png
chart.png (89.78 KiB) Viewed 3352 times
Volt metter 24 v.png
Volt metter 24 v.png (62.16 KiB) Viewed 3352 times
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Re: Voltage monitor with ESP8266

Post by MartHale »

The only issue I get is I get an value of -65 V on like a random basis. I am guessing this is cause by flyback voltage to the battery, but I am not sure how to filter that out, but I can manually remove the data points with the shift click on the graft. I love searching these forums :-)
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Voltage monitor with ESP8266

Post by sincze »

Nice one :lol:

A solution to your problem would be to store the values first in a dummy esp device. (not sending them to domoticz directly) Using rules to see if it has a 'valid' number and then post to domoticz. :D
https://www.letscontrolit.com/wiki/inde ... rial_Rules
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Re: Voltage monitor with ESP8266

Post by MartHale »

I like that solution, I like that alot!

Rules on the ESP8266 board, would filter any bad data before it would be recorded and thus there would be no problem data, only missing gaps.

I guess the next trick is to switch to the ESP32 so that I can use the sleep mode to save power so I can run this on batteries. Ideally, I would like sensors that are powered by an lithium battery which in turn are charged by a solar panel.
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Voltage monitor with ESP8266

Post by sincze »

Just let me know if you need help :)

I know it works.

Next to data validation I now only send data if the data itself was changed since the last reading. And use timers as well. To look at the data every X seconds.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Re: Voltage monitor with ESP8266

Post by MartHale »

So I guess what you do is disable "enabled" on the device, then create a loop with timers so that it reads the data compares with last then sends via rules.

I took a quick look at rules, but I did not see where they detailed how to send the data to domoticzs.....


If you have a link to an example that would be cool
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Voltage monitor with ESP8266

Post by sincze »

MartHale wrote: Monday 06 August 2018 21:02 So I guess what you do is disable "enabled" on the device, then create a loop with timers so that it reads the data compares with last then sends via rules.

I took a quick look at rules, but I did not see where they detailed how to send the data to domoticzs.....


If you have a link to an example that would be cool
Leave the device enabled but disable only the 'send to controller' check box, where the IDX is filled.
To send data from rules you can use

Code: Select all

SendToHTTP 192.168.1.111,8080,/json.htm?type=command&param=udevice&idx=<IDXHERE>&nvalue=0&svalue=<YOUR VALUE>
Start your rules with:

Code: Select all

On System#Boot do
   TimerSet,1,30 
EndOn
This will create a timer that will go off every 30 seconds! Don't forget to enable NTP as well!
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Re: Voltage monitor with ESP8266

Post by MartHale »

Hi, I thought I would post an update, I was able to get rid of the voltage spikes by adding a capacitor to the center of the voltage divider and putting the other leg to the ground of the esp8266 board!. that problem is now all gone.


I love it when a problem is that simple to get rid of and gets rid of any other code I need to do. Yipee!


:D :D :D :D :D :D :D :D
User avatar
sincze
Posts: 1302
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Voltage monitor with ESP8266

Post by sincze »

MartHale wrote: Thursday 04 October 2018 0:47 Hi, I thought I would post an update, I was able to get rid of the voltage spikes by adding a capacitor to the center of the voltage divider and putting the other leg to the ground of the esp8266 board!. that problem is now all gone.


I love it when a problem is that simple to get rid of and gets rid of any other code I need to do. Yipee!


:D :D :D :D :D :D :D :D
Exellent, but still a question :lol:
We love pictures of succesful and less succesful projects for inspiration. :)
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Re: Voltage monitor with ESP8266

Post by MartHale »

https://www.youtube.com/watch?v=WytU5uj ... 6w&index=2

I have been trying to understand capacitors magic in circuits, this video was most eye opening..
MartHale
Posts: 21
Joined: Monday 22 May 2017 15:50
Target OS: Windows
Domoticz version:
Contact:

Re: Voltage monitor with ESP8266

Post by MartHale »

I did make a video of the progress so far ->

https://www.youtube.com/watch?v=rpFmTUszNPI
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest