I 'ave asked this question on the Arduino projects but none seem to have an answer hence am sorry if this would be a repost.
I am trying to bias an AC signal. please be easy on me am just getting used to the concept/terms of sampling and biasing.
I am trying to get the slightest variation on of the AC signal and when simulating on LTSpice i can see a difference of .1 to .7v. Wish to know if this design would be enough for MUC such as the arduino sample. Should i smooth the signal ?
What am i trying to achieve ?
A way to read the current from the secondary winding of a MOT (Microwave Oven Transformer for spot welding 18650 cells) by reading the voltage and a known resistance and by using Ohms Law I=V/R calculate the current putout during weld.
So i could use a current transducer but for the thickness of the cable of 25mm2 a CT would be very expensive. hence thought of going this way, I have two variables already which is voltage and Resistance hence within the code i could get the current. To get the voltage i have tapped on 2 points on the secondary cable at 40cm apart and i get a sine wave RMS 2.7vac and a Vpp of 2.04vac. So just need to scale the ac voltage safe enough to be fed into an arduino ADC and the easiest way would be to add a dc bias (i hope i've used the terms correctly) or some say it as level shifting with an opamp and some resistors and caps.
The above circuit does a phase shift, this was suggested by a user from this community since i could not come up with a solution myself but for some reason i can't get a reading from an arduino. I sample it read the min and max values.
void loop()
{
if ((Cal == 0) && btnState == HIGH)
{
unsigned long currentTime = millis();
digitalWrite(TRIAC, HIGH);
unsigned long prevTime;
Serial.println("Calibrating.....");
reading = analogRead(A2);
if (reading > minReading) maxReading = minReading;
if (reading < maxReading) minReading = minReading;
if (currentTime - prevTime >= 500)
{
Cal = 1;
digitalWrite(TRIAC, LOW);
} else {
digitalWrite(TRIAC, LOW);
}
Serial.print("Min: ");
Serial.println(minReading);
Serial.print("Max: ");
Serial.println(maxReading);
prevTime = currentTime;
}