Ardumotive Arduino Greek Playground
  • Home
    • About us
    • Contact
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware

LCD RGB Backlight with Temp sensor

Available Languages
Picture
Picture

Introduction 

Picture
This Grove enables you to set the color to whatever you like via the simple and concise Grove interface. It takes I2C as communication method with your microcontroller. So number of pins required for data exchange and backlight control shrinks from ~10 to 2, relieving IOs for other challenging tasks. Besides, Grove - LCD RGB Backlight supports user-defined characters. Want to get a love heart or some other foreign characters? Just take advantage of this feature and design it! This product is a replacement of Grove - Serial LCD. If you are looking for primitive 16x2 LCD modules, we have green yellow backlight version and blue backlight version on sale also.

Features
  • RGB Backlight
  • I2C communication
  • Built-in English fonts
  • 16x2 LCD


What we need and connection

For this tutorial we will need:
  • Arduino UNO
  • Grove Base Shield
  • LCD RGB Backlight
  • Temperature Sensor (Connect Grove-Temp sensor to A0 port of Grove-Base Shield)
Picture

The code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <Wire.h>
#include "rgb_lcd.h"
#include <math.h>
const int B = 4275;               // B value of the thermistor
const int R0 = 100000;            // R0 = 100k
const int pinTempSensor = A0;     // Grove - Temperature Sensor connect to A0

rgb_lcd lcd;

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

void setup() 
{
    // set up the LCD's number of columns and rows:
    lcd.begin(16, 2);
    
    lcd.setRGB(colorR, colorG, colorB);
    
    // Print a message to the LCD.
    lcd.print("Hello Ardumotive");
    delay(1500);
}

void loop() 
{
   int a = analogRead(pinTempSensor);
   float R = 1023.0/a-1.0;
    R = R0*R;

    float temperature = 1.0/(log(R/R0)/B+1/298.15)-273.15;
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Temperature:");
    lcd.setCursor(0, 1);
    // print the number of seconds since reset:
    lcd.print(temperature);
    delay(500);
}
Download the code from here and open it with Arduino IDE. Library is also inside.
grove-_lcd_rgb_backlight_with_temperature_sensor.zip
File Size: 32 kb
File Type: zip
Download File

Well done!

Picture
You have successfully completed one more Arduino Grove tutorial.

I hope you liked this, let me know in the comments.
Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates