I measure 2 currents with 2 ACS712 boards.
ADS1115 converts the outputs of the ACS712 to I2C, I also measure the 5Volt line.
In a formula I have to subtract halve of the 5Volt from the ACS712 results to get the real values/currents.
The 5Volt line has some variation which has a effect on the results/accuracy.
If I could put the 5Volt in the formula I hope to get a more accurate result.
I try %value%-(0.5*5Volt) in the formula instead of %value%-2.5 but this does not work, I hope to solve this with a rule.
Unfortunately I do not understand rules good enough to solve this problem myself.
Can anyone help me a little bit on the way with a working rules example to subtract one variable from 2 other variables?
Can rules solve this ?
Moderators: grovkillen, Stuntteam, TD-er
Re: Can rules solve this ?
Including the word 'Volt' in the Formula field will cause issues, using the variable for your Voltage task should help:
NB: Better not name that task 5Volt, that'll be very confusing for the rules parser 
Code: Select all
%value%-(0.5*[Voltage#value])

/Ton (PayPal.me)
Re: Can rules solve this ?
That's a good start for improvement, as a proper power supply for your unit is also helpful in avoiding issues with WiFi connectivity.
This paragraph in the documentation seems like a good start (though that entire (huge) page is an interesting read when starting with rules)
/Ton (PayPal.me)
Re: Can rules solve this ?
Wonderfull, this simple line in the formula field solved it.
Re: Can rules solve this ?
I'm still working on that, the peak currents of the ESP8266 gives some tens of mV variation on the 5 Volt line.
I will try a big capacitor of 3300uF/10V and a microchoke in the power line to the ESP.
Probably that will suppress the influence of peak currents.
There are also some slow long time variations depending on temperature and the state of the 12V battery that is charged by a solar panel, from where the 5Volt is derived.
The formula that subtracts halve the 5Volt solves these variations for the greater part.
Re: Can rules solve this ?
Not sure if a large 3300 uF capacitor will help here.
It will more likely cause issues as it will draw a rather large current when powering on.
A discharged capacitor will act like a short circuit when initially connected to a voltage and a large capacitor will thus act like a short circuit for quite some time.
Also large capacitors cannot help filtering short-term noise signals.
For those you need a small capacitor like 100 nF, mounted as close as possible to the analog input pin.
It will more likely cause issues as it will draw a rather large current when powering on.
A discharged capacitor will act like a short circuit when initially connected to a voltage and a large capacitor will thus act like a short circuit for quite some time.
Also large capacitors cannot help filtering short-term noise signals.
For those you need a small capacitor like 100 nF, mounted as close as possible to the analog input pin.
Who is online
Users browsing this forum: No registered users and 18 guests