week 5 sensors Xiaoyu
Goal of project/interaction
Create a circuit that the LED will light up only when the ultrasonic sensor detect something close and photocell sensor is covered.
Core components
1 * ultrasonic sensor
1 * photocell sensor
1 * LED
1 * 10k ohms resistors
1 * 220 ohms resistors
Wires & jumpwires
Arduino board
How it works
Get close to the ultrasonic sensor
Cover the photocell
LED light up
Github
pcom/ultrasonic&photocell
WEEK 5 hw – Carla Molins
- Goal of the project and/or desired interaction
Create a circuit that activates an LED just when both photocell is covered and ultrasonic sensor has something close enough.
- Quick description of assembly and list of core components
1x Arduino
1 x medium breadboard.
1 x red LED
1x ultrasonic sensor
1 x photocell
1x resistors (220 ohms) – resistor
1 x resistors ( 10K ohms) – photocell
Jump wires
- How it works
By default the light is off (LOW). When the photocell is covered OR the ultrasonic detects an object the LED stays the same. Just when both are covered triggers the system to light up the LED.
- Any problems you encountered and/or solved
I had to think through my if statements before coding.
Images of your circuit


https://github.com/Lywa/carla_molins_Pcomp/tree/master/WEEK_5_hw Continue reading
week5_ultrasonic&photocellControlledLed
After learning about sensors, we were asked to combine the use of both photocell – love – and ultrasonic sensor using an if statement, and here is the result:
Continue reading
Week 5 – sensors
Goal of the project : Turn on the light according to distance and ambient light
Core components : Led light, photocell, 220 Ohm resistor, 1k resistor, ultrasonic sensor, arduino
How it works : the ultrasonic sensor measures the distance and the photocell measures the ambient light. An if statement combines the two measurements to control the led light
Problems encountered : the led light blink when is on. I couldn’t find a way to connect the photocell data without using a map function
Week 4: Update & Redo
Hello, after my initial two failures I’m back at it again with a copied code. This code is from my classmate Alyssa http://lizastark.com/physcomp/alyssas-combination-lock-week-4/ https://drive.google.com/file/d/1OlpTO_oNPYWVEbz0SmbbegJo1Oo0Lawy/view
My breadboard set up is still functional, though to match with Alyssa’s code I got rid of a button. Here are some videos of my experience:
In this video I am inputting the combination and finding that after the combination is inputted there is no way to get the Arduino to lock/ reset again.
Here I found that prior to putting in the correct combination, the buttons will reset themselves after 3 pushes.
Thank you.
Week 7: Wireless
- Goal of the project : By clicking four buttons in a certain sequence, the lock will be locked or unlocked indicating by two leds. If it is unlocked, the blue led will light up; if it is locked, the red led will light up.
- Core components : 4 buttons, 4 x 10K ohms resistors, red and blue leds, 2 x 220 ohms resistors, breadboard, arduino board, jumper wires
- How it works : If you press buttons from 1 to 4, the blue led will light up and fade out in a while. Otherwise the red led will light up.
- Problems encountered : the button is unstable sometimes.

Alyssa’s Combination Lock (Week 4)
Goal: Build a combination lock using 2-4 buttons, at least 4 button presses, and LEDs indicating locked vs unlocked status.
Components: jumper wires, 3 buttons, 5 resistors (220 Ohms x 2, 10K Ohms x3), 2 LEDs (different colors), breadboard, arduino
Setup: 3 buttons and 2 LEDs with resistors wired to arduino. When the right combination of buttons is pressed, unlock and shine the green LED. Otherwise, lock and shine the red LED.
How it works:
Starts in a locked status, indicated by red LED.
Enter the following combination of buttons to unlock:
Button 1: 2 presses
Button 2: 1 press
Button 3: 2 presses
This combination unlocks, indicated by green LED.
To lock: press each button once. This triggers each button count to exceed the maximum limitation and thus reset to 0.
Week 5 Assignment
Create a circuit to light up a LED or control a Processing sketch using both a photocell sensor and an ultrasonic sensor.
- If the environment is bright, the LED won’t light up.
- If the environment is dark but the distance is far away, the LED won’t light up.
- If the environment is dark and the distance is close, the LED will light up.
