AC voltage and calibration - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-M16 / M1 / MB / M30 (https://www.kincony.com/forum/forumdisplay.php?fid=50) +--- Thread: AC voltage and calibration (/showthread.php?tid=3764) |
RE: AC voltage and calibration - nickdd - 01-21-2024 (01-07-2024, 11:10 AM)admin Wrote: thanks for sharing your result. maybe you can also post this problem to ESPHome forum. Some feedback. I was able to solve my "low SPS" problem as described above, by doing the following: - set update interval to never for all sensors - use interval and loop through sensors and add delay manually This fixes the issue that it switches inputs on the multiplexer in an uncontrolled matter. Code: interval: => I update my values every 10 seconds, in sequence. I also have better results when using calibrate_linear with method "exact" instead of the default least_squares. Used a bunch of devices and combinations with power factor 1 (resistive loads) for callibration. sample duration of 500ms works well for me. Code: - platform: ct_clamp Did this for all 16 clamps by putting them all on the same wire when doing the measurements. It's much less jumpy then before. Still struggle to really measure low power, but that must be because of the overall accuracy. RE: AC voltage and calibration - admin - 01-22-2024 thanks for share the result. RE: AC voltage and calibration - hamilton - 02-04-2024 Thanks for the good idea posted above, nickdd. I took that concept and wrote the nodejs code below to generate the sensor section of my yaml, it is working pretty well for me. This code generates the sensor and interval yaml blocks, I combine it with the base example provided by Kincony for the rest of the yaml. Code: const fs = require('fs'); My ct20.yaml contains this: Code: - clamp: RE: AC voltage and calibration - sanurss - 02-15-2024 @nickdd I've set below values on `ct_clamp` sensors but I still get a lot of switches. My current setup is 10 clamp sensors. Code: sample_duration: 500ms What about AI sensors (cd74hc4067)? What value do you have there? Code: update_interval: 5s Why such delay in interval section? Does it have something to do with sum of all delays and sampling duration vs 10s interval? Code: - delay: 625ms Can you share some more how you configured in YAML? RE: AC voltage and calibration - nickdd - 02-15-2024 (02-15-2024, 04:20 PM)sanurss Wrote: @nickdd Didn't have time yet to add the Watt calculations and since it doesn't offer the power factor I need to rethink what circuits I actually want to monitor. Maybe I was a bit too quick to order and didn't know the M30 board was coming which would have been more suitable for what I wanted to do: measure house usage on different circuits, but since a lot of things are electronic devices like computers, tv's, ... the M16v2 only offers current measurement and so unable to calculate the real power/wattage usage like this. Regards, Nick RE: AC voltage and calibration - sanurss - 02-16-2024 @nickdd Thanks for sharing you config! I think I will manage without Power Factor because I'm only charged for the real power, not apparent power, so real power is my main concern currently. But I first need to get it fully configured to confirm Do you maybe know if updating current will trigger update of dependent cd74hc4067? It seems to do so... Code: id(current_4).update(); @admin In your source code there's some part which I don't understand. Can you explain what does the "adc35"? Can I safely remove the "m16--AI-1" - seems to be leftover from M16 v1? Code: - platform: adc And one more question: does it matter what maximum current I will use to calibrate the clamp? Let's say I have a water pump using 0.15 A and a 10A clamp (the smallest I could get). Should I calibrate up to 5-10A or just to 1-2 A will be ok? RE: AC voltage and calibration - admin - 02-16-2024 1. you can't remove ADC35, because we use this pin expand for 16CH input. ESP32 GPIO35 use for 74HC4067 chip. actually only cost ESP32 1 GPIO. 2. i think you can try to calibrate 5-10A firstly, then you can test with 0.15A. RE: AC voltage and calibration - nickdd - 02-16-2024 Same here: only charged for real power, but CT clamps measure apparent power so you do need a power factor correction to be able to define the real power usage. for the calibration: I did many attempts and had the best results with changing the callibration method to "exact" https://esphome.io/components/sensor/#sensor-filter-calibrate-linear With only a few callibration points for like 2A and 5A I found that the readings where too far off with smaller loads like a light bulb. I think it may have to do with the attenuation setting of the ADC. So I just gathered all resistive capacity loads I could get my hand on: 20W, 40W, 55W and 100W light bulbs. A hair dryer, some old electric heater and then combinations of those. Did all the testing at once by putting all 16 CT's on 1 wire and took note of all the values for each test and put them in. After adding the calibration values in the yaml, I retested with those loads to see if the readings were ok. only with "exact" I had quite ok values, not with the default setting. RE: AC voltage and calibration - sanurss - 02-16-2024 Quote:CT clamps measure apparent power I hope I get the power factor rather stable for the loads I want to measure, but we'll see. Quote:With only a few callibration points for like 2A and 5A I found that the readings where too far off with smaller loads like a light bulb. That's what I was afraid to see. Good to know I need to find smaller resistive loads as well. My current lowest is around 0.65A but some loads I want to measure get down to 0.1A. Quote:Did all the testing at once by putting all 16 CT's on 1 wire and took note of all the values for each test and put them in. Wouldn't it be better to measure on actual wires in the walls? I believe the readings may be influenced by plenty of wires around in my fuse box. RE: AC voltage and calibration - nickdd - 02-16-2024 [quote pid="11787" dateline="1708112777"] Quote:I hope I get the power factor rather stable for the loads I want to measure, but we'll see. Was also my plan: will use an accurate socket power meter and read the power factor and then use this as a static value to calculate the power. Could work for always-on devices or devices with stable power factor. But there are also quite a few devices for which the power factor varies greatly, especially when they are in standby or some low/medium/high mode (like my ventilation unit - or my oven in standby vs in use because of the electronics/digital clock). My led drivers are also a pain to measure. Maybe I can take multiple measurements depending on the state and then apply some if-then-else logic for the calculation in esphome or home assistant. I should give up on trying to be watt-accurate, after all I would be happy to be able to get a good overview of the distribution of my energy usage throughout the house. Quote:That's what I was afraid to see. Good to know I need to find smaller resistive loads as well. My current lowest is around 0.65A but some loads I want to measure get down to 0.1A. I think that should work. 0.1. Btw, a tip to get more calibration points: you can just wrap the wire around the CT multiple times. e.g. if you have a stable 1A load and you wrap it around 4 times you can use that as a reference point for a 4A load. Quote:Wouldn't it be better to measure on actual wires in the walls? I believe the readings may be influenced by plenty of wires around in my fuse box. I just calibrated them outside my cabinet before installing them on the lines I needed. But during testing I tried to move and wiggle them around but that didn't seem to affect the readings. Didn't see a difference between having 1 or all 16 lined up next to each other, so I think that is quite ok. [/quote] |