Category Archives: Week 5: Sensing the Physical World

Week 5 Serial Connect with Processing

Goal:

I want to create a use ultrasonic sensor and a photocell to send data and bytes to processing, that allows me create a sense of controlling nature force on digital screen.

Description:

The sum of sensor values from ultrasonic and photocell determines the opacity and position of particles inside the fog.

  • How it works: people use hands to move around the ultrasonic sensor and use finger to cover the amount of light through photocell to control the position and opacity of fog particles on screen

Problem:

The data sent from Arduino to Processing are within certain range which are hard to be calculated and mapped precisely into the Processing sketches. Also, the bytes are not stable. (Also, I forgot to write code for LED, but I think it does not matter that much)

Materials:

  1. Arduino UNO R3 x 1
  2. Breadboard x 1
  3. Ultrasonic sensor x 1
  4. Photocell x 1
  5. 220Ω Resistors x 1
  6. Wires

Connection Diagram:

Code:

Arduino

Processing:

Week 5 – Sensors – Lisa H

  • Goal of the project and/or desired interaction
    This week our homework was to either create a circuit to light up a LED or control a Processing sketch using both a photocell sensor and an ultrasonic sensor. I decided to create a circuit to light up a LED. The criteria include having the LED not light up by itself when the photocell is exposed to light. If the environment is dark but the distance is close, LED will light up. If the distance is far away, the LED won’t light up.
  • Quick description of assembly and list of core components
    1x Arduino1x Medium breadboard.

    1x White LED

    1x Ultrasonic sensor

    1x Photocell

    1x Resistors (220 ohms) – resistor

    1x Resistors (10K ohms) – photocell

    Jump wires

  • How it works
    By itself, the LED will not light up when your hands are not influencing the photocell and the ultrasonic sensor. When your hands cover the photocell which indicates the environment is dark, but your hand is far away, the light will stay off. It’s only when your hand is near and covering the photocell, the light will light up. I used simple if statements with && to make the code part work.
  • Any problems you encountered and/or solved
    I had to write down and think through my if statements and else statements clearly to get it right. At first, I kept on getting mixed up on my clauses.
  • Images of your circuit

  •  Arduino Code
    https://github.com/lynnn43/PhysicalComputing/tree/master/wk5_photocell_ultratronicsensor_hwk5

Continue reading

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