top of page
Search

OBJECT - Lab 3

  • Jackson Solomon
  • Feb 22, 2018
  • 2 min read

The purpose of this lab was to mess around with some analog sensors and components to learn about analog input and output with the Arduino.

 

PART 1

For the first part of this lab, we had to create a simple circuit using a potentiometer and an LED, in which the potentiometer was a kind of dimming knob.

This was the circuit

(All circuit diagrams credit: Melissa Felderman)

I realized that I use LEDs with 220 ohm resistors often (usually for labs) so I decided to start by soldering a couple of LED setups so that they would be plug and play

Then I wired the circuit using a breadboard

I wrote the code to map the values of the potentiometer (0-1023) to the PWM values available to the LED (0-255).

It worked great!

 

PART 2

For part 2, things got a bit more interesting. We needed to build a circuit using two different analog sensors. For this I decided to use a flex sensor and a photocell. We then needed to connect two LEDs and use the analog sensors to control the brightness of each LED individually.

This is the circuit

For the variable resistors to be used as sensors I had to use pulldown resistors. I tried a 10K ohm resistor for the photocell initially, but found that it didn't have enough resistance. I ended up using the 10K for the flex sensor and a 100K for the photocell.

This is the completed circuit

I again mapped the extreme values of the two analog sensors to the output of the LEDs.

Flex sensor/Green LED

Light sensor/Blue LED (bright/dark)

 

PART 3

For part three, we had to use two light sensors (acting as one) to control the pitch of a speaker.

This is the circuit

I found this part to be very easy after the first two parts. The challenge was figuring out what readings the two conjoined light sensors gave, but this was easy to do using the serial monitor. I then mapped the readings to a range of frequencies from 2KHz to 5KHz.

Here's a video to demonstrate

 
 
 

Commentaires


bottom of page