2. THE USE OF A GREENHOUSE
FEATURE
We can reproduce different
environmental conditions so that
we can grow different types of
plants, vegetables, etc. even out of
season.
PROBLEM
Depending on what we cultivate we
must ensure that values such as
temperature and humidity remain
in the ideal range for that plant.
3. SCENARIO
• Michele is a farmer, he is 50 and he cultivates tomatoes in a greenhouse
• Sometimes he loses much of the crop due to the greenhouse environmental
values not suitable for growing tomatoes
• It is tiring for him to go and check the temperature and humidity of the
greenhouse every half hour
• The tomato is a vegetable made mostly of water
• The ideal temperature for growing tomatoes is between 20 and 26 °C
• Daytime ideal humidity levels range between 80% and 90%. In contrast,
nighttime levels range slightly lower, between 65 % and 75 %
• If the temperature and humidity levels exceed the ideal range, the tomato
plant becomes more vulnerable to pests and pathogens, especially if bred in a
greenhouse with other plants
5. WHAT WE NEED?
B-L475E-IOT01A Discovery kit for IoT
Connection: Wi-Fi, Bluetooth, NFC
Sensors: Humidity, Temperature, etc.
Arm MBED enabled
HARDWARE SOFTWARE
7. Once created the object, it is
automatically generated:
• a certificate for the object
in question
• a public key
• a private key
Once the object is created, these are
automatically generated:
- A certificate for the object in question.
- A public key
- A private key
8. Finally we have to create a policy for the object. The code shown below
changes the default policy allowing the exchange of messagesFinally we have to create a policy for the object. The code shown below
changes the default policy allowing the exchange of messages.
9. Step 2: The board
• Initializing sensor values, connecting to Wi-Fi.
10. The board
• After connecting to Wi-Fi, connect to cloud, get sensor data.
11. The board
In RealTerm you can see the actual values being sent to AWS IoT, and the
message for connecting to Wi-Fi and to the cloud.
12. On AWS IoT Core
Successful connections Messages published
The received data are saved on a S3 bucket in a json file.
13. Implementation – AWS IoT
To manage our data we can
Create a rule and add actions
like storing updated data in
an S3 bucket or DynamoDB.
14. Step 4: Android App
Connect to AWS IoT through MQTT messaging protocol.
Subscribes to the stm32 Topic.
Shows the values read into the app.
Disconnect if you don’t want to receive anymore notifications.
You can edit the default values for which you want to get
notifications of Humidity and Temperature and click submit.
15. Android App
When Humidity or Temperature values go out
of range you will be notified.
If you are using the phone, you will get a
message on the screen. If the phone is locked
you will get notified by vibration and blinking
of the smartphone LED in Red , or Blue.
If you don’t want to get bothered by
notifications just click Disconnect button in the
app.
16. Android App
MQTT enables the IoT device to send, and publish
information in a given topic.
The publisher publishes the values in the topic, and
the sender subscribes to the channel in order to get
the values.
The Board is the publisher and the mobile device is
the subscriber.
17. Android App
Cognito is used to authorize AWS IoT and
establish a connection.
You have to create an identity pool, and
enable access to authenticated identities.
Two roles will be setup in IAM.
Save the Identity pool ID and note the region
that is being used.
These will be used in the application.
18. Android App
Attach a policy to the role
which has permissions to access
the AWS IoT APIs.
We search for
AWSIoTFullAccess and then
click Attach Policy button.
Add the values of Pool ID and
Region into
awsconfiguration.json