A look at the Arch from Seeed

In this article we look at the Arch from Seeed. Its an MBed compatible board with Arduino headers fitted and is reasonably low cost

Features

NXP LPC11U24 MCU
Low power ARM Cortex-M0 Core
48MHz, 32KB Flash, 8KB RAM, 4KB EEPROM
USB Device, 2xSPI, UART, I2C

Here is a pinout of the Arch

 

Code

Some simple flashy LED examples that use the mbed online compiler

To program the device you do the following

The button of Arch is specially designed to provide two functions:

Quick press to reset
Long press to enter USB ISP mode, a CRP DISABLD disk will pop up.
On Windows, replace firmware.bin with your program binary file generated from the MBed compiler

Example 1

#include "mbed.h"
 
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
DigitalOut myled4(LED4);
 
int main() {
    while(1) {
        myled1 = 1;
        wait(0.2);
        myled1 = 0;
        wait(0.2);
        myled2 = 1;
        wait(0.5);
        myled2 = 0;
        wait(0.2);
        myled3 = 1;
        wait(0.7);
        myled3 = 0;
        wait(0.2);
        myled4 = 1;
        wait(0.9);
        myled4 = 0;
        wait(0.2);
    }
}

 

Example 2

#include "mbed.h"
 
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
DigitalOut myled4(LED4);
 
int main() {
    while(1) {
        myled1 = 1;
        myled2 = 1;
        myled3 = 1;
        myled4 = 1;
        wait(0.5);
        myled1 = 0;
        myled2 = 0;
        myled3 = 0;
        myled4 = 0;
        wait(0.5);
 
    }
}

 

We will use this for MBed examples

Share

Arduino Due and VEML6075 sensor

Another VEML sensor, this time its a VEML6075 and again we connect it to an Arduino Due

The VEML6075 senses UVA and UVB light and incorporates photodiode, amplifiers, and analog / digital circuits into a single chip using a CMOS process. When the UV sensor is applied, it is able to detect UVA and UVB intensity to provide a measure of the signal strength as well as allowing for UVI measurement.

The VEML6075 provides excellent temperature compensation capability for keeping the output stable under changing temperature. VEML6075’s functionality is easily operated via the simple command format of I2C (SMBus compatible) interface protocol. VEML6075’s operating voltage ranges from 1.7 V to 3.6 V.

 

Parts List

Amount Part Type
1 VEML6075
1 Compatible DUE R3 Board SAM3X8E 32-bit ARM Cortex-M3

 

Layout

 

arduino due and VEML6075 layout

arduino due and VEML6075 layout

 

Code

Again we use a library and again its an adafruit one

This is the full example

#include <Wire.h>
#include "Adafruit_VEML6075.h"
 
Adafruit_VEML6075 uv = Adafruit_VEML6075();
 
void setup() {
  Serial.begin(115200);
  Serial.println("VEML6075 Full Test");
  if (! uv.begin()) {
    Serial.println("Failed to communicate with VEML6075 sensor, check wiring?");
  }
  Serial.println("Found VEML6075 sensor");
 
  // Set the integration constant
  uv.setIntegrationTime(VEML6075_100MS);
  // Get the integration constant and print it!
  Serial.print("Integration time set to ");
  switch (uv.getIntegrationTime()) {
    case VEML6075_50MS: Serial.print("50"); break;
    case VEML6075_100MS: Serial.print("100"); break;
    case VEML6075_200MS: Serial.print("200"); break;
    case VEML6075_400MS: Serial.print("400"); break;
    case VEML6075_800MS: Serial.print("800"); break;
  }
  Serial.println("ms");
 
  // Set the high dynamic mode
  uv.setHighDynamic(false);
  // Get the mode
  if (uv.getHighDynamic()) {
    Serial.println("High dynamic reading mode");
  } else {
    Serial.println("Normal dynamic reading mode");
  }
 
  // Set the mode
  uv.setForcedMode(false);
  // Get the mode
  if (uv.getForcedMode()) {
    Serial.println("Forced reading mode");
  } else {
    Serial.println("Continuous reading mode");
  }
 
  // Set the calibration coefficients
  uv.setCoefficients(2.22, 1.33,  // UVA_A and UVA_B coefficients
                     2.95, 1.74,  // UVB_C and UVB_D coefficients
                     0.001461, 0.002591); // UVA and UVB responses
}
 
 
void loop() {
  Serial.print("Raw UVA reading:  "); Serial.println(uv.readUVA());
  Serial.print("Raw UVB reading:  "); Serial.println(uv.readUVB());
  Serial.print("UV Index reading: "); Serial.println(uv.readUVI());
 
  delay(1000);
}

 

Output

Open the serial monitor – this is what I saw but I tested this indoors

VEML6075 Full Test
Failed to communicate with VEML6075 sensor, check wiring?
Found VEML6075 sensor
Integration time set to 50ms
Normal dynamic reading mode
Continuous reading mode
Raw UVA reading: 0.00
Raw UVB reading: 0.00
UV Index reading: 0.00
Raw UVA reading: 0.00
Raw UVB reading: 0.00
UV Index reading: 0.00

Links

https://www.vishay.com/docs/84304/veml6075.pdf

I2C Interface 3.3V Board Based on VEML6075 UVA UVB Light Sensor Module

Share

Arduino Due and VEML6070 UV sensor

In this example we look at an VEML6070 UV sensor and connect it to an Arduino Due

Lets take a look at the sensor first

The VEML6070 is an advanced ultraviolet (UV) light sensor with I2C protocol interface and designed by the CMOS process. It is easily operated via a simple I2C command. The active acknowledge (ACK) feature with threshold windows setting allows the UV sensor to send out a UVI alert message. Under a strong solar UVI condition, the smart ACK signal can be easily implemented by the software programming. VEML6070 incorporates a photodiode, amplifiers, and analog / digital circuits into a single chip. VEML6070’s adoption of FiltronTM UV technology provides the best spectral sensitivity to cover UV spectrum sensing. It has an excellent temperature compensation and a robust refresh rate setting that does not use an external RC low pass filter.

VEML6070 has linear sensitivity to solar UV light and is easily adjusted by an external resistor. Software shutdown mode is provided, which reduces power consumption to be less than 1 μA. VEML6070’s operating voltage ranges from 2.7 V to 5.5 V.

You can find out about the UV index at the following link – https://en.wikipedia.org/wiki/Ultraviolet_index

The easiest way to work with this sensor is to buy a module – this is a picture of the module that I bought

Layout

 

 

arduino due and VEML6070 layout

arduino due and VEML6070 layout

 

 

Code

I used the Adafruit library – https://github.com/adafruit/Adafruit_VEML6070

#include <Wire.h>
#include "Adafruit_VEML6070.h"
 
Adafruit_VEML6070 uv = Adafruit_VEML6070();
 
void setup() 
{
  Serial.begin(9600);
  Serial.println("VEML6070 Test");
  uv.begin(VEML6070_1_T);  // pass in the integration time constant
}
 
 
void loop() 
{
  Serial.print("UV light level: "); 
  Serial.println(uv.readUV());
  delay(1000);
}

 

Output

Open the serial monitor – just as a note in my example I was indoors

VEML6070 Test
UV light level: 0
UV light level: 0
UV light level: 0
UV light level: 0
UV light level: 0
UV light level: 0

 

Link

You can pick up one of these sensors for about $2.50

UV sensor module VEML6070 UV Sensitivity Detection Sensor for Arduino

Share

Arduino Due and SHT20 sensor

In this article we connect an SHT20 sensor to an Arduino Due

The SHT2x series consists of a low-cost version with the SHT20 humidity sensor. the SHT2x provides calibrated, linearized sensor signals in digital, I2C format. The SHT2x humidity sensor series contains a capacitive-type humidity sensor, a band-gap temperature sensor, and specialized analog and digital integrated circuits – all on a single CMOSens® chip. This yields superior sensor performance in terms of accuracy and stability as well as minimal power consumption.

Every sensor is individually calibrated and tested. Furthermore, the resolution of the SHT2x humidity sensor can be changed on command (8/12 bit up to 12/14 bit for RH/T) and a checksum helps to improve communication reliability.

Performance

  • Size: 3 x 3 x 1.1mm
  • Output: I²C digital, PWM, SDM
  • Supply voltage range: 2.1 to 3.6V
  • Energy consumption:  3.2µW (at 8 bit, 1 measurement/s)
  • RH operating range: 0 – 100%RH
  • T operating range:  -40°C to +125°C (-40°F to +257°F)
  • RH response time: 8 sec (tau63%)

Parts List

 

Amount Part Type
1 Temperature and humidity detection sensor module SHT20
1 Compatible DUE R3 Board SAM3X8E 32-bit ARM Cortex-M3

 

Schematics/Layout

 

arduino due and SHT20 layout

arduino due and SHT20 layout

 

Code

We use the following library – https://github.com/DFRobot/DFRobot_SHT20

#include <Wire.h>
#include "DFRobot_SHT20.h"
 
DFRobot_SHT20    sht20;
 
void setup()
{
    Serial.begin(9600);
    Serial.println("SHT20 Example!");
    sht20.initSHT20();                                  // Init SHT20 Sensor
    delay(100);
    sht20.checkSHT20();                                 // Check SHT20 Sensor
}
 
void loop()
{
    float humd = sht20.readHumidity();                  // Read Humidity
    float temp = sht20.readTemperature();               // Read Temperature
    Serial.print("Time:");
    Serial.print(millis());
    Serial.print(" Temperature:");
    Serial.print(temp, 1);
    Serial.print("C");
    Serial.print(" Humidity:");
    Serial.print(humd, 1);
    Serial.print("%");
    Serial.println();
    delay(1000);
}

 

Output

Open the serial monitor – this is what I saw

SHT20 Example!
End of battery: no
Heater enabled: no
Disable OTP reload: yes
Time:202 Temperature:18.8C Humidity:64.3%
Time:1302 Temperature:18.8C Humidity:64.3%
Time:2402 Temperature:18.8C Humidity:64.2%
Time:3502 Temperature:20.2C Humidity:64.4%
Time:4602 Temperature:23.3C Humidity:67.4%
Time:5702 Temperature:24.7C Humidity:72.2%
Time:6802 Temperature:25.5C Humidity:75.0%
Time:7902 Temperature:26.1C Humidity:76.2%
Time:9002 Temperature:26.7C Humidity:76.7%

 

Links

Sensirion_Humidity_Sensors_SHT20_Datasheet.pdf

 

Share

Arduino Due and CCS811 gas sensor example

In this article we connect a CCS811 gas sensor to an Arduino Due

CCS811 is a low-power digital gas sensor solution, which integrates a gas sensor solution for detecting low levels of VOCs typically found indoors, with a microcontroller unit (MCU) and an Analog-to-Digital converter to monitor the local environment and provide an indication of the indoor air quality via an equivalent CO2 or TVOC output over a standard I2C digital interface.

Features

Integrated MCU
On-board processing
Standard digital interface
Optimised low power modes
IAQ threshold alarms
Programmable baseline
2.7mm x 4.0mm LGA package
Low component count
Proven technology platform

Specs

Interface I²C
Supply Voltage [V] 1.8 to 3.6
Power Consumption [mW] 1.2 to 46
Dimension [mm] 2.7 x 4.0 x 1.1 LGA
Ambient Temperature Range [°C] -40 to 85
Ambient Humidity Range [% r.h.] 10 to 95

Parts List

 

 

Amount Part Type
1 CJMCU-811 CCS811 Air Quality Gas Sensor
1 Compatible DUE R3 Board SAM3X8E 32-bit ARM Cortex-M3

 

Schematics/Layout

Remember and connect WAKE to gnd

arduino due and CCS811 layout

arduino due and CCS811 layout

 

Code

We use the adafruit library which can be added using the library manager

#include "Adafruit_CCS811.h"
Adafruit_CCS811 ccs;
void setup() {
Serial.begin(9600);
Serial.println("CCS811 test");
if(!ccs.begin()){
Serial.println("Failed to start sensor! Please check your wiring.");
while(1);
}
//calibrate temperature sensor
while(!ccs.available());
float temp = ccs.calculateTemperature();
ccs.setTempOffset(temp - 25.0);
}
void loop() {
if(ccs.available()){
float temp = ccs.calculateTemperature();
if(!ccs.readData()){
Serial.print("CO2: ");
Serial.print(ccs.geteCO2());
Serial.print("ppm, TVOC: ");
Serial.print(ccs.getTVOC());
Serial.print("ppb Temp:");
Serial.println(temp);
}
else{
Serial.println("ERROR!");
while(1);
}
}
delay(500);
}

 

Output

Open the serial monitor – this is what I saw. The higher CO2 level was when I breathed on the sensor

CO2: 742ppm, TVOC: 52ppb Temp:22.61
CO2: 629ppm, TVOC: 34ppb Temp:21.88
CO2: 460ppm, TVOC: 9ppb Temp:20.01
CO2: 400ppm, TVOC: 0ppb Temp:21.88
CO2: 400ppm, TVOC: 0ppb Temp:24.61
CO2: 400ppm, TVOC: 0ppb Temp:25.00
CO2: 400ppm, TVOC: 0ppb Temp:24.61
CO2: 400ppm, TVOC: 0ppb Temp:24.61

 

Links

ccs811 datasheet

 

Share