element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Sensors Projects
  • Challenges & Projects
  • Project14
  • Sensors Projects
  • More
  • Cancel
Sensors Projects
Blog Real-Time Laboratory Monitoring
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Sensors Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rahulkhanna
  • Date Created: 5 Nov 2020 10:56 AM Date Created
  • Views 1468 views
  • Likes 5 likes
  • Comments 2 comments
  • mqtt
  • security
  • internet of things
  • sensorsch
  • holidayspecial20
  • holidayspecial20ch
  • iot
  • environmental sensing
Related
Recommended

Real-Time Laboratory Monitoring

rahulkhanna
rahulkhanna
5 Nov 2020
image

Sensors

Enter Your Electronics & Design Project for a chance to win a $200 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage image
Project14 Home
Monthly Themes
Monthly Theme Poll

 

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

image

 

Things used in this project

 

Hardware components
AVR-IoT WG Development Board
Microchip Technology AVR-IoT WG Development Board
×1
Arduino Nano R3
Arduino Nano R3
×1

 

NeoPixel Ring: WS2812 5050 RGB LED
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
×1

 

DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1

 

Grove - Barometer Sensor (BMP280)
Seeed Grove - Barometer Sensor (BMP280)
×1

 

Grove - Gas Sensor(MQ2)
Seeed Grove - Gas Sensor(MQ2)
×1

 

Custom PCB
Custom PCB
×1
Jumper wires (generic)
Jumper wires (generic)
×1

 

Software apps and online services
Atmel START
Microchip Technology Atmel START
Arduino IDE
Arduino IDE
Atmel Studio 7
Microchip Technology Atmel Studio 7
Cloud IoT Core
Google Cloud IoT Core



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 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
image

 

Features:
  • ATmega4808 microcontroller
  • TEMT6000 Light sensor
  • MCP9808 Temperature sensor
  • ATECC608A CryptoAuthenticationTm 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.

 

image

 

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:

 

image

 

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

 

image

 

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.

 

image

 

Now the device is successfully added to the Google Cloud.Go to the ATMEL START program and enter your Project ID,  Registry ID. i.e. Project ID: avr-iot, Registry ID: AVR-IoT and MQTT host: mqtt.googleapis.comin case of my project

 

image

 

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.

 

image

 

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 are 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.

 

image

 

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 the 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.

 

image

 

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 the 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.

 

image

 

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.

 

image

 

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 the case of Microchip, export the project from ATMEL start.

 

image

 

Select the solution configuration as release and debugger as UDPI as nEDBG.

 

image

 

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 Up 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

 

 

image

 

 

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 It 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.

 

 

image

 

Video:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Code Repo: https://github.com/Rahul24-06/Real-time-Laboratory-Monitoring

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

 

If you faced any issues in building this project, feel free to ask me. Please do suggest new projects that you want me to do next.

Share this video if you like.

Blog - https://rahulthelonelyprogrammer.blogspot.com/

Github - https://github.com/Rahul24-06

Instagram - https://www.instagram.com/rahul_khanna_d/

Happy to have you subscribed: https://www.youtube.com/c/rahulkhanna24june?sub_confirmation=1

Thanks for reading!

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 4 years ago +2
    Hi Rahul, Great concept and a well executed project. The stability of conditions in a laboratory are certainly an important factor in understanding test results. Thanks for posting your project. John
  • rahulkhanna
    rahulkhanna over 4 years ago in reply to jw0752 +1
    Thanks for supporting!
  • rahulkhanna
    rahulkhanna over 4 years ago in reply to jw0752

    Thanks for supporting!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jw0752
    jw0752 over 4 years ago

    Hi Rahul,

     

    Great concept and a well executed project. The stability of conditions in a laboratory are certainly an important factor in understanding test results. Thanks for posting your project.

     

    John

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube