Search

Real-time Laboratory Monitoring

About the project

Design and build a system to monitor the status of a Laboratory using the Microchip AVR-IoT WG Development Board.

Project info

Difficulty:

Platforms:

Estimated time:

3 hours

Published:

15th April 2019

Items used in this project

Hardware components

AVR-IOT WG Evaluation Board x 1
Arduino Nano 3.1 W/ATMEGA328 NO-PIN x 1
NeoPixel Ring RGB LED 24 x WS2812 x 1
DHT11 Basic Temp Humidity Sensor x 1
Gravity i2C BMP280 Barometer Sensor x 1
Gas Sensor -MQ5 x 1
General PCB x 1
10 JUMPER WIRES 150mm x 1

Software app and online services

Atmel Start
Arduino IDE
Atmel Studio 7
Google Cloud

Story

Why Did We Build this?

The Maintenance of the ambience in places such as Laboratory, especially chemical lab is essential. The Temperature, humidity and the ambient light has to be monitored continuously and the level of Air quality and heat levels are used as interrupt to prevent the Laboratory accidents. 

Hardware Build:

First of all, I would like to thank Electromaker.io and Microchip for supporting this project with the Amazing AVR-IoT WG Development Board, I really felt informative using this board and able to achieve some of the complex projects integrated within a PCB.

Basic Hardware Components:

AVR-IoT WG Development Board:

  • Go from out-of-the-box to cloud-connected in 30 seconds
  • Onboard 8-bit MCU brings the processing power and simplicity of the AVR architecture with Core Independent Peripherals (CIPs) which further decrease power consumption
  • Secure authentication with hardware-based private key storage

Features:

  • ATmega4808 microcontroller
  • TEMT6000 Light sensor
  • MCP9808 Temperature sensor
  • ATECC608A CryptoAuthentication™ device
  • WINC1510 WiFi Module
  • On-board nEDBG Debugger
  • USB and battery powered
  • Integrated Li-Ion/LiPo battery charger

Arduino Nano:

Arduino Nano is a small board compatible with breadboards which is compatible with ATMega328. It has comparable usefulness to the Arduino Uno, however, when it comes to DIP module package, it works with a Mini-B USB link. This Arduino clone board is superbly compatible with Arduino IDE.

                                              

Step 1: Getting started with Microchip's AVR-IOT wg Board

This board has an inbuilt temperature sensor and a light sensor which a preloaded firmware that publishes the data from the sensors to cloud.

The AVR-IoT WG development board features two sensors:

            • A light sensor

            • A high-accuracy temperature sensor - MCP9808 

In addition to this, we use a few more sensors with Arduino that will be explained in the further part.

Step 2: Adding the device to the Cloud:

First Login to the Google IOT core and create a new project and note your Project ID which will be needed later, when you program the hardware to connect to the project.

Note: Here I had used a free trial account. Complete your billing procedure to enable the API.

In the Google Cloud console, you can find the IOT core at the sidebar.

Create a registry: 

To Register the device: 

Note the Device ID from the Click me file, which will direct you to a link. 

In the next form, Fill up device ID with an alphabet at first, the Public key format is of ES256 which can be verified, and add the PUBKEY.txt file in the add device page.

Now the device is successfully added to the Google Cloud.

Go to the ATMEL START program and enter your Project IDRegistry ID. i.e. Project ID: avr-iot, Registry ID: AVR-IoT and MQTT host: mqtt.googleapis.com in case of my project 

Finally, Export the project to ATMEL Studio 7 and enable the debugger to start the program.

Step 3: Interfacing other sensors using Arduino:

Connecting the peripheral to the Arduino:

Now we will see how to interface the other sensors with Arduino nano.

Interfacing DHT11:

The DHT11 sensor detects water vapor by measuring the electrical resistance between the two electrodes. The humidity sensing component is a moisture holding substrate. When water vapor is absorbed by the substrate, the ions are released by the substrate which increases the conductivity between the electrodes. The change in resistance between the two electrodes is proportional to the relative humidity computed. Higher relative humidity(RH) decreases the resistance between the electrodes, while lower relative humidity increases the resistance between the electrodes i.e Relative humidity is inversely proportional to the resistance between two electrodes.

Here we connect the DHT11 temperature and humidity sensor to the digital pin of the Arduino.

The Digital pin 7 of Arduino nano is used for the Output signal. 

Connections:

Arduino ------------------------------------- DHT11

VCC(3.3v)                  ->                        Vcc(3.3v)

GND                            ->                        Ground(0V)

D7                                ->                         Signal

The Temperature and the humidity from the DHT11 is calculated and stored in the variables which will be carried to the next section of the project.

Interfacing Neopixel:

Then we connect the Neopixel to the digital pin of the Arduino.

The Digital pin 2 of Arduino nano is used as Data IN. 

Connections :

Arduino ------------------------------------- WS2816

VCC(3.3v)                  ->                        Vcc(3.3v)

GND                            ->                        Ground(0V)

D2                                 ->                        DI (Data IN)

The Neopixel library is attached in the repository.

The Neopixel Ring which I had used is a 16 bit neopixel, i.e. The Ring consists of 16 LEDs.

The Color of the Neopixel is switched depending on the temperature and humidity stored in the variables.

Interfacing BMP280 sensor:  

The BMP280 air pressure sensor from Bosch gives the measured air pressure (ambient air pressure) and the ambient temperature as raw values, whereby the output can now be either via I2C or via SPI interface. But also the BMP280 waits with some improvements compared to the BMP180.

The default I2C address of the mapped module is 0x76 and can be changed to 0x77 with a solder bridge on the module.

Here I had used SPI protocol to communicate with Arduino.

With the aid of 12 compensation parameters stored in the sensor, it is possible to determine the atmospheric pressure at the location (station level air pressure), altitude and the ambient temperature from the raw values.

The I2C pins of Arduino nano are A4 & A5. 

Connections :

Arduino ------------------------------------- BMP280

VCC(3.3v)                  ->                        Vcc(3.3v)

GND                            ->                        Ground(0V)

D10                               ->                         CS

D11                               ->                         MOSI

D12                               ->                         MISO 

D13                               ->                         SCK  

Interfacing Air sensor:

Here I interface MQ5 Gas sensor which is a generic Gas Sensor available in the market which is more suited to detect and determine LPG concentrations. 

This module has two output possibilities

  • The analog output can be used to detect Gas leakage and to measure the volume of Gas leakage using certain algorithms which are implemented in the firmware and the level of Gas leakage is specified in ppm.
  • The digital out can be used to detect Gas leakage. When there is a leakage of gas, an Interrupt is set by the Arduino which indicates the leakage of gas.

The Digital pin 8 of Arduino nano is used for the Output signal. 

Connections :

Arduino ------------------------------------- MQ5

VCC(3.3v)                  ->                        Vcc(3.3v)

GND                            ->                        Ground(0V)

D8                                ->                         Data

Interfacing Buzzer:

A buzzer is added to the circuit to alert in case of an emergency. 

The Digital pin 9 of Arduino nano is used for Output signal which is a PWM signal. 

Connections :

Arduino ------------------------------------- Buzzer 

D9                                ->                         VCC

GND                            ->                        Ground(0V)

Step 4: Uploading the Firmware:

Before uploading the firmware, we have to create a bus to connect Arduino with the Microchip AVR-IOT-WG Board. 

Connections :

Arduino -------------------------------------  Microchip AVR-IOT-Wg Board

VCC(3.3v)                  ->                        Vcc(3.3v)

GND                            ->                        Ground(0V)

D0 (RX)                        ->                         PC0 (TX)

D1 (TX)                         ->                         PC1 (RX)

 

Once the Connection is done upload the code for sensors using Arduino IDE. 

The code is added the GitHub Repository which can be found in the Code section. 

In case of Microchip, Export the project from ATMEL start. 

Select the Solution configuration as Release and Debugger as UDPI as nEDBG. 

Finally press the green arrow next to Solution configuration to start the program. 

Note: Make sure that the program is properly uploaded without errors. i.e. you'll can find the writing process in the Output dialog.

Step 5: Setting the Google Cloud for Publish and Subscribe:

Create a new function in the Google Cloud Functions.

Set the following parameters: 

  •     Trigger -  Cloud Pub/Sub 
  •      Topic - AVR-IOT

It automatically generates the code for PUB/SUB functions.

Step 6: Enclosure: 

I had used an Acrylic enclosure for this project.

First, I placed all the circuitry inside the enclosure and screw it firmly. 

I made a small opening for the Neopixel Ring and for the Light and Temperature sensor. 

Finally, all the screw are firmly mounted and the power cable is inserted via a slot. 

Step 7: Let's see the working: 

You can find the data is being published on the Google cloud. 

This data which is logged can be display on either a website or with a Mobile application. 

Video:

After this contest, I will update the project with more improvements.

Many thanks to Electromaker for allowing me and all the users of this great platform to participate.

Thank you for carrying out these activities that encourage young people and teenagers to create and invent.

Give a thumbs up if it really helped you and do follow my channel for interesting projects :)

Share this video if you like.

Happy to have you subscribed: https://www.youtube.com/channel/UCks-9JSnVb22dlqtMgPjrlg/videos

Thanks for reading!

Schematics

AVR-IoT WG Development Board

Code

Credits

the lonely programmer

Passionate Techie ! Robotics | Electronics | Programming Hey Geek! If you are in search of electronics projects, Arduino based projects or any Micro-controller based projects, this channel is for you. In this channel, we build electronics projects using the impressive and low-cost boards that are available today. If you are a maker or if you want to learn how to make your own Arduino projects and other interesting Robots, do subscribe the channel to be a part of this community. We develop our own hardware and software projects and will try to build something new. Don’t worry if you don’t know how to program. I'll share the algorithm if you face any difficulties.


Leave your feedback...