I have been beating on this for a while so I thought it time to ask for some ideas. I have been successfully using the ESP to log heating system data from an Arduino-based controller I built. My current (no pun) intent is to create as close to a single board device as possible that will run on batteries. I would snap the CT around a load and every 5 minutes it will take a reading and upload to thingspeak. Resolution/accuracy/precision is not critical if reasonable. My plan is to use deep sleep to extend battery life.
I appreciate Robert Wall’s earlier posts about using CTs - they have been extremely helpful but I’m not quite there yet. ESP is a nodemcu (Hiletgo) although I also have an Adafruit huzzah in the box I can work with. I am using a 75A maximum CT with 20ma secondary. Because the ESP can only accept 0-1v on the ADC, my burden resistor (43ohm) is selected to give about 1v at 72A. I am using a DC bias with 4.3K on top and 750ohm on the bottom to bring the midpoint to .5 volt. Using my DVM, the voltage reading at the ADC pin is proportional to the actual current as measured with my clampmeter, but I’m not succeeding reading that at A0 in the ESP. I am assuming that the ESP will be able to sample the components of the sine wave so I am am taking samples for a second and then saving the peak value to convert to current. Despite changing the load at the CT, the peak doesn’t change much at all. I am now thinking that it might be worth some type of rectification so the ADC can deal with DC but I’m fairly certain that 1v range is too small to deal with diode voltage drops. Before I go that route I wanted to take one more shot at an un-rectified signal. When I look at Emonlib code, I see that it indeed appears to take a slew of samples and then calculates Irms, although I am not fully clear on all the math. The Emonlib code seems to be intended for the Arduino world, but should it work on the ESP? I am using the Arduino IDE. I see a few required changes in the code notably around the 3.3v vs 5v difference. Any advice? Leave my circuit as is and solve the sampling problem? Use Emonlib? Find a way to rectify? I would like to make a small number of these so minimal circuit work is best if possible. Many thanks.