The second failure: Errors
avrdude: stk500_getsync(): can't communicate with device: resp=0x14
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x10
avrdude: stk500_recv(): programmer is not responding
Arduino Sketch 2
Knock Detector
Blow Detectorconst int ledPin = 13;
const int knockSensor = 0;
const int threshold = 10; // threshold value to decide when the detected sound is a knock or not
int sensorReading = 0; // variable to store the value read from the sensor pin
int ledState = LOW; // variable used to store the last LED status, to toggle the light
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
Serial.begin(9600); // use the serial port
}
void loop() {
sensorReading = analogRead(knockSensor);
if (sensorReading >= threshold) {
ledState = !ledState;
digitalWrite(13, HIGH); // set the LED on
delay(100); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(10); // wait for a second
}
}
int sensorReading = 0; // variable to store the value read from the sensor pin
int ledState = LOW; // variable used to store the last LED status, to toggle the light
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
Serial.begin(9600); // use the serial port
}
void loop() {
sensorReading = analogRead(knockSensor);
if (sensorReading >= threshold) {
ledState = !ledState;
digitalWrite(13, HIGH); // set the LED on
delay(100); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(10); // wait for a second
}
}
Arduino Sketch 1
PIR Sensor Input Testing:
LED On/Off depends on PIR sensor's analog input
int ultraSoundSignal = 2; int val = 0;
int ultrasoundValue = 0;
int timecount = 0; int ledPin = 13;
void setup() {
Serial.begin(9600); // Sets the baud rate to 9600
pinMode(ledPin, OUTPUT); // Sets the digital pin as output
}
void loop() {
timecount = 0;
val = 0;
pinMode(ultraSoundSignal, OUTPUT);
int ultrasoundValue = 0;
int timecount = 0; int ledPin = 13;
void setup() {
Serial.begin(9600); // Sets the baud rate to 9600
pinMode(ledPin, OUTPUT); // Sets the digital pin as output
}
void loop() {
timecount = 0;
val = 0;
pinMode(ultraSoundSignal, OUTPUT);
digitalWrite(ultraSoundSignal, LOW); // Send low pulse
delayMicroseconds(2); // Wait for 2 microseconds
digitalWrite(ultraSoundSignal, HIGH); // Send high pulse
delayMicroseconds(5); // Wait for 5 microseconds
digitalWrite(ultraSoundSignal, LOW); // Holdoff
pinMode(ultraSoundSignal, INPUT); // Switch signalpin to input
val = digitalRead(ultraSoundSignal); // Append signal value to val
while(val == LOW) { // Loop until pin reads a high value
val = digitalRead(ultraSoundSignal);
}
while(val == HIGH) { // Loop until pin reads a low value
val = digitalRead(ultraSoundSignal);
timecount = timecount +1; // Count echo pulse time
}
ultrasoundValue = timecount; // Append echo pulse time to ultrasoundValue
if(timecount > 0){
digitalWrite(ledPin, HIGH);
}
delay(100);
}
The first failure
Aurduino Software and Hardware didn't communicate at all.
I didn't install FTDIUSBSerial Driver.
I didn't install FTDIUSBSerial Driver.
11/4 in class
Processing
Visualize an analog sources from sensor's input
* Using the brightness of video capture input instead of variable from sensors
Visualize an analog sources from sensor's input
* Using the brightness of video capture input instead of variable from sensors
import processing.video.*;
Capture myCapture;
int cellsize = 3;
int cols, rows;
PFont font;
void setup () {
size(400, 300);
cols = width/cellsize;
rows = height/cellsize;
frameRate(30);
myCapture = new Capture(this, width, height, 30);
}
void captureEvent (Capture myCapture) {
myCapture.read();
}
void draw () {
background(0);
loadPixels();
for ( int i = 0; i < cols;i++) {
for ( int j = 0; j < rows;j++) {
int x = i*cellsize + cellsize/2;
int y = j*cellsize + cellsize/2;
int loc = x + y*width; // Pixel array location
color c = myCapture.pixels[loc]; // Grab the color
float z = (mouseX/(float)width) * brightness(myCapture.pixels[loc]) - 20 ;
println(loc);
stroke(123,128,158);
line(cellsize, height, cellsize, height - loc);
if (cellsize >= width) {
cellsize = 0;
background(48,31,65);
}
else {
// increment the horizontal position for the next reading:
cellsize++;
}
}
}
}
Timeline
11/4
Re-make the out line and time line
Get electronic components: Arduino-HW, sensors
Working on coding( Processing and Arduino): Schematic and Circuital Practice
11/9 11/11
Define the specific interface of the installation
Organize interactive story - How the installation is going to work
Working on coding(Processing and Arduino): Test the availabilities and limits of sensors
11/16 11/18
Prototyping: Build up a miniature booth
Working on coding(Processing and Arduino): Set up and install in the miniature booth
Testing that follows the interface scenarios
Report results
11/2311/25
Working on coding(Processing and Arduino): modify weakness and develop
Virtual prototyping
11/30 12/2
Consider a real space and an installation
electric grocery
What I will use are
- 75 db Piezo Electric Buzzer
- PIR Sensor Module
- P3 outdoor sensor for Temperature and Humidity
PIR Sensor Module
PIR sensor detects motion from up to twenty feet away, and PIR stands for Pyroelectric Infrared Ray or Passive InfraRed.
This module contains Fresnel lens in order to extend a detectable distance and expand sensitivity.
This module contains Fresnel lens in order to extend a detectable distance and expand sensitivity.
Subscribe to:
Posts (Atom)

