I'm very interested by your setup. It has been a shame to have some low voltage power in order to measure power consumption
I hope you can display something soon.
Regards,
Qq.
@ZenBlizzard in case you are measuring the output with a multimeter, you will get an averaged level, since AC current waveform should be sinusoidal and overlapped with the Vcc/2->2.56V in your case.
To measure the current you need a decently high sampling and some math.
#define SENSITIVITY 66 // mV/A
const float readings = 5;
const float alpha = 2.0 / (2 * readings + 1);
for (ifor = 0; ifor < 250; ifor++)
{
// Voltage
voltageSampleRead = analogRead(V) * vccRead / 1023 - vccRead / 2; /* read the sample value including offset value*/
voltageSampleSum = voltageSampleSum + sq(voltageSampleRead); /* accumulate total analog values for each sample readings*/
voltageSampleOffsetSum = voltageSampleOffsetSum + voltageSampleRead;
// Current
currentSampleRead = analogRead(I) * vccRead / 1023 - vccRead / 2; /* read the sample value including offset value*/
currentSampleSum = currentSampleSum + currentSampleRead * currentSampleRead; /* accumulate total analog values for each sample readings*/
currentSampleOffsetSum = currentSampleOffsetSum + currentSampleRead;
wait(1);
}
voltageMean = voltageSampleSum / ifor; /* calculate average value of all sample readings taken*/
voltageOffset = voltageSampleOffsetSum / ifor;
reading = (sqrt(voltageMean) - voltageOffset) * 230.0 / 1.0; // read voltage / reported voltage.
voltage = round_to_dp(alpha * reading + (1 - alpha) * voltage,1);
Serial.println(voltage);
if (voltage < 25) voltage = 0;
currentMean = currentSampleSum / ifor; /* calculate average value of all sample readings taken*/
currentOffset = currentSampleOffsetSum / ifor;
reading = (sqrt(currentMean) - currentOffset) / SENSITIVITY * 1000 - currentZeroOffset; // subtract no load current.
if (reading < 0) reading = 0;
current = round_to_dp( alpha * reading + (1 - alpha) * current,2);
@yury said in Wall Socket Insertable Node:
Looks cool! Do you have experience with capacities switches? I did not play much with them. afraid to use close to AC interference though...
You need to use a capacitive IC with active shielding, basically you have an extra electrode around your touch electrode and the touch IC will compare capacitive change of the touch electrode with capacitive change from the shield electrode. If the change is due to electrical interference then both electrodes will be changed in a similar way and the IC will not trigger.
@zmatokan said in NModule:
@Nca78 Are you still working on this pcbs? i think it would be great to add a version that supports HiLink 220ac->5dc module on powerboard.
No I'm not working on NModules anymore, I have a few old nodes using atmega/nrf24 but I switched to NRF5 for "basic" nodes now, and to ESP32 for more "advanced" stuff.
NModule was designed for beginner and simple/riskless use, so I don't think adding high voltage option is a great idea, it's better to use an external power supply and connect the output to the powerboard.