Live Temperature Display

Hi There everyone!

It’s been a long time since I posted anything on here, and I thought the new Intel IoT release would be a great idea to create a instructable.

So – What is IoT?

IoT stands for “Internet of Things” which is a development of the “Internet” where it is planned for every device to have network connectivity thus allowing them to send and receive data.

This could be a device such as your fridge and it has the ability to save a shopping list to google drive every week or could be a child tracking device in a shoe or accessory to help parents keep control of their kids in shopping centres etc.

This is the definition of IoT :

“The Internet of Things (IoT) is a computing concept that describes a future where everyday physical objects will be connected to the Internet and be able to identify themselves to other devices. The term is closely identified with RFID as the method of communication, although it also may include other sensor technologies, wireless technologies or QR codes.

The IoT is significant because an object that can represent itself digitally becomes something greater than the object by itself. No longer does the object relate just to you, but is now connected to surrounding objects and database data. When many objects act in unison, they are known as having “ambient intelligence.” “

What is Intel doing to get in on this?

Intel have released a Intel IoT Developer kit that you can get to help developers and techies to get their hands on a simple piece of kit and start developing applications for use in the everyday world.

There are two products available, which are :

Intel Galileo

Intel Edison

A while back I applied to get my hands on one of these kits, it was a random selection of what you got.

The Galileo is an all in one board, similar to the Raspberry Pi. It has a ethernet port and several output pins so you can program it to do certain functions.

The Edison is the more interesting one (in my opinion). It is a tiny little chip that contains all the important bits, such as the CPU and RAM. The idea behind this is that the computing power that is provided (2 cores, 1GB ram) is useful for a lot of applications and can easily run most projects in a realistic time and environment. The chip is about the size of a SD card, you could easily fit that into a dog collar, shoe or even a watch!

The Edison comes with an arduino breakout board that allows you to plug in modules and sensors, just like an arduino and expand the devices capabilities.

Which one did I get?

I received the Edison and the Arduino breakout board, which came along with a Seeedstudio Grove Starter Kit Plus (Gen 2)

I took it all out of the box and this is what I got :

1* Intel Edison Chip

1* Intel Arduino Breakout Board

1 * Ethernet Cable

1* Micro Usb Cable

1* USB to FTDI cable

10* connector cables

4* Mounting posts

1* Mini Servo

1* pack of 3* LED’s (Red,Green and Blue)

1* PP3 to DC jack lead

1* Arduino base shield V2

1* Rotary Angle Sensor

1* Temp sensor

1* Magnetic Switch

1* Light Sensor

1* Sound Sensor

1* Touch Sensor

1* Relay

1* Switch

1* Button

1* LED board

1* 16*2 RGB Display

1* 8GB MicroSD and SD card adaptor

Awesome eh?

 

Time to get started with your board,

I’m assuming you have the Intel Edison and Arduino breakout board for this instructable.

First of all, UNBOX ALL THE THINGS

you should have all of the things I mentioned earlier, if not you should have some similar items to tinker with.

To get started I recommend that you follow this guide :

https://communities.intel.com/docs/DOC-23147

You won’t need to connect your board to wifi for this guide, but I suggest you do for future projects and tinkering. Once set up and hopefully working you will need to add the Base shield to the board in order to be able to add the sensors to the edison.

The base shield is the one under the LCD in the seeed-studio box. You don’t have to turn the edison off to add the shield, but as the edison is a sensitive device I suggest that you do turn it off before you add it,

Once added it should look something like this:

oooohhhhh connectors!!!

Now you need to get a few things out of the seeedstudio box, in particular you need the following:

1* Grove-LCD RGB Display

1* Temperature Sensor

2* Connector Cables

It should be pretty easy to connect the cables up to the Edison, Connect the temp sensor to the port labelled A0 and the LCD to the I2C on the left hand side of the board.

I would also suggest that you do this when the board is off.

Once connected you’re almost good to go!

 

Next up,

Connect your board to the IDE

You will need to download the arduino ide from here if you haven’t got it already, when it has finished downloading just extract it to your desktop.

After this you will need to download the sketchbook starter kit from github (here) or a zip file of it from here

you will want to extract this to a folder within the arduino ide folder from earlier, it doesn’t affect the way it works, it just stops files from spreading everywhere.

Open the folder that you just downloaded and go to the folder called libraries, inside there will be a folder called “Grove_LCD_RGB_Backlight” copy this into the libraries folder in the root of the arduino folder (Something like arduino-1.5.3-Intel.1.0.4\libraries)

Then launch the arduino IDE (double click the arduino.exe in the root folder), it should look a little like this:

The contents in your window will look a little different, my screenshot is only like this because I have one of the demo scripts open.

To help you along with things you can add the demos from Groove as a sketchbook, to do this you need to do the following:

1. Click File

2. Click Preferences

3. Change the sketchbook location to where you put the extracted zip / github clone within the arduino ide.

Should look something like this:

Where my username is robert, just change it to your username, or browse to the file path where you saved them.

4. Click OK

Now when you go to file –> sketchbook it should list some examples, such as grove_Button

This just helps you to get your head round the code that is put together to run applications on the Edison.

Now to check the arduino IDE is talking to the Edison,

Go to tools, then click on board, check that Intel Edison is checked.

Then go to tools, serial port and select the serial port that you used when setting up the board, if you can’t remember just do:

Start, type devicemgr.msc then click the little arrow next to COM ports, and look what the Edison Board is listed as.

Once done you can go to file, New and you will be all ready to go!

Nearly there!

Now you have the Edison board set up and talking to the arduino IDE it is time to add the code.

you can download my code for the Temp sensor display here

Here is the code so you can see it:

//Ainsey11
//Shows Temperature on LCD display
//Website Ainsey11.com
//Version 1.0
//12-13-2014
//Feel free to pinch and tweak this code to whatever you want

#include <Wire.h>
#include "rgb_lcd.h"


const int pinTemp = A0;      // pin of temperature sensor, usually A0-A4

float temperature;
int B=3975;                
float resistance;

rgb_lcd lcd;

void setup()
{
  
    lcd.begin(16, 2);		//Sets the LCD screen config, 16chars,2 lines
    
}

void loop()
{
    int val = analogRead(pinTemp);                               // get analog value
    resistance=(float)(1023-val)*10000/val;                      // get resistance
    temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;     // calc temperature
    lcd.print("It is ");					 // Print "it is" on the screen
    lcd.print(temperature);					 // Print the final temperature
    lcd.print(" *C");						 // Add *c on the End
    
    
    delay(1000);          // delay 1s
    lcd.clear();						//Clear the screen and loop
    
}

I’ll talk you through the code,

anything with a “//” next to is is a comment, this just makes it easier to read and work out what other people have done. It is always a good idea to comment your code.

The next bit down is :

#include <Wire.h>
#include "rgb_lcd.h"

This loads the libraries that we copied over earlier. these contain set functions and commands to send to the Edison

After this comes :

const int pinTemp = A0;    

This is to let the board know what pins to look on for the temperature sensor, in my case I connected it to A0. You could choose A0,A1,A2 and A3 for this.

The next important bit of code is this:

void setup()
{
  
    lcd.begin(16, 2);		//Sets the LCD screen config, 16chars,2 lines
    
}

This, as mentioned in the comment sets the screen size, so when we print out data to it we don’t go off the edge.

void loop()
{
    int val = analogRead(pinTemp);                               // get analog value
    resistance=(float)(1023-val)*10000/val;                      // get resistance
    temperature=1/(log(resistance/10000)/B+1/298.15)-273.15;     // calc temperature
    lcd.print("It is ");					 // Print "it is" on the screen
    lcd.print(temperature);					 // Print the final temperature
    lcd.print(" *C");						 // Add *c on the End
    
    
    delay(1000);          // delay 1s
    lcd.clear();						//Clear the screen and loop
    
}

This is the final loop of code, as mentioned in the comments it reads the value of the sensor, gets the resistance of the sensor, calculates the correct temperature then prints it onto the screen.

 

Code compiled!

Time to send it to the board.

Just click the little right facing arrow at the top of the IDE and it will send the code across.

When it has done there will be a message at the bottom of the IDE saying “Transfer completed”

If you have followed all the steps right your LCD connected to the should spring to life and display the current temperature in C’s

Here is a little video of the end result :

 

Well,

This is the end of my first ‘ible for a long, long time.

I hope you all enjoyed reading through it and learning your way around the Intel Edison and the Arduino boards, There are a lot of things you can do with these kits, I made this in one afternoon!

I plan to add some colour changes to the lcd screen so it changes colour depending on the temperature and maybe take advantage of Intel’s logging dashboard to make graphs of the temp sensor,

This is just the start for me and I plan to make many more guides on the Intel Edison

Happy Tinkering!!!!

– Ainsey11

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *