loading

First of all, Thank you very much Instructables+Intel for the Edison board and the grove starter kit plus!

This project is the first thing i did with the board just to test it and it is very easy for anyone to do.

More user friendly project's that anyone can build coming soon!

Step 1: Unboxing and Setting Up the Board

Obviously start by unpacking all the things!

Setting up the Edison board first.

Install the Edison module to the base board and screw it firmly.

Install the white legs under the board to use them as a stand, Or screw them on top of the board to use them as a stand for components.

Then start discovering the grove kit plus.

Everything is packed neatly and tidy. First thing that hit my eye was the RGB-LCD screen, The shield and the temperature sensor. Also the 8 GB micro SD card was interesting.

So the first thing that came in my mind was live temperature printed to LCD screen. But with a little bonus.

By using the RGB feature, the screen changes its color.

This helps reading the screen from a distance by knowing the temperature by color.

Also the SD card has some usage.

What will you do with the temperature if you don't log it down to the card?

Follow this build for more info!

Step 2: Install the Drivers and Software + Sketches

Download the software and drivers for the board from here.

Be sure to download the right one for your OS.

After download unzip the Arduino software and install the driver pack.

Connect the board to PC via USB. Check that the switch next to the USB ports at the Edison is turned towards the USB ports.

Wait for the system to install the drivers.

After successful installation you should see a new drive named Edison popup. The drive is 767 MB big.

If not, check the device manager for errors.

If you have any questions about the drivers or Arduino software just ask. I will answer usually in 24 hours.

Sketchbooks can be downloaded fromhere.

Step 3: Start Building

The build itself is really simple.

All you need is the shield, LCD-screen and the temperature sensor.

For installation you will need two wires that connect to the shield (included in package) and an SD card.

Connect those to the Edison board and stick it to the computer.

Now we start with the code that will come inside it..

Step 4: The Code

The code is pretty simple and it is easy to understand.

First include needed library and address global variables.

#include 
#include "rgb_lcd.h" #include #include const int pinTemp = A0; const int chipSelect = 4; float temperature; int B=3975; float resistance; rgb_lcd lcd;

After that is time to build void setup.

This is needed in any program.

In the setup there is start for the serial and for the LCD screen. Also the SD card is applied here.

void setup()
{ Serial.begin(115200); lcd.begin(16, 2); lcd.print("Temperature"); Serial.print("Start write to card.");
  if (!SD.begin(chipSelect)) {
    Serial.println("No card or failure");
    return;
  }
  Serial.println("Card found");
}

Void breath variable is done here. This one has the ability to fade the color when it changes.

void breath(unsigned char color)
{
    for(int i=0; i<255; i++)
    {
        lcd.setPWM(color, i);
        delay(5);
    }
    delay(500);
    for(int i=254; i>=0; i--)
    {
        lcd.setPWM(color, i);
        delay(5);
    }
}

Void loop is also needed in any program.

this is where the whole program sets in. The loop means that the program will continue forever.

void loop()
{ if (temperature >25){ breath(REG_RED); } if (temperature <25){ breath(REG_GREEN); } if (temperature <20) { breath(REG_BLUE); } lcd.setCursor(5,1); lcd.write(0b11011111); lcd.setCursor(6,1); lcd.print("C"); int val = analogRead(pinTemp); resistance=(float)(1023-val)*10000/val; temperature=1/(log(resistance/10000)/B+1/298.15)-273.15; Serial.println(temperature); lcd.setCursor(0,1); lcd.print(temperature); String dataString = "";
 
    File dataFile = SD.open("Temperatures.txt", FILE_WRITE);
    if (dataFile) {
    dataFile.println(temperature);
    dataFile.close();
    
}
    else {
    Serial.println("error opening datalog.txt");
       
  }     
}

Step 5: Upload the Program and Enjoy.

The RGB screen colors are limit values that are good for inside the house.

If the readings are meant to be made from outside i would change the limited color values.

Almost forgot to tell that this works also with 9V battery and that means it is portable. The file included is the log file that was greated at the same time i was writing this text.

The 8 GB SD card can hold a years worth of temperature data. the log is about 2 hours long and the same could be written over 121151 times to the card.

That's about it. If you want you could build a case for thing go for it. This is just a raw build and the parts are going to be in use the next projects.

There will be a lot of build's done with the Intel Edison Iot (internet of things) board so remember to follow me.

Thank you for reading and have a nice day.

:)

<p>Great project</p>
<p>Hi. My Arduino 1.6.5 had an error compiling it.</p><p>Error Message:</p><p>Build options changed, rebuilding all</p><p>test_2.cpp.o: In function `rgb_lcd::setPWM(unsigned char, unsigned char)':</p><p>C:\Users\Augustine Lee\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\libraries\RGBLCD/rgb_lcd.h:117: undefined reference to `rgb_lcd::setReg(unsigned char, unsigned char)'</p><p>C:\Users\Augustine Lee\AppData\Roaming\Arduino15\packages\Intel\hardware\i686\1.6.2+1.0\libraries\RGBLCD/rgb_lcd.h:117: undefined reference to `rgb_lcd::setReg(unsigned char, unsigned char)'</p><p>test_2.cpp.o: In function `__static_initialization_and_destruction_0':</p><p>D:\Arduino IDE\Arduino IDE 1 6 5\arduino-1.6.5-r2/test_2.ino:11: undefined reference to `rgb_lcd::rgb_lcd()'</p><p>test_2.cpp.o: In function `setup()':</p><p>D:\Arduino IDE\Arduino IDE 1 6 5\arduino-1.6.5-r2/test_2.ino:19: undefined reference to `rgb_lcd::begin(unsigned char, unsigned char, unsigned char)'</p><p>test_2.cpp.o: In function `loop()':</p><p>D:\Arduino IDE\Arduino IDE 1 6 5\arduino-1.6.5-r2/test_2.ino:73: undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'</p><p>D:\Arduino IDE\Arduino IDE 1 6 5\arduino-1.6.5-r2/test_2.ino:74: undefined reference to `rgb_lcd::write(unsigned char)'</p><p>D:\Arduino IDE\Arduino IDE 1 6 5\arduino-1.6.5-r2/test_2.ino:75: undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'</p><p>D:\Arduino IDE\Arduino IDE 1 6 5\arduino-1.6.5-r2/test_2.ino:83: undefined reference to `rgb_lcd::setCursor(unsigned char, unsigned char)'</p><p>collect2.exe: error: ld returned 1 exit status</p><p>Error compiling.</p><p>I have installed the libraries for the Intel i686 and the Grove Library. What should I do? Thanks :)</p>
<p>Hi,</p><p>It seems that you have problems with the library files. Check the RGB_LCD library.</p><p>If you use normal LCD change the library to normal LCD.</p>
<p>I am using a RGB Backlight LCD. and the rgb_lcd.h, please help me check for any corrupted code</p><p>Here it is:</p><p>#ifndef __RGB_LCD_H__</p><p>#define __RGB_LCD_H__</p><p>#include &lt;inttypes.h&gt;</p><p>#include &quot;Print.h&quot;</p><p>// Device I2C Arress</p><p>#define LCD_ADDRESS (0x7c&gt;&gt;1)</p><p>#define RGB_ADDRESS (0xc4&gt;&gt;1)</p><p>// color define </p><p>#define WHITE 0</p><p>#define RED 1</p><p>#define GREEN 2</p><p>#define BLUE 3</p><p>#define REG_RED 0x04 // pwm2</p><p>#define REG_GREEN 0x03 // pwm1</p><p>#define REG_BLUE 0x02 // pwm0</p><p>#define REG_MODE1 0x00</p><p>#define REG_MODE2 0x01</p><p>#define REG_OUTPUT 0x08</p><p>// commands</p><p>#define LCD_CLEARDISPLAY 0x01</p><p>#define LCD_RETURNHOME 0x02</p><p>#define LCD_ENTRYMODESET 0x04</p><p>#define LCD_DISPLAYCONTROL 0x08</p><p>#define LCD_CURSORSHIFT 0x10</p><p>#define LCD_FUNCTIONSET 0x20</p><p>#define LCD_SETCGRAMADDR 0x40</p><p>#define LCD_SETDDRAMADDR 0x80</p><p>// flags for display entry mode</p><p>#define LCD_ENTRYRIGHT 0x00</p><p>#define LCD_ENTRYLEFT 0x02</p><p>#define LCD_ENTRYSHIFTINCREMENT 0x01</p><p>#define LCD_ENTRYSHIFTDECREMENT 0x00</p><p>// flags for display on/off control</p><p>#define LCD_DISPLAYON 0x04</p><p>#define LCD_DISPLAYOFF 0x00</p><p>#define LCD_CURSORON 0x02</p><p>#define LCD_CURSOROFF 0x00</p><p>#define LCD_BLINKON 0x01</p><p>#define LCD_BLINKOFF 0x00</p><p>// flags for display/cursor shift</p><p>#define LCD_DISPLAYMOVE 0x08</p><p>#define LCD_CURSORMOVE 0x00</p><p>#define LCD_MOVERIGHT 0x04</p><p>#define LCD_MOVELEFT 0x00</p><p>// flags for function set</p><p>#define LCD_8BITMODE 0x10</p><p>#define LCD_4BITMODE 0x00</p><p>#define LCD_2LINE 0x08</p><p>#define LCD_1LINE 0x00</p><p>#define LCD_5x10DOTS 0x04</p><p>#define LCD_5x8DOTS 0x00</p><p>class rgb_lcd : public Print </p><p>{</p><p>public:</p><p> rgb_lcd();</p><p> void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);</p><p> void clear();</p><p> void home();</p><p> void noDisplay();</p><p> void display();</p><p> void noBlink();</p><p> void blink();</p><p> void noCursor();</p><p> void cursor();</p><p> void scrollDisplayLeft();</p><p> void scrollDisplayRight();</p><p> void leftToRight();</p><p> void rightToLeft();</p><p> void autoscroll();</p><p> void noAutoscroll();</p><p> void createChar(uint8_t, uint8_t[]);</p><p> void setCursor(uint8_t, uint8_t); </p><p> virtual size_t write(uint8_t);</p><p> void command(uint8_t);</p><p> // color control</p><p> void setRGB(unsigned char r, unsigned char g, unsigned char b); // set rgb</p><p> void setPWM(unsigned char color, unsigned char pwm){setReg(color, pwm);} // set pwm</p><p> void setColor(unsigned char color);</p><p> void setColorAll(){setRGB(0, 0, 0);}</p><p> void setColorWhite(){setRGB(255, 255, 255);}</p><p> using Print::write;</p><p>private:</p><p> void send(uint8_t, uint8_t);</p><p> void setReg(unsigned char addr, unsigned char dta);</p><p> uint8_t _displayfunction;</p><p> uint8_t _displaycontrol;</p><p> uint8_t _displaymode;</p><p> uint8_t _initialized;</p><p> uint8_t _numlines,_currline;</p><p>};</p><p>#endif</p><p>that is the end</p><p>it still doesn't work for me. Hmmmmmmmm...</p>
<p>That is the rgb_lcd.h file. There isn't anything wrong with it.</p><p>I suggest to read this <a href="https://learn.sparkfun.com/tutorials/installing-an-arduino-library" rel="nofollow">https://learn.sparkfun.com/tutorials/installing-an...</a> on how to install library to the arduino software.</p><p>The code should work right away, but it needs the correct library to compile perfectly.</p><p>If you have any questions feel free to ask.</p>
<p>I still have the &quot;undefined reference&quot; even though I have installed the additional library into my C Drive documents. I have tried restarting the Arduino IDE to find the library folder.</p><p>May I ask if the whole entire Arduino Program be in the documents folder? The program seemed to be searching libraries in the D: Drive\ and the C:Drive\Documents and would still produce errors even after I followed the Sparkfun Tutorials.</p><p>thanks for your help :)</p>
<p>Try to look the library folder in your installation location. </p><p>C:/(Arduino installation folder. Could be in program files)/libraries.</p><p>The installation location debends where you installed it. Mine is installed at a different drive than C.</p><p>Drop the library to to the folder and restart arduino IDE. that's it.</p><p>I have always done it by that method and it newer fails.</p>
<p>Hi. After I have shifted the files into the documents and installation file, I tried the examples that they provided to see if things were working, so far, most of the examples worked. Only the RGB Backlight had error compiling. So, I guess there is a problem with the rgb_lcd.h.</p><p>see the screenshot below</p>
<p>Hi,</p><p>The pictures are too small for me to view. If you haven't done anything to the rgb_lcd.h file by your self, i don't think there is anything wrong with it. If you are not sure. Download it again and install them again.</p><p>You can also try to change the </p><p>#include &quot;rgb_lcd.h&quot; </p><p>to </p><p>#include &lt;rgb_lcd.h&gt;</p><p>Try this code once more. Mine compiles great with the same library's.</p><p>#include &lt;Wire.h&gt;</p><p>#include &quot;rgb_lcd.h&quot;</p><p>#include &lt;SPI.h&gt;</p><p>#include &lt;SD.h&gt;</p><p>const int pinTemp = A0; </p><p>const int chipSelect = 4;</p><p>float temperature;</p><p>int B=3975; </p><p>float resistance;</p><p>rgb_lcd lcd;</p><p>void setup()</p><p>{</p><p> Serial.begin(115200); </p><p> lcd.begin(16, 2);</p><p> lcd.print(&quot;Temperature&quot;);</p><p> Serial.print(&quot;Start write to card.&quot;);</p><p> if (!SD.begin(chipSelect)) {</p><p> Serial.println(&quot;No card or failure&quot;);</p><p> return;</p><p> }</p><p> Serial.println(&quot;Card found&quot;);</p><p>}</p><p>void breath(unsigned char color)</p><p>{</p><p> for(int i=0; i&lt;255; i++)</p><p> {</p><p> lcd.setPWM(color, i);</p><p> delay(5);</p><p> }</p><p> delay(500);</p><p> for(int i=254; i&gt;=0; i--)</p><p> {</p><p> lcd.setPWM(color, i);</p><p> delay(5);</p><p> }</p><p>}</p><p>void loop()</p><p>{</p><p> if (temperature &gt;25){</p><p> breath(REG_RED);</p><p> }</p><p> if (temperature &lt;25){</p><p> breath(REG_GREEN);</p><p> }</p><p> if (temperature &lt;20)</p><p> {</p><p> breath(REG_BLUE);</p><p> }</p><p> lcd.setCursor(5,1);</p><p> lcd.write(0b11011111);</p><p> lcd.setCursor(6,1);</p><p> lcd.print(&quot;C&quot;);</p><p> int val = analogRead(pinTemp); </p><p> resistance=(float)(1023-val)*10000/val; </p><p> temperature=1/(log(resistance/10000)/B+1/298.15)-273.15; </p><p> Serial.println(temperature);</p><p> lcd.setCursor(0,1);</p><p> lcd.print(temperature);</p><p> String dataString = &quot;&quot;;</p><p> File dataFile = SD.open(&quot;datalog.txt&quot;, FILE_WRITE);</p><p> if (dataFile) {</p><p> dataFile.println(temperature);</p><p> dataFile.close();</p><p>}</p><p> else {</p><p> Serial.println(&quot;error opening datalog.txt&quot;);</p><p> } </p><p>}</p><p>//*********************************************</p>
<p>After reinstalling the rgb_lcd.h. the Arduino IDE keeps saying that there is no such file or directory even after restarting the Arduino IDE. I will try to solve this problem first.</p>
<p>Okok. It does work after I specified the file directory and used the C++/.cpp files. Now I just need to fix the examples and the libraries that they gave me. </p><p>Anyways, thanks for your help!! :D</p>
<p>No problem!</p><p>Glad to hear that you got it working! :)</p>

About This Instructable

7,743views

21favorites

License:

Bio: I am 26 years old engineering student from Oulu in Finland. Currently living in Joensuu. I make these projects as a hobby, and it would ... More »
More by mkarvonen:PipBoy 3000 (working) DIY Piranha Plant Photo(s) to 3D model 
Add instructable to: