Interface Groove Temperature Sensor With Arduino UNO

In this project Arduino is used with Grove temperature sensor to measure the temperature present in the atmosphere and RGB LCD is used to display current temperature on the screen.

Step 1: Component Needed

Hardware

  • Arduino UNO ==> $ 18.79
  • Grove base shield V2 ==> $ 4.45
  • Grove temperature sensor V1.2 ==> $ 3

  • Grove - LCD RGB backlight ==> $ 11.90

Software

  • Arduino IDE

The cost of project is around $ 38

Step 2: Arduino UNO

Arduino UNO

Arduino Uno is a microcontroller board based on 8-bit ATmega328P microcontroller. Along with ATmega328P, it consists other components such as crystal oscillator, serial communication, voltage regulator, etc. to support the microcontroller. Arduino Uno has 14 digital input/output pins (out of which 6 can be used as PWM outputs), 6 analog input pins, a USB connection, A Power barrel jack, an ICSP header and a reset button.


Technical specifications


Pin Description and Pin Mapping



The 14 digital input/output pins can be used as input or output pins by using pinMode(), digitalRead() and digitalWrite() functions in arduino programming. Each pin operate at 5V and can provide or receive a maximum of 40mA current, and has an internal pull-up resistor of 20-50 K Ohms which are disconnected by default. Out of these 14 pins, some pins have specific functions as listed below:

  • Serial Pins 0 (Rx) and 1 (Tx) ==>Rx and Tx pins are used to receive and transmit TTL serial data. They are connected with the corresponding ATmega328P USB to TTL serial chip
  • .External Interrupt Pins 2 and 3 ==>These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value.
  • PWM Pins 3, 5, 6, 9 and 11 ==> These pins provide an 8-bit PWM output by using analogWrite() function.
  • SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK) ==> These pins are used for SPI communication.
  • In-built LED Pin 13 ==> This pin is connected with an built-in LED, when pin 13 is HIGH – LED is on and when pin 13 is LOW, its off.

Along with 14 Digital pins, there are 6 analog input pins, each of which provide 10 bits of resolution, i.e. 1024 different values. They measure from 0 to 5 volts but this limit can be increased by using AREF pin with analog Reference() function.

  • TWI ==> Analog pin 4 (SDA) and pin 5 (SCA) also used for TWI communication using Wire library.
  • AREF ==> Used to provide reference voltage for analog inputs with analogReference() function.
  • Reset Pin ==> Making this pin LOW, resets the microcontroller.

Power

The Arduino Uno board can be powered via the USB connection or with an external power supply. The power source is selected automatically.

External power can come either from an AC to DC adapter or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the GND and Vin pin headers of the POWER connector.

The board can operate on an external supply from 6 to 20 volts.

  • If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable.
  • If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

The power pins are

  • Vin ==> The input voltage to the Arduino/Genuino board when it's using an external power source.You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
  • 5V ==>This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board.
  • 3V3 ==> A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
  • IOREF ==> This pin on the Arduino/Genuino board provides the voltage reference with which the microcontroller operates. A properly configured shield can read the IOREF pin voltage and select the appropriate power source or enable voltage translators on the outputs to work with the 5V or 3.3V.

Step 3: Grove Base Shield V2

The purpose of creating the Base Shield is to get rid of bread board and jumper wires. With the rich grove connectors on the base board, we can add all the grove modules to the Arduino Uno.

Note :- The pinout of Base Shield V2 is the same as Arduino Uno R3.

Front side




  • Analog Ports ==> include 4 anlog ports, A0, A1, A2 and A3.
  • Digital Ports ==> include 7 digital ports, D2, D3, D4, D5, D6, D7 and D8.
  • UART Port ==> 1 UART port.
  • I2C Ports ==> 4 I2C ports.
  • Power Switch ==> when using Arduino UNO with BaseShield v2, please turn the switch to 5v position; While using Seeeduino Arch with Base Shield v2, please turn the switch to 3.3v.
  • Reset Buton ==> reset the arduino board.
  • PWR LED ==> the Green LED turns on when power on.
  • P1, P2:please solder the pads P1 and P2, if use Base Shield v2 with Seeeduino V3.


Back side

Specifications

There are 16 Grove ports on the base shield, divided into four functional areas: analog(4), digital(7), I2C(4), and UART(1).

Digital Ports
There are seven digital ports, labeled D2-D8. Each of these handles a pair of digital pins on the Arduino Uno. They can be used for reading a digital sensor or controlling a digital (or analog, via PWM) actuator. In any case, each port can only handle two logic states: 0 or 1.

Analog Ports

On the left-hand side are four Grove ports for taking analog readings. Analog sensors can return readings ranging from 0 to 1023.

I2C

Ports below the digital ports are four I2C Grove ports. I2C is a low-speed bus protocol that transfers data via two wires: SCL and SDA.

Apart from the rich grove connectors, on the board you can also see an RST button, a green LED to indicating power status, ICSP pin, a toggle switch and four row of pinouts.

Every Grove connector has four wires, one of which is the VCC. However, not every micro-controller main board needs a supply voltage of 5V, some need 3.3V. That's why there is a power toggle switch to Base shield v2 so that we can select the suitable voltage of the micro-controller main board you are using via this switch.

Step 4: Grove LCD RGB Backlight

Grove LCD RGB backlight is a full-color backlight 16x2 LCD. High contrast and ease of use make it a perfect I2C LCD display for Arduino.

Normal 1602 LCD requires up to 10 I/O pins to display but Grove LCD RGB backlight makes it totally different with the help of I2C connector, only 2 signal pins and 2 power pins are needed. Just plug it into the I2C interface on Arduino via the Grove cable.

As the name RGB backlight indicates, you can set any color you like to be the backlight. You can also have the backlight change with the program.

Front side



Back side

Specifications

How to set different colors

In program you have to change the RGB values.

For Red color

const int colorR = 255;
const int colorG = 0;
const int colorB = 0;

For Green color

const int colorR = 0;
const int colorG = 255;
const int colorB = 0;

For Blue color

const int colorR = 0;
const int colorG = 0;
const int colorB = 255;

For Cyan color

const int colorR = 0;
const int colorG = 255;
const int colorB = 255;

For Light Pink color

const int colorR = 255;
const int colorG = 204;
const int colorB = 229;

For Purple color

const int colorR = 102;
const int colorG = 0;
const int colorB = 102;

For Orange Color

const int colorR = 102;
const int colorG = 128;
const int colorB = 0;

For Yellow color

const int colorR = 255;
const int colorG = 255;
const int colorB = 0;

Step 5: Grove Temperature Sensor V1.2

The Grove temperature sensor uses a thermistor to detect the ambient temperature. The resistance of a thermistor will increase when the ambient temperature decreases.The detectable range of this sensor is -40 - 125ºC, and the accuracy is ±1.5ºC.

Front side

Back side

Specifications

  • Voltage: 3.3 ~ 5V
  • Zero power resistance: 100 KΩ
  • Resistance Tolerance: ±1%
  • Operating temperature range: -40 ~ +125 ℃
  • Nominal B-Constant: 4250 ~ 4299K

To know how we calculate the temperature please refer link below and file attached

Thermistor

Step 6: How to Connect Grove Base Shield With Arduino Uno

As we connected our Grove base shield with Arduino UNO. Now, we will setup our Arduino IDE environment for Grove. Here I am assuming you already installed Arduino IDE. Let's get started

  • First, go to the link mentioned below

https://github.com/Seeed-Studio/Sketchbook_Starter...

Then, download the file.

  • After downloading the file move it to the folder C:\Users\.....\Documents\Arduino and extract it.

  • Open the Arduino IDE, go to File ==> Preferences and browse to the file which we downloaded and click OK.

Now we are done with Grove setup and you can see Grove examples in your Arduino sketchbook

Step 7: Interface RGB LCD With Arduino

As we discussed earlier about I2C Grove ports. I2C is a low-speed bus protocol that transfers data via two wires: SCL and SDA. SCL is the clock line for synchronizing data transfer over the I2C bus; SDA is the data line.

Now we are going to connect RGB LCD to Base shield. Connect the LCD as shown below. Here we are using I2C port.

To check whether LCD is working or not go to File ==> Sketchbook ==> Groove_RGB_Backlight_LCD ==> Helloworld and upload it.

Step 8: How to Interface Temperature Sensor With Arduino

As I discussed earlier about Temperature sensor. Now we will interface temperature sensor with Base shield.

Connect the Temperature sensor to A0 connector as show in image below.

To check temperature sensor working or not go to File ==> Sketchbook ==> Grove_Temperature_sensor and upload it.

Step 9: Connections

RGB LCD ==> Base shield (I2C)

GND ==> GND

VCC ==>VCA

SDA ==> SDA

SCL ==> SCL

Temperature sensor ==> Base shield(A0)

GND ==> GND

VCC ==> VCC

SIG ==> A0

Step 10: Program

Step 11: Result





Sensors Contest

This is an entry in the
Sensors Contest

Share

    Recommendations

    • Sew Tough Challenge

      Sew Tough Challenge
    • Barbeque Challenge

      Barbeque Challenge
    • Planter Challenge

      Planter Challenge

    2 Discussions