Project tutorial
Use the Arduino MKR ENV Shield on a Raspberry Pi

Use the Arduino MKR ENV Shield on a Raspberry Pi © GPL3+

Connect the Arduino MKR ENV shield with a Raspberry Pi and use the shield under Python.

  • 11 views
  • 0 comments
  • 0 respects

Components and supplies

Necessary tools and machines

About this project

PiMKRHAT is an adaptor to use Arduino MKR boards and shields together with the Raspberry Pi. Different Arduino MKR Shields can be used via our HAT as extension for the Raspberry Pi. I want to show in this small project how to use the Arduino MKR ENV shield with a Raspberry Pi under Python.

Hardware

The PiMKRHAT comes as kit. You have to assemble it first. Please follow the attached assembly instruction

Jumper setting

Please set for the Arduino MKR ENV shield only the 5V and 3, 3V Jumper on the Power jumper bank. Leave all other jumpers open.

Raspbian

Please download the latest Raspbian OS for the Raspberry Pi and copy it to an SD card via Pi imager

Configuring I2C

The sensors on the MKR ENV shield are using I2C communication. You have to install some libraries first via the bash:

sudo apt-get install -y python-smbus
sudo apt-get install -y i2c-tools 

Now you have to enable the I2C interface:

sudo raspi-config
--> 5 Interfacing Options
--> P5 I2C--> YES
sudo reboot

Testing I2C

Now it's time to test the I2C interface:

sudo i2cdetect -y 1

This shows that two I2C addresses are in use – 0x10, 0x5c and 0x5f

Install additional libraries

sudo apt install python-pip
sudo pip install veml6075

Test

3 little Python programs are available to test the UV radiation, temperature & humidity and pressure sensor of the MKR ENV shield:

HTS221.py -temperature and humidity

LPS22HB.py - pressure

VEML6075.py - UV radiation

The analogue light sensor requires an analogue input and can not be used with the Raspberry Pi.

Code

sample Python programs
for Arduino MKR ENV Shield

Schematics

Assembly instruction

Comments

Similar projects you might like

Arduino + Raspberry Pi + Ubidots Made Easy

Project tutorial by David Escobar

  • 16,430 views
  • 4 comments
  • 44 respects

Raspberry Pi - Powered Candy Dispenser

Project tutorial by Arduino “having11” Guy

  • 8,727 views
  • 1 comment
  • 15 respects

Custom LED Lights on DIY Electric Skateboard - Raspberry Pi

Project tutorial by Matt Timmons-Brown

  • 4,533 views
  • 2 comments
  • 14 respects

Arduino MKR DIN Rail Mount

Project showcase by hwhardsoft

  • 3,996 views
  • 0 comments
  • 7 respects

Alexa Controlled LEDs Through Raspberry Pi

Project tutorial by vincent wong

  • 8,373 views
  • 6 comments
  • 30 respects
Add projectSign up / Login