|
|
In order to show the interoperability of the AAS components analog and digital sensors have been installed on the demonstration stand.
|
|
|
|
|
|
# Sensor implementation
|
|
|
|
|
|
## General
|
|
|
|
|
|
In order to display a functional asset administration shell, five different sensors were used on the demonstration stand.
|
|
|
|
|
|
In this following section, the data retrieved and additional information for each sensor are shown.
|
|
|
|
|
|
### Joy-It KY-015 Kombi Sensor
|
|
|
|
|
|
This Sensor is used to digitally measure the temperature and humidity in its environment.
|
|
|
It is very similar to a DHT11 Sensor. The adafruit.DHT library is used to get the values from the sensor.
|
|
|
|
|
|
When accessed through the Asset Administration Shell the following example json data will be sent as a response:
|
|
|
|
|
|
{
|
|
|
tempSensor:
|
|
|
{
|
|
|
model: Joy-It KY-015 Kombi Sensor,
|
|
|
type: digital,
|
|
|
sensor_pin: D17,
|
|
|
temperature_values:
|
|
|
{
|
|
|
celsius: 23 C,
|
|
|
fahrenheit: 77 F,
|
|
|
},
|
|
|
humidity: 25 %
|
|
|
}
|
|
|
}
|
|
|
|
|
|
### Joy-It KY-023 Joystick
|
|
|
|
|
|
This Sensor is used to implement a joystick interface.
|
|
|
This sensor is solely returning analog values which will be fed into a MCP3008 microchip. The MCP3008 then generates an output signal and sends it to the raspberry pi zero. The adafruit.DHT library is used to get the values from the sensor.
|
|
|
|
|
|
The analog values will be interpreted and a joystick_state as string will be calculated.
|
|
|
|
|
|
When accessed through the Asset Administration Shell the following example json data will be sent as a response by the joystick:
|
|
|
|
|
|
{
|
|
|
joystickSensor:
|
|
|
{
|
|
|
model: Joy-It KY-023 Joystick,
|
|
|
type: analog,
|
|
|
values:
|
|
|
{
|
|
|
x_value:
|
|
|
{
|
|
|
mcp3008_channel: 2,
|
|
|
raw_value: 2050
|
|
|
},
|
|
|
y_value:
|
|
|
{
|
|
|
mcp3008_channel: 3,
|
|
|
raw_value: 0
|
|
|
}
|
|
|
},
|
|
|
joystick_state: left
|
|
|
}
|
|
|
}
|
|
|
|
|
|
### Joy-It KY-018 Fotowiderstand
|
|
|
|
|
|
This Sensor is used as a light sensor. It can output solely a digital value. The value can only determine if a threshold value is crossed or not. The light sensor therefore outputs whether its surrounding environment is bright or dark.
|
|
|
|
|
|
When the digital output of the light sensor is accessed through the Asset Administration Shell the following example json data will be sent as a response:
|
|
|
|
|
|
{
|
|
|
lightSensor:
|
|
|
{
|
|
|
model: Joy-It KY-023 Joystick,
|
|
|
type: digital,
|
|
|
sensor_pin: 17,
|
|
|
isBright: False,
|
|
|
isDark: True,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
### Joy-It KY-038 Soundsensor
|
|
|
|
|
|
This Sensor is used as a sound sensor. It can output both analog and digital signals.
|
|
|
|
|
|
The digital value can determine whether a sound has crossed a certain threshold which can be adjusted via a turning knob on the sensor.
|
|
|
|
|
|
If the intensity of a sound has crossed the threshold within three seconds after the read command has been triggered the sound_detected value from the json output will be True, otherwise False.
|
|
|
|
|
|
Here is an example output of the json:
|
|
|
|
|
|
{
|
|
|
soundSensor:
|
|
|
{
|
|
|
model: Joy-It KY-038 Soundsensor,
|
|
|
type: digital,
|
|
|
sensor_pin: 17,
|
|
|
sound_detected: True
|
|
|
}
|
|
|
}
|
|
|
|
|
|
The analog value will be fed into a MCP3008 microchip. The MCP3008 then generates an output signal and sends it to the raspberry pi zero.
|
|
|
|
|
|
The analog values will be interpreted and a loud_sound_detected state will be determined.
|
|
|
|
|
|
Here is an example output of the json for the analog value:
|
|
|
|
|
|
{
|
|
|
soundSensor:
|
|
|
{
|
|
|
model: Joy-It KY-038 Soundsensor,
|
|
|
type: analog,
|
|
|
mcp3008_channel: 1,
|
|
|
raw_value: 1780,
|
|
|
gain: 8.7,
|
|
|
loud_sound_detected: True
|
|
|
}
|
|
|
}
|
|
|
|
|
|
### Joy-It KY-028 Thermistor
|
|
|
|
|
|
This Sensor is used as a temperature sensor. It can output both analog and digital signals.
|
|
|
|
|
|
The digital value can determine whether the raw voltage value has crossed a certain threshold which can be adjusted via a turning knob on the sensor.
|
|
|
|
|
|
If the value of the temperature has crossed the threshold_reached value from the json output will be True, otherwise False.
|
|
|
|
|
|
Here is an example output of the json:
|
|
|
|
|
|
{
|
|
|
tempSensor:
|
|
|
{
|
|
|
model: Joy-It KY-028 Thermistor,
|
|
|
type: digital,
|
|
|
sensor_pin: 17,
|
|
|
threshold_reached: True
|
|
|
}
|
|
|
}
|
|
|
|
|
|
The analog value will be fed into a MCP3008 microchip. The MCP3008 then generates an output signal and sends it to the raspberry pi zero.
|
|
|
|
|
|
The analog values will be interpreted and a hand_detected state will be determined. The hand detected state can be triggered by holding the thermistor between two fingers for at least 15 seconds and then running the read ananlog command via the AAS.
|
|
|
|
|
|
Here is an example output of the json for the analog value:
|
|
|
|
|
|
{
|
|
|
tempSensor:
|
|
|
{
|
|
|
model: Joy-It KY-028 Thermistor,
|
|
|
type: analog,
|
|
|
mcp3008_channel: 0,
|
|
|
raw_value: 2005,
|
|
|
gain: 9.8,
|
|
|
hand_detected: True
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|