i want to measure the accurate voltage reading. The output is keep on fluctuating is there anyway to make DC or stable output
input given to irled is 100hz 10% duty cycle
Voltage received from Sensor is: 2.4497
Voltage received from Sensor is: 2.5670
Voltage received from Sensor is: 2.6696
Voltage received from Sensor is: 2.7674
Voltage received from Sensor is: 2.8065
Voltage received from Sensor is: 2.8504
Voltage received from Sensor is: 2.8016
Voltage received from Sensor is: 2.7674
Voltage received from Sensor is: 2.6843
The oscilloscope yellow curve shows Photodarlington output and blue curve shows the lockin amplifier output
The blue line on your 'scope is varying. Are the Arduino values accurately reflecting that variation - or is there some other problem?
If the Arduino is accurately capturing the voltage maybe you could average the value over several readings.
If the Arduino is NOT accurately capturing the voltage I reckon you need to post the schematic showing how everything is connected. A photo of a pencil drawing will be fine. A photo of your hardware is not suitable for showing wiring connections.
So for what i did is shown in page 1. i am planning to do lockin amplifier circuit is in page 2.
please correct my mistakes regarding resistor and capacitor values
any other suggestions are welcome and appreciated:
#include <PWM.h>
//variables
int32_t frequency = 100;
float val = 0.0;// variable to store the value coming
// from the sensor
float Bit = 1023.0; //set value for amount of bits
float volt = 0.0; //set value to store calculated voltage
float SensorData;
float RI=0;
// Sensor pin config
//const int Sensor1Pin = A0;
//PWM pin config
#define PIN 3
void setup() {
pinMode(PIN, OUTPUT);
int DUTY = 50;
InitTimersSafe(); // won't touch timer0
SetPinFrequencySafe(PIN, frequency); // again, not timer0
pwmWrite(PIN, DUTY * 256 / 100);
// Sensor(s)
pinMode(A0, INPUT);
// for debugging
Serial.begin(9600);
}
void loop()
{
// // Read and store Sensor 1 data
// val = analogRead(A0);
// volt = val * (5.0 / 1023.0); //equation to convert incoming value to voltage
// SensorData = volt;
//
//
// Serial.print("Voltage received from Sensor is:\n");
// Serial.println(SensorData, 4);
// delay(500);
val = analogRead(A0);
volt= val*(5.0/1023.0); //equation to convert incoming value to voltage
RI=volt*1.33;
SensorData=RI;
Serial.print("Refractive index:\n");
Serial.println(Sensor1Data, 4);
delay(500);
} // END void loop...
codes i used, IRL81A IRLED and OP560a Photodarlington datasheet also attached, am i going in a correct way
Don't forget you have a 180Deg phase shift across the opto link, a HIGH in results in a LOW out.
Also where is the current coming from to bias your photo-darlington receiver?
You are assuming that the IR darlington produces a voltage, it doesn't, it is a current device, have a good read of the spec sheet and look at the small example circuit they use for the switching time test circuit.
Can you please post a copy of your complete circuit including the "locked in" amp schematic , in CAD or a picture of a hand drawn circuit in jpg, png?
Tom...
Sorry isn't the "locked in" amplifier a form of synchronous detector?
"locked in" stupid name.
Ok Tom thanks, those work. However he don't say what he wants to do only how he thinks he wants to implement it. Classic X-Y problem in my book.
I have used lock in amplifiers at the University and they were very expensive and used for measuring very small voltages in the presence of much larger voltages. I don't see the relevance here. He is modulating the IR signal and then trying to remove the modulation. If the modulation is for immunity from ambient light then I would have thought that a simple tuned amplifier followed by a good filter would have fitted the bill without trying to make a lock in amplifier.
That is why I want to know what he is trying to achieve with his project not how he is struggling to implement some process that is beyond him.