
Hi !
I’m a big fan of SeeedStudio Grove products. When you are prototyping IoT devices, the grove connectors are super fast way to work. You basically avoid all the wiring, and just connect cables betwen a IoT device like a Raspberry Pi, and sensors like a Temperature and Humidity monitor. Again, no wiring, no proto-boards, just plug and play.
I started with Grove back in Spain, mostly working with Arduino, thanks to Ramon (my former boss). And today I really enjoy the suite of sensors / actors that we have in other platforms, like Raspberry Pi, Azure Sphere, and more.
All the grove devices usually come with code sample, and libraries in C++ for Arduino based devices, and also in Python for the Raspberry Pi family. And this is my main goal for these posts:
Show how we can use a grove sensor in a Raspberry Pi, in an Azure IoT Module.
Let’s start with a simple scenario using these elements
- Raspberry Pi
- Grove Base Hat for Raspberry Pi
- Grove – Temperature&Humidity Sensor (DHT11)
And about the sensor
This Temperature&Humidity sensor provides a pre-calibrated digital output. A unique capacitive sensor element measures relative humidity and the temperature is measured by a negative temperature coefficient (NTC) thermistor. It has excellent reliability and long term stability. Please note that this sensor will not work for temperatures below 0 degree.

Next step is to follow the instructions to install the python dependencies, and then we can run this code to get the values from the sensor.
import time
import seeed_dht
def main():
# for DHT11/DHT22
sensor = seeed_dht.DHT("11", 12)
# for DHT10
# sensor = seeed_dht.DHT("10")
while True:
humi, temp = sensor.read()
if not humi is None:
print('DHT{0}, humidity {1:.1f}%, temperature {2:.1f}*'.format(sensor.dht_type, humi, temp))
else:
print('DHT{0}, humidity & temperature: {1}'.format(sensor.dht_type, temp))
time.sleep(1)
if __name__ == '__main__':
main()
And the output is as expected

So 1st step is easy, in the next posts I’ll share some of the challenges and lesson learned moving this to an Azure IoT Module.
References
Happy coding!
Greetings
El Bruno
More posts in my blog ElBruno.com.
More info in https://beacons.ai/elbruno
Azure ☁ IoT
- Install ☁ Azure IoT on Raspberry Pi
- Deploy ☁ Azure Blob Storage on IoT Edge, lessons learned
- Connect to ☁ Azure Blob Storage on IoT Edge using Microsoft Azure Storage Explorer
- Lesson learned and tips on how to install Azure IoT Edge on Ubuntu on a Raspberry Pi
- Azure IoT Explorer, in preview and awesome
- Mapping a local ☁ Azure IoT Edge folder module with an Edge device folder 📁
- Creating a folder 📂 in the docker definition in an ☁ Azure IoT Edge
- Granting access to Raspberry Pi GPIO from an ☁ Azure IoT Edge Module
Create an Azure IoT Module using Raspberry Pi and Grove Sensors
- Raspberry Pi + Grove Sensors, read temperature and humidity values
- Raspberry Pi + Grove Sensors, send temperature and humidity values as telemetry to Azure IoT Hub
- Raspberry Pi + Grove Sensors, create a Azure IoT Module to send temperature and humidity values as telemetry to Azure IoT Hub
- Raspberry Pi + Grove Sensors, publish and use the Azure IoT Module
- Raspberry Pi + Grove Sensors, notes on build and configuration
- Raspberry Pi + Grove Sensors, details on how to send a telemetry message and sample messages
Create an Azure IoT Module from Azure Custom Vision project
- Create and export a Custom Vision Project as Docker image
- Analyze the content of the CV Docker image
- Create and analyze an Azure IoT Module
- Merge the CV project as an Azure IoT Module
- Deploy to an Azure IoT device and test the CV module
- Send telemetry for each analyzed image
- Add digital twin configuration to the Azure IoT module (coming soon)
¿Con ganas de ponerte al día?
En Lemoncode te ofrecemos formación online impartida por profesionales que se baten el cobre en consultoría:
- Si tienes ganas de ponerte al día con Front End (ES6, Typescript, React, Angular, Vuejs…) te recomendamos nuestros Máster Front End: https://lemoncode.net/master-frontend#inicio-banner
- Si te quieres poner al día en Backend (stacks .net y nodejs), te aconsejamos nuestro Bootcamp Backend: https://lemoncode.net/bootcamp-backend#bootcamp-backend/banner
- Y si tienes ganas de meterte con Docker, Kubernetes, CI/CD…, tenemos nuestro Bootcamp Devops: https://lemoncode.net/bootcamp-devops#bootcamp-devops/inicio