Grove Connector Shield for Adafruit Boards, part 2
Welcome back to the second part of our ThingForward Grove Connector Shield blogpost that we will be showing you more about on our Grove Connector Shield. If you haven't read the first blogpost so far, please read it first by following the link: Grove Connector Shield - Part 1
The main motivation of producing this connector shield is to simplify hardware connections and programming part of your embedded/IoT project. This module will allow you to implement your sensors/actuators easier and faster. It also helps you to get rid of the breadboard and cables. Thanks to this small connector shield, the practicality of Grove sensors/actuators is compatible with your project now!
Today we will be flashing some code in order to test our connector shield in a real life use case. Now, let's start to observe its functionality by connecting the sensors. For testing it, we need:
- 1x ThingForward Shield
- 1x Feather M0 Express MCU
- 1x Feather OLED 32x128 Grayscale
- 1x Grove Blueberry BME280 Sensor
- 1x Grove Motion Sensor
- 1x Grove LED
- 3x Grove cables
- PlatformIO Membership
Understanding the Hardware Connections:
The connections will be:
- I2C Port: BME280 Sensor
- UART Port: Motion Sensor
- A/D Port: LED
The setup of the system will be
- Bottom Layer: ThingForward Shield
- Middle Layer: Feather M0 Express MCU
- Top Layer: Feather OLED
The idea of this project is simple: It is a weather station prototype with motion-sensor LED. By using the BME280 sensor, the temperature, humidity and pressure values are obtained. The motion sensor will capture the movements and makes LED on. The IP address of the WiFi controller, the temperature value will be printed on 32x128 OLED screen on top.
This application will be also testing the functionality of I2C and A/D GPIO ports of our connector shield. Now, let's upload the code!
Uploading the Code:
Here are the step by step instructions for coding:
- Clone the example repository from Github:
$ git clone https://github.com/emirez/feather_m0_bme280_oled.git
- Go to project file and install the libraries:
$ cd feather_m0_bme280_oled
- Install Adafruit SSD11306 Library for OLED screen:
$ pio lib install 135
- Install Adafruit_GFX library for OLED screen
$ pio lib install 188
- Install BME280 sensor library:
$ pio lib install 5348
- Install Adafruit Unified Sensor library for sensors:
$ pio lib install 31
Now you can flash the MCU and see what happens! To do so:
$ pio run -t upload && pio device monitor
After uploading the code, the OLED screen will start up with Adafruit logo and text, and then:
As you can see from the image, the room temperature in celsius can be read from OLED screen. With the help of motion sensor, whenever something moves in the range of it, the LED is lit.
No jumper cables, no breadboard, no soldering! Just a Grove cable is enough for connecting sensors and actuators. No need to say, you can customise your code according to your needs, connect it to the cloud, send/receive the sensor data or invoke some methods. For all the possible use cases and learning how to do them, please read our former blogposts.
To sum up, there is always a way to make something easier and more practical. Our Grove connector shield works as we want it to. This developer-friendly shield allows you to save your time and decrease hardware development efforts. I2C port helps us to connect special sensors like BME280 or directly for I2C communications. A/D port allows us to connect LEDs or other sensors, no matter if they're analog or digital. With UART port we can connect LPWAN modules like NB-IoT adapters. This small but powerful MCU has a great supporter for prototyping or IoT projects.
On the following blogpost, we will be combining our Grove connector shield with narrowband hardware.
Stay tuned for upcoming blogposts!
Eren Mert Irez