Resistors create a voltage divider of half, so 3.3 * .5 = 1.65V ish for a biased input. Bias is used so you can measure the full -1V - +1V AC swing of the CT clamp, basically 1.65V is now acting as 0, bias - 1V = 0.65V and bias + 1V = 2.65V. The ADC can’t measure negative voltages, Tom explained it with images above.
The capacitor is used as a decoupling capacitor to filter out any HF noise and to stabilize the 1.65V biased input to the CT clamp. If noise were to get into the input, it could taint the readings.
I was just curious what would the result be if I didn’t use the voltage divider and filter capacitor. I understand the reasoning behind them after reading through several threads including this one. But before I did, I simply hooked up my CT which does have a built in burden resistor. 200a/3vac. Initially I just used the single analog pin on the esp8266 and ground and it seemed to work just fine with no additional components. I then added an ads1115 to add a second CT channel, which also seemed to work ok, however I’m now wondering if my values are not as sensitive as they could be? Because it seems like it could be better. By not shifting the input up do I lose half the resolution I would normally have? With a 1amp load on my CT the resulting raw value the esp8266 reads is approx 0.015a (3V/200a)=0.015 which to me seems correct unless I’m missing something.
I agree a 200a CT is much to large for a 1a load typically speaking.
My project will ultimately be my grid mains panel which is why it’s 200a. I was just testing on the bench for now. I also tested with a 10a load and it seemed in line with the 1a load.
Like I mentioned everything seems to work perfectly fine as it is except i was hoping for a bit more accuracy, in particular I have 2 CT’s setup on the same wire and they seem to vary slightly during a constant load test. This could be due to what you mentioned about me testing a 1amp load on such a large CT.
I’m rounding up some resistors and a capacitor to try my exact setup the “proper” way with the voltage divider to see if in fact my accuracy increases. Or if it yields the same results.
An the dumb question is, which cables are the ones connected there between the PIN 34 and the 3.3V ? Because the CT Clamp comes with a TRS cable with 3 lines, but in all diagrams I see just 2 being used.
Here I also just see a 2 lines input for the CT Clamp.
In this comment Esphome ct clamp 30A/1V - #9 by audacity363, the cables are labelled “Clamp White” and “Clamp Red” that means there is no GND connection to the clamp and it just floats?
Thank you in advance.
Edit:
As reference, I did not cut the connector that came with the CT Clamp but bought a TRS female connector to make the connection.
Here with a soldered hard cable to test on a breadboard first:
It will be difficult what color scheme your TRS cable is following unless you find that shared by your cable manufacturer. Take a plain 3.5 mm male jack and multimeter and find the TIP, Ring and Sleeve.
This helps! The tip and the ring are what we need to use. so I will just check which cables are those. If they are like regular audio cables, it is probably the red and black ones.
I am having problems reading my values. If I connect directly the output of the voltage divider to the analog input of the ESP32 I get an stable 1.6V read on the ADC, but as soon as I connect it to the clamp circuit the voltage starts to go up and down from 0.14x volts to 3.1x volts
See the logs
[09:57:00][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:57:02][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.975A after 741 different samples (1235 SPS)
[09:57:02][D][sensor:094]: 'Measured Current': Sending state 0.97464 A with 2 decimals of accuracy
[09:57:06][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:57:08][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.972A after 736 different samples (1226 SPS)
[09:57:08][D][sensor:094]: 'Measured Current': Sending state 0.97248 A with 2 decimals of accuracy
[09:57:12][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:57:14][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.976A after 743 different samples (1238 SPS)
[09:57:14][D][sensor:094]: 'Measured Current': Sending state 0.97649 A with 2 decimals of accuracy
[09:57:18][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.65200 V with 3 decimals of accuracy
[09:57:20][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.981A after 742 different samples (1236 SPS)
[09:57:20][D][sensor:094]: 'Measured Current': Sending state 0.98115 A with 2 decimals of accuracy
[09:57:24][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 1.63100 V with 3 decimals of accuracy
[09:57:26][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.980A after 748 different samples (1246 SPS)
[09:57:26][D][sensor:094]: 'Measured Current': Sending state 0.98016 A with 2 decimals of accuracy
[09:57:30][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.70300 V with 3 decimals of accuracy
[09:57:32][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.977A after 741 different samples (1235 SPS)
[09:57:32][D][sensor:094]: 'Measured Current': Sending state 0.97730 A with 2 decimals of accuracy
[09:57:36][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.45800 V with 3 decimals of accuracy
[09:57:38][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.979A after 747 different samples (1245 SPS)
[09:57:38][D][sensor:094]: 'Measured Current': Sending state 0.97947 A with 2 decimals of accuracy
[09:57:42][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[09:57:44][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.974A after 738 different samples (1230 SPS)
[09:57:44][D][sensor:094]: 'Measured Current': Sending state 0.97374 A with 2 decimals of accuracy
[09:57:48][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.61600 V with 3 decimals of accuracy
[09:57:50][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.976A after 743 different samples (1238 SPS)
[09:57:50][D][sensor:094]: 'Measured Current': Sending state 0.97550 A with 2 decimals of accuracy
[09:57:54][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.60700 V with 3 decimals of accuracy
[09:57:56][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.975A after 740 different samples (1233 SPS)
[09:57:56][D][sensor:094]: 'Measured Current': Sending state 0.97488 A with 2 decimals of accuracy
[09:58:00][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.37500 V with 3 decimals of accuracy
[09:58:02][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.986A after 748 different samples (1246 SPS)
[09:58:02][D][sensor:094]: 'Measured Current': Sending state 0.98600 A with 2 decimals of accuracy
[09:58:06][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.19200 V with 3 decimals of accuracy
[09:58:07][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.980A after 746 different samples (1243 SPS)
[09:58:08][D][sensor:094]: 'Measured Current': Sending state 0.97967 A with 2 decimals of accuracy
[09:58:12][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.06700 V with 3 decimals of accuracy
[09:58:14][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.977A after 741 different samples (1235 SPS)
[09:58:14][D][sensor:094]: 'Measured Current': Sending state 0.97657 A with 2 decimals of accuracy
[09:58:18][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.13500 V with 3 decimals of accuracy
[09:58:20][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.978A after 746 different samples (1243 SPS)
[09:58:20][D][sensor:094]: 'Measured Current': Sending state 0.97769 A with 2 decimals of accuracy
[09:58:24][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:58:25][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.974A after 743 different samples (1238 SPS)
[09:58:26][D][sensor:094]: 'Measured Current': Sending state 0.97399 A with 2 decimals of accuracy
[09:58:30][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.60700 V with 3 decimals of accuracy
[09:58:31][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.976A after 740 different samples (1233 SPS)
[09:58:32][D][sensor:094]: 'Measured Current': Sending state 0.97579 A with 2 decimals of accuracy
[09:58:36][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.69700 V with 3 decimals of accuracy
[09:58:38][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.978A after 749 different samples (1248 SPS)
[09:58:38][D][sensor:094]: 'Measured Current': Sending state 0.97809 A with 2 decimals of accuracy
[09:58:42][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[09:58:43][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.042A after 463 different samples (771 SPS)
[09:58:44][D][sensor:094]: 'Measured Current': Sending state 1.04248 A with 2 decimals of accuracy
[09:58:48][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 1.43600 V with 3 decimals of accuracy
[09:58:50][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 0.988A after 688 different samples (1146 SPS)
[09:58:50][D][sensor:094]: 'Measured Current': Sending state 0.98785 A with 2 decimals of accuracy
[09:58:54][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[09:58:55][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.066A after 492 different samples (820 SPS)
[09:58:56][D][sensor:094]: 'Measured Current': Sending state 1.06568 A with 2 decimals of accuracy
[09:59:00][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:59:02][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.090A after 509 different samples (848 SPS)
[09:59:02][D][sensor:094]: 'Measured Current': Sending state 1.09028 A with 2 decimals of accuracy
[09:59:06][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[09:59:08][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.073A after 498 different samples (830 SPS)
[09:59:08][D][sensor:094]: 'Measured Current': Sending state 1.07275 A with 2 decimals of accuracy
[09:59:12][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[09:59:13][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.070A after 487 different samples (811 SPS)
[09:59:14][D][sensor:094]: 'Measured Current': Sending state 1.06961 A with 2 decimals of accuracy
[09:59:18][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:59:20][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.082A after 502 different samples (836 SPS)
[09:59:20][D][sensor:094]: 'Measured Current': Sending state 1.08153 A with 2 decimals of accuracy
[09:59:24][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:59:26][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.067A after 482 different samples (803 SPS)
[09:59:26][D][sensor:094]: 'Measured Current': Sending state 1.06698 A with 2 decimals of accuracy
[09:59:30][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:59:32][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.087A after 504 different samples (840 SPS)
[09:59:32][D][sensor:094]: 'Measured Current': Sending state 1.08694 A with 2 decimals of accuracy
[09:59:36][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[09:59:38][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.079A after 496 different samples (826 SPS)
[09:59:38][D][sensor:094]: 'Measured Current': Sending state 1.07930 A with 2 decimals of accuracy
[09:59:42][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.55400 V with 3 decimals of accuracy
[09:59:44][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.073A after 491 different samples (818 SPS)
[09:59:44][D][sensor:094]: 'Measured Current': Sending state 1.07325 A with 2 decimals of accuracy
[09:59:48][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.08800 V with 3 decimals of accuracy
[09:59:49][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.073A after 496 different samples (826 SPS)
[09:59:50][D][sensor:094]: 'Measured Current': Sending state 1.07312 A with 2 decimals of accuracy
[09:59:54][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[09:59:56][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.081A after 501 different samples (835 SPS)
[09:59:56][D][sensor:094]: 'Measured Current': Sending state 1.08149 A with 2 decimals of accuracy
[10:00:00][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.12200 V with 3 decimals of accuracy
[10:00:01][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.069A after 492 different samples (820 SPS)
[10:00:02][D][sensor:094]: 'Measured Current': Sending state 1.06862 A with 2 decimals of accuracy
[10:00:06][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[10:00:07][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.071A after 492 different samples (820 SPS)
[10:00:08][D][sensor:094]: 'Measured Current': Sending state 1.07108 A with 2 decimals of accuracy
[10:00:12][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 1.35700 V with 3 decimals of accuracy
[10:00:14][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.066A after 486 different samples (810 SPS)
[10:00:14][D][sensor:094]: 'Measured Current': Sending state 1.06593 A with 2 decimals of accuracy
[10:00:18][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 1.47000 V with 3 decimals of accuracy
[10:00:20][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.074A after 498 different samples (830 SPS)
[10:00:20][D][sensor:094]: 'Measured Current': Sending state 1.07407 A with 2 decimals of accuracy
[10:00:24][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[10:00:26][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.068A after 483 different samples (805 SPS)
[10:00:26][D][sensor:094]: 'Measured Current': Sending state 1.06790 A with 2 decimals of accuracy
[10:00:30][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[10:00:32][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.075A after 485 different samples (808 SPS)
[10:00:32][D][sensor:094]: 'Measured Current': Sending state 1.07491 A with 2 decimals of accuracy
[10:00:36][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[10:00:38][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.069A after 487 different samples (811 SPS)
[10:00:38][D][sensor:094]: 'Measured Current': Sending state 1.06885 A with 2 decimals of accuracy
[10:00:42][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 2.84200 V with 3 decimals of accuracy
[10:00:44][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.076A after 491 different samples (818 SPS)
[10:00:44][D][sensor:094]: 'Measured Current': Sending state 1.07634 A with 2 decimals of accuracy
[10:00:48][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 3.15500 V with 3 decimals of accuracy
[10:00:50][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.032A after 700 different samples (1166 SPS)
[10:00:50][D][sensor:094]: 'Measured Current': Sending state 1.03182 A with 2 decimals of accuracy
[10:00:54][D][sensor:094]: 'adc_sensor_wash_machine': Sending state 0.14200 V with 3 decimals of accuracy
[10:00:56][D][ct_clamp:042]: 'Measured Current' - Raw AC Value: 1.044A after 719 different samples (1198 SPS)
[10:00:56][D][sensor:094]: 'Measured Current': Sending state 1.04399 A with 2 decimals of accuracy
this is my config, I have not done any calibration yet because I can not get the sensor to report stable values.
Have you got this setup completed? I was trying setup something similar to this one, but I was not getting the constant output from the setup. I have kept that in the “hold” list and continued on other project. If it is working for you then can you share the yaml and schematic diagram please?
Hi,
Would it also be possible to use multiple clamps on one ESP32 (which has more usable adc channels if I am correct) with this schematic? So connecting one lead of multiple clamps to the same 1.65V point, and then every other lead to it’s own adc pin? Or should each clamp get it’s own voltage divider? Or is this not possible at all?