Lab 1: MysterResister - the Unknown Resister

PHYS 37100 - Fall 2024


Introduction

The majority of all measurements made in experimental physics are essentially voltage measurements. When we measure the resistance of an unknown object, we are really measuring a voltage and converting that to a resistance. A digital thermometer contains an element whose resistance changes with temperature, but when it produces a reading, it is really measuring a voltage and converting that to a resistance and then to a temperature, in whatever units you have selected on the thermometer. In short, if there's a property you want to measure electronically, you better be able to make that property cause a voltage change somehow. That's what we can measure (simply). This lab will explore the basics of how we measure voltage with an Arduino. Specifically, we'll make measurements to determine the resistance of an unknown resistor.

Goals

Hardware

Construct a voltage divider circuit as shown. $R_2$ will be the known resister, and $R_1$ is the unknown resistor. $V_{out}$ is the voltage measured by the arduino, and $V_{in}$ is the +5 V provided by the pins on the arduino as shown.

A voltage divider in three views. From left to right, a circuit diagram (most abstract), a schematic illustration, and a photograph of the working device (least abstract).

Software

The following code can be used to obtain the value of the $V_{in}$ from the Arduino. You can paste this code into the Arduino code editor as is, with no modifications necessary.


/*
CCNY PHYS 37100 
Experiment 1a

The following is based on Public Domain Code available here:
https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial

In what follows, lines that start with // are comments and are not
pert of the program, just like this section. 
`
*/

// setup() is a function that is run once at the beginning. 
// Either when you first upload the code to the board, 
// or after pressing the reset button

void setup() {
  // To enable the computer to retrieve data from the board, we 
  // initialize serial communication at 9600 bits per second:
  
  Serial.begin(9600);

}

// The loop() function runs over and over so whatever is contained
// therein will be repeated until while the arduino is on. 

void loop() {
  
  // The function analogRead() will
  // read the input on analog pin 0:
  // that value is stored in an integer variable called sensorValue
  
  int sensorValue = analogRead(A0);
  
  // The following line will send that variable to the
  // serial connection and print the measured value
  // in a range of 0 to 1023 where 0 is 0 Volts and 1023 is equal 5 Volts
    
  Serial.println(sensorValue);
  
  // We don't need a lot of measurements, so the delay function
  // will insert a 1000 millisecond (1.0 second) delay between each
  // loop. 
  
  delay(1000);
}


After you have created the sketch using the code above, upload it to the board and then open the serial monitor window (from the menu Tools->Serial Monitor). You should see a number that repeats (or slightly changes) every second. That is the value of the analog-in measurement.

Two windows showing the Arduino code editor, and the serial monitor output.

Measurement

Use the arduino to measure the unknown resistor. You will be provided a known resistor (Value is 1 kOhm) in class to use as $R_2$.

Analysis

Use your understanding of the voltage divider circuit discussed in class to convert your measured quantity to a resistance value in Ohms.

Prepare a plot of an analytical function (i.e. not data) that shows the relation between $V_{out}$ and $R_1$, given your value of $R_2$. ; and $V_{in}$ of 5 Volts. That means $V_{out}$ is on the vertical axis, and $R_1$ is on the horizontal axis. Show that the value you obtained for $R_1$ lies on this curve. This tutorial might be helpful.

Also, include a short explanation that discusses and shows the limits of the resistance measurement resolution of this particular setup. In other words,how precise is your measurement?


Report

Due: 4 pm, Sep 23, via BlackBoard

To submit:

Other notes