top of page

Object

A design blog

  • Writer's pictureSummer Thompson

Lab 3: Sensor Input and Digital Output



Introduction:

The following circuits were created for the third lab assignment for the 2018 Object class at the Atlas institute at the University of Colorado, Boulder. The objective of this lab was to read sensor values, print values to the Arduino serial monitor, use analog output to dim LEDs, use the map function, and generate frequency using the tone() command.

Materials:


Part 1:

Build a circuit with a potentiometer as the input, and an LED as the output. Use analogRead() for the incoming potentiometer value, and analogWrite() to set the brightness of the LED.


After building the circuit drawn in the schematic above, I programmed my Arduino using this code to tie LED brightness to potentiometer input. Bellow is a video of this circuit.


Part 2:

Build a circuit with at least 2 different variable resistors that output brightness values to two different colored LEDs. 


After assembling the above circuit I used this code to program my two LEDs to respond to the analog input from the sliding pot and the photo resistor. Bellow is a video of the circuit in action.





Part 3:

Connect two photo resistors to analog pin 0 in a voltage divider circuit. Connect the piezo speaker to a digital pin and and ground. Use analogRead() to read in values from the photocell and the map() function to convert the range and generate tone output from the piezo speaker.


After assembling the above circuit, I used this code to generate tone output based on the photocell input. Bellow is a video of the circuit in action.

Conclusion:

This lab was an excellent opportunity to learn about analog sensors and how to tie LED/Tone output to input from those sensors. I will definitely be using many of the Arduino functions I used in this lab to program my first project for this class. Thanks for reading.

3 views0 comments
  • github
  • Black YouTube Icon
  • Black Pinterest Icon
  • Black Instagram Icon
bottom of page