Add the following snippet to your HTML:
Measurement of unknown resistance using Arduino.
Read up about this project on
Measure the resistance of an unknown resistor using Arduino.
In this project, I measured the resistance of an unknown resistor(1k)
I got a reading of 1007.84 ohms. Percentage error = 0.784%
int analogPin= 0; //Analog Pin A0 int raw= 0; int Vin= 5; //input voltage 5 volts float Vout= 0; float R1= 1000; //mention R1(Known Resistance,in my case 1000 Ohm) float R2= 0; float buffer= 0; void setup() { Serial.begin(9600); } void loop() { raw= analogRead(analogPin); if(raw) { buffer= raw * Vin; Vout= (buffer)/1024.0; buffer= (Vin/Vout) -1; R2= R1 * buffer; Serial.print("Output voltage: "); Serial.print(Vout); Serial.println(" Volts"); Serial.print("Resistor value: "); Serial.print(R2); Serial.println(" Ohm"); delay(1000); } }
Comments