Analog circuit with 100ohm resistor & 1k ohm resistor: ±4.20 voltage was detected on A0.

Building with analog and digital I/O

This week I focused on two (very related) objectives:

  1. To make sure I understand the concept of digital input and output, and to write some Arduino code to play with it. — that went pretty well.
  2. To make suer I understand how voltage is being affected by different components of the analog circuit, such as resistors and transistors. — that didn’t went well…

Playing with sensor and digital input

Following the instructive videos and articles on the subject, I decided to take on a simple task to test my understanding of digital input.

I connected my Arduino board to a circuit that included 2 LEDs and a photocell sensor. The circuit was connected to the Arduino board, and using the following code, I was able to control to the power output of the board:

void setup() {
  pinMode(8, OUTPUT); // power to LEDs
  Serial.begin(9600);
}

void loop() {
  int photoCellState = analogRead(A2);
  Serial.print("photocell: ");
  Serial.print(photoCellState);
  Serial.print("\t");
  Serial.print("LEDs: ");

  if (photoCellState < 380) { // light LEDs if photocell sense low lights
    digitalWrite(8, HIGH);
    Serial.println("ON");
  } else {
    digitalWrite(8, LOW);
    Serial.println("OFF");
  }
}

Questions about voltage changes within an analog circuit

I wanted to understand what is really happening at each point of my analog circuit. In other words, I wanted to know what is the amount of volts that passes through my circuit, and how does it change when I change the component on the circuit.

In order to have a constant voltage measurement, I followed the instructions on Tom Igoe’s instructional video, connected my Arduino to a certain point on the circuit, and printed the amount of volts the Arduino received to the console. The following code was used to monitor and print the voltage amount on my A0 Arduino input:

void setup() {
  Serial.begin(9600);
}

void loop() {
  int reading = analogRead(A0);
  float voltage = reading * (5.0 / 1024.0);
  Serial.print("voltage: ");
  Serial.print(voltage);
  Serial.print("\t");
  Serial.print("reading: ");
  Serial.println(reading);
}

Scenario 01: 100 ohm resistor

I set up the following circuit using this useful tool that showed me the resistance amount on each of  my resistors –

Analog circuit with 100ohm resistor: 0.06 - 0.46 voltage were detected on A0.
Analog circuit with 100ohm resistor: 0.06 – 0.46 voltage were detected on A0.

Once the pushbutton was pressed, the number of volts that was printed on the console was between 0.06V and 0.46V (depends on the position on wire on the breadboard).

I was surprised by the results. I suspected that the 100ohm resistor will make the volts amount to drop at the point where my wire was connected to A0 on my Arduino, but I didn’t expect it to drop that much..

 

 

 

The circuit I used for Scenario 01: 100 ohm resistor.
The circuit I used for Scenario 01: 100 ohm resistor.

I tried to run some calculations using the V = I * R formula, but that was not a big success 🙁

I kept on measuring the circuit on different points: On one side of the resistor (+), the voltage was near 5V, and on the other side of the resistor (-), the voltage was low, as described below. That made sense to me. The resistor releases a large amount of the volts. Also, given the numbers I saw on the console, I assumes that 100ohm resistor releases about 4V from a circuit (although this assumption seems to be broad, generic, and pretty wrong. The amount of voltage that a resistor releases might depend on the structure of the circuit and its components. But how can I calculate that in advance??).

Scenario 02: 100 ohm resistor + 1k ohm resistor

Things got really confusing when I replaced the wire that connects my circuit to ground, with a 1k resistor.

Analog circuit with 100ohm resistor &amp; 1k ohm resistor: ±4.20 voltage was detected on A0.
Analog circuit with 100ohm resistor & 1k ohm resistor: ±4.20 voltage was detected on A0.

I expected that since there are more resistors on the circuit, the amount of volts will be reduced. But instead, the console started to show ±4.20V.

When I moved the A0 wire to different points on the circuit, things started to make sense: after the second resistor (the 1k one), the amount of volts was 0. The resistance was too much for the 5V power source.
Somehow, the bigger 1k resistor draws more ‘electric pressure’ (I’m sure that there a better term for that), which actually raises the amount of volts on every part of the circuit before it. But again, the big question that remained open to me is –

 

The circuit I used for Scenario 02: 100 ohm resistor + 1K ohm resistor.
The circuit I used for Scenario 02: 100 ohm resistor + 1K ohm resistor.

 

HOW CAN I CALCULATE AND / OR PREDICT THE AMOUNT OF VOLTS, ON DIFFERENT POINTS OF THE CIRCUIT, BASED ON THE ORDER OF DIFFERENT COMPONENTS?

 

 

 

Published by

Dror Ayalon

@drorayalon

One thought on “Building with analog and digital I/O”

Leave a Reply

Your email address will not be published. Required fields are marked *