This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Sensors

Sensors will gather input from the environment.

1 - Motion Sensor

A motion sensor detects motion within a certain range.
Information

Type : Sensor

Mode : Digital

Pins : 0-14

Output Values : 0-1

Tutorial : funduino

Image by funduino, CC-BY-SA.

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

A temperature sensor measures the current temperature in the air.
Information

Type : Sensor

Mode : Analog

Pins : 0-7 (analog)

Output Values : Value in Celsius (0-40)

Tutorial : funduino

Note: The value needs to be transformed to celsius! See code below.

Image by funduino, CC-BY-SA.

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

A humidity sensor measures the humidity of earth or water.
Information

Type : Sensor

Mode : Analog

Pins : 0-7 (analog)

Output Values : 0-1023

Tutorial : funduino

Note: Only the lower parts can get wet!

Image by funduino, CC-BY-SA.

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

A vibration sensor detects vibration next to it.
Information

Type : Sensor

Mode : Digital

Pins : 0-14

Output Values : 0-1

Tutorial : funduino

Image by funduino, CC-BY-SA.

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

A loudness sensor measures noise.
Information

Type : Sensor

Mode : Analog

Pins : 0-7 (analog)

Output Values : 0-1023

Tutorial : polluxlabs

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

A ultrasonic ranger uses a ultrasonic wave to measure a distance.
Information

Type : Sensor

Mode : Digital

Pins : 0-14

Output Values : Distance in cm (2-300)

Tutorial : funduino

Note: To use this component use the two states to send and receive a wave!

Note: The read value needs to be transformed! See code below

Image by funduino, CC-BY-SA.

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; 
}