This the multi-page printable view of this section. Click here to print.
Sensors
- 1: Motion Sensor
- 2: Temperature Sensor
- 3: Humidity Sensor
- 4: Vibration Sensor
- 5: Loudness Sensor
- 6: Ultrasonic Ranger
1 - Motion Sensor
Connection scheme
Scheme made with Fritzing.
Functions
Digital Read
Digital Read State
Reads a digital value.
void function_0_motionSensor(){
int value = digitalRead(pin_0_motionSensor);
function_0_motionSensor();
}
int value = digitalRead(pin_0_motionSensor);
void function_0_motionSensor(){
int value = digitalRead(pin_0_motionSensor);
state = 1;
}
2 - Temperature Sensor
Connection scheme
Scheme made with Fritzing.
Functions
Analog Read
Analog Read State
Reads a analog value and transforms it to Celsius.
void function_0_temperatureSensor(){
int value = map(analogRead(pin_0_temperatureSensor), 0, 410, -50, 150);
function_0_temperatureSensor();
}
int value = map(analogRead(pin_1_temperatureSensor), 0, 410, -50, 150);
void function_0_temperatureSensor(){
int value = map(analogRead(pin_1_temperatureSensor), 0, 410, -50, 150);
state = 1;
}
3 - Humidity Sensor
Connection scheme
Scheme made with Fritzing.
Functions
Analog Read
Read Analog State
Reads a analog value.
void function_0_humiditySensor(){
int value = analogRead(pin_0_humiditySensor);
function_0_humiditySensor();
}
int value = analogRead(pin_0_humiditySensor);
void function_0_humiditySensor(){
int value = analogRead(pin_0_humiditySensor);
state = 1;
}
4 - Vibration Sensor
Connection scheme
Scheme made with Fritzing.
Functions
Digital Read
Digital Read State
Reads a digital value.
void function_0_vibrationSensor(){
int value = digitalRead(pin_0_vibrationSensor);
function_0_vibrationSensor();
}
int value = digitalRead(pin_0_vibrationSensor);
void function_0_vibrationSensor(){
int value = digitalRead(pin_0_vibrationSensor);
state = 1;
}
5 - Loudness Sensor
Image by funduino, CC-BY-SA.
Connection scheme
Scheme made with Fritzing.
Functions
Analog Read
Analog Read State
Reads a analog value.
void function_0_Lautst_rke_sensor(){
int value = analogRead(pin_0_loudnessSensor);
function_0_Lautst_rke_sensor();
}
int value = analogRead(pin_0_loudnessSensor);
void function_0_Lautst_rke_sensor(){
int value = analogRead(pin_0_loudnessSensor);
state = 1;
}
6 - Ultrasonic Ranger
Connection scheme
Scheme made with Fritzing.
Functions
Send Wave
Send Wave State
Sends a ultrasonic wave.
void function_0_Ultraschall_messer(){
digitalWrite(pin_2_ultrasonicRanger, LOW);
delay(5);
digitalWrite(pin_2_ultrasonicRanger, HIGH);
delay(10);
digitalWrite(pin_2_ultrasonicRanger, LOW);
function_1_Ultraschall_messer();
}
digitalWrite(pin_2_ultrasonicRanger, LOW);
delay(5);
digitalWrite(pin_2_ultrasonicRanger, HIGH);
delay(10);
digitalWrite(pin_2_ultrasonicRanger, LOW);
void function_0_Ultraschall_messer(){
digitalWrite(pin_2_ultrasonicRanger, LOW);
delay(5);
digitalWrite(pin_2_ultrasonicRanger, HIGH);
delay(10);
digitalWrite(pin_2_ultrasonicRanger, LOW);
state = 1;
}
Receive Wave
Receive Wave State
Receive a ultrasonic wave.
void function_1_Ultraschall_messer(){
long pulseValueFromWave = pulseIn(pin_2_ultrasonicRanger, HIGH);
long value = (pulseValueFromWave/2) * 0.03432;
function_1_Ultraschall_messer();
}
long pulseValueFromWave = pulseIn(pin_2_ultrasonicRanger, HIGH);
long value = (pulseValueFromWave/2) * 0.03432;
void function_1_Ultraschall_messer(){
long pulseValueFromWave = pulseIn(pin_2_ultrasonicRanger, HIGH);
long value = (pulseValueFromWave/2) * 0.03432;
state = 1;
}