Skip to content

8. Electronics Design - Landon, David, Ryan

This is the group assignment document for Landon Broadwell, David Vaughn, and Ryan Zhou. In this document, we go through using a multimeter and oscilloscope to measure the changes in voltage over time when using the PWM pins for an analog output. The simple output method we chose was an LED on a breadboard connected to one of the pin header connections on Landon Broadwell’s board. For details on the wiring/connections of these pin headers, visit his documentation.

The setup involved using two male-to-female jumper cables, a breadboard, a 330 Ohm through-hole resistor, a small through hole LED, and the different electronics involved with the ATtiny412 board.

Multimeter

To use the multimeter, we turned the knob to V and put the probe cords in the holes that lit up. We then checked the pinouts for the ATtiny chip and saw that we should use 2 for the pin in Arduino IDE to connect to the correct connector header pins. We placed the red probe on the side of the resistor with the power moving into it and placed the black prode on the cathode of the LED as shown below:

Then, with the correct settings for the ATtiny selected within ArduinoIDE 2.3.1, we ran the following code:

int pin = 2;

void setup() {
  pinMode(pin, OUTPUT);
}

void loop() {
  for (int i = 0; i <= 255; i+=5) {

    analogWrite(pin, i);
    delay(50);  
  }
  for (int i = 255; i >= 0; i-=5) {

    analogWrite(pin, i);  
    delay(50);  

  }                    
}

Since pin 2 is a PWM pin, it allows this code to use analogWrite, which would normally not be able to occur on different types of boards/pins. The code increases and then decreases the brightness of the LED repeatedly to show the varying levels of voltage passing through it. The result of this code being executed and the multimeter being hooked up was the following:

The changing levels of the voltage shown on the multimeter alongside the changing of the brightness illustrate the relationship between the voltage and the brightness of the LED. Though looking at the changes of the multimeter does help show an aspect of this relationship, it could be better illustrated through the an oscilloscope.

Oscliloscope

This part of the assignment involved using the SDS 1202X-E oscilloscope, and the user manual for it can be found here. We followed the Auto Setup workflow to configure the oscilloscope’s waveforms correctly, and then plugged the probes into the same spots as was done for the multimeter. Mr. Dubick, our instructor, also helped with the initial setup by guiding someone else’s group, which we could learn different things about the machine by watching. After the probes were placed correctly and the same code from above was ran, the oscilloscope produced a result that showed the slowly changing voltages over time.

The many lines on the screen represent the multitude of readings the oscilloscope is taking of the electricity traveling through the resistor and LED. The top lines represent the amount of voltage going to the LED, and it growing larger signifies the brightness of the LED increasing; conversely, the bottom lines represent the lack of voltage per unit time. An additional way to view this relationship is that each top line is the short amount of time that the LED is on, and since they blink so frequently, the human eye can not pick up on this blinking. This makes it so that the time the LED is on correlates to how much light the human eye picks up, therefore relating to the brightness of the LED.


Last update: March 25, 2024