PHYS S-12 : Dan's Documentation

Electronics Basics and Microcontroller Intro

Day 3: 6/30

Reading Analog Input

We were tasked with measuring analog signals with a microcontroller. The one we recieved in the kit was the Adafruit METRO M0 Express. I used a potentiometer for this assignment to make things more interesting. A potentiometer is a voltage divider, and it allows me to set a variable resistance by turning its knob. When I connected it to the analog pin "A0", the pin sent serial communications to my computer, and I was able to read the voltage on my computer's serial monitor. It was exciting to see the numbers change as I twisted the knob of the potentiometer.

potentiometer layout
Layout of Potentiometer Circuit
Potentiometer Demo

I used a code demo called "AnalogReadSerial" to program the Arduino. The name is very self explanatory, it reads an Analog signal and puts it up on a Serial monitor. The comments on the demo are very descriptive as well.

potentiometer layout
Potentiometer Demo

Motor Circuit

After building the potentiometer circuit, I adapted it for a DC Motor. A DC Motor directly converts electrical energy into mechanical energy, and is very simple to use. It has a positive and negative side, and it will run as long as there is a powerful enough current going through it.

Layout of Motor Circuit
Motor Demo

I measured the voltage going through the potentiometer using a Multimeter. At the setting with the least resistance, the voltage actually showed to be 4.97v. I infer that this is because the potentiometer does not truly have a 0Ω setting, but rather the lowest setting is simply very close to 0Ω.

After this, in an attempt to practice using Ohm's law, I turned the potentiometer knob to the middle. The voltage was 7.81mV = 0.00781V. I then turned off the Arduino in order to measure the resistance of the potentiometer at that setting, and it was 64.2Ω. According to Ohm's law, I = ΔV/R , so I = 0.00781V/64.2Ω = 0.00012A = 0.12mA. Using Ohm's law, I figured out that this motor circuit with this particular potentiometer setting has a current of 0.12mA.