Page 1 of 1

Voltage monitor with ESP8266

Posted: Thursday 02 August 2018 20:51
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.!!!!

Re: Voltage monitor with ESP8266

Posted: Thursday 02 August 2018 20:53
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 :-)

Re: Voltage monitor with ESP8266

Posted: Sunday 05 August 2018 11:32
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

Re: Voltage monitor with ESP8266

Posted: Sunday 05 August 2018 20:34
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.

Re: Voltage monitor with ESP8266

Posted: Sunday 05 August 2018 21:57
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.

Re: Voltage monitor with ESP8266

Posted: Monday 06 August 2018 21:02
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

Re: Voltage monitor with ESP8266

Posted: Monday 06 August 2018 21:09
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!

Re: Voltage monitor with ESP8266

Posted: Thursday 04 October 2018 0:47
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

Re: Voltage monitor with ESP8266

Posted: Friday 05 October 2018 15:51
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. :)

Re: Voltage monitor with ESP8266

Posted: Sunday 07 October 2018 14:33
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..

Re: Voltage monitor with ESP8266

Posted: Sunday 07 October 2018 20:42
by MartHale
I did make a video of the progress so far ->

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