That’s good news for my 3B+! Just curious, why would you not expect performance to be good on a 4?
I was comparing SQLite to Influx on the basis that SQLite does not require a server process to interact with the database, whereas Influx and other DBMSes do. I was just trying to suggest that Influx will have that much more overhead… however much that is, I don’t know, and it probably won’t matter too much.
I was admittedly over-optimistic about the Zero’s capabilities, while at the same time not understanding all the complexities I was facing as I opted to venture out on this project. I’m not opposed to buying a Pi4 for it, but I’ll try to stretch the 3B+ a lot further than I did with the Zero.
On another note, I believe I’ve resolved the source of the “noise”. Turns out it was a programming error!
I walked through my code step by step to see why the RMS current seemed to be calculated at a static value of 0.29A. I dumped the raw data from the ADC and took a look at it - my circuit’s “zero” (or “reference”) level is 511, and I was using 512 in my calculations. So, for a single poll cycle of 2000 data points, my sum_squared_current
variable was about 2000, leaving an RMS current value of sqrt(2000), times my current scaling factor and tuning correction, for a final, RMS current approximation of 0.29A. Now that I’ve corrected that, it is looking much better:
Real Power: 0.018 W | RMS Voltage: 121.878V | RMS Current: 0.011A | Apparent Power: 1.369 W | Power Factor: 0.013
Real Power: -0.022 W | RMS Voltage: 121.874V | RMS Current: 0.014A | Apparent Power: 1.767 W | Power Factor: -0.013
Real Power: -0.047 W | RMS Voltage: 121.914V | RMS Current: 0.013A | Apparent Power: 1.581 W | Power Factor: -0.03
Real Power: -0.016 W | RMS Voltage: 121.867V | RMS Current: 0.017A | Apparent Power: 2.091 W | Power Factor: -0.008
Real Power: 0.095 W | RMS Voltage: 121.854V | RMS Current: 0.018A | Apparent Power: 2.235 W | Power Factor: 0.043
The output above is from a CT sensor that is surrounding a non-energized conductor. I’m not sure why some real power values are negative, but I would guess it’s because I have a small uncorrected phase error between the voltage reading and the CT sensor in use.
I really appreciate everyone’s input, time, and dedication to helping me through this project so far. I’m almost there!
Next steps will be to wire up the other 3 CT sensors on the breadboard and connect them to the mains so I can start working on the software. Once I’m confident that my circuitry is solid and have some momentum with the backend programming I’ll transition the project to the prototype boards.