Hi mate,
Yes, I’m running latest code (I guess… Lol)
At the moment, there’s no need to add a calibration setting, I’m just playing around with the sensor, nothing interesting (at the moment…)
You won’t be able to just use it as it is because it is designed for the INA219 I2C sensor.
You will need to strip out all the INA219 code and replace it with the code for hte sesnor you settle on. You may need to look at a non-invasive current sensor. The clamp/ring type and look up the code needed to run it, then you can insert that code in place of the INA219 code.
Dear @Jamin,
first of all I would like to send you a BIG thanks for your fine project that you shared with us.
I have a question, something that I can not understand in your code / sketch. The following is a copy - paste from your code and I can not understand it. What are you doing with these? As far as I understood, these are running only once, Am I right? Please at your convenience, explain it to me,
Thanks and Best Regards,
Mike Kranidis
// gather voltage averages
loadvoltage_AVG[loadvoltage_AVG_cycle] = loadvoltage;
loadvoltage_AVG_cycle++;
if (loadvoltage_AVG_cycle == AVG_DEPTH_VOLTAGE) loadvoltage_AVG_cycle = 0;
// gather current averages
current_AVG[current_AVG_cycle] = current_mA;
current_AVG_cycle++;
if (current_AVG_cycle == AVG_DEPTH_CURRENT) current_AVG_cycle = 0;
// gather power averages
power_AVG[power_AVG_cycle] = power;
power_AVG_cycle++;
if (power_AVG_cycle == AVG_DEPTH_POWER) power_AVG_cycle = 0;
}
Hey that function runs every second. So it’s taking the current value (for each loadvoltage, current and power) and adds it to an array. Then each new second when it runs, it cycles through the array slots until its full then goes back to the start.
Then you can take the total of the array value, add it up and divide it by the number of values in the array to get the average value.
Dear @Jamin
what comprise the function? Sorry to bother you further but is the bellow function? And how do you call it each seconds ? I can not understand …
// gather voltage averages
loadvoltage_AVG[loadvoltage_AVG_cycle] = loadvoltage;
loadvoltage_AVG_cycle++;
if (loadvoltage_AVG_cycle == AVG_DEPTH_VOLTAGE) loadvoltage_AVG_cycle = 0;
P.S. I am not programmer… If it is hardware then no problem!
Hey, I keep getting “32.764V” at idle if nothing is connected. Has this happened to you? The voltage should be zero. It’s always that same 32.764 voltage though. I’ve tried a few different Wemos D1 mini boards as well as a few different ina219s.