Introduction: Intel Edison Sun Station (UV and Temp) With Python #IntelMakerMx

Picture of Intel Edison Sun Station (UV and Temp) With Python  #IntelMakerMx

We are gonna use our Intel Edison with an Arduino shield and a grove shield to connect as many sensors as you want.

GitHub :

Step 1: Communicate With Our Edison Through a Serial COM

Picture of Communicate With Our Edison Through a Serial COM

First, let’s communicate with our Edison through a Serial COM. Install correct drivers for Edison ( .

Then open your fav Term software, we are gonna use Tera Term ( and set correct COM PORT for Edison and BaudRate to 115200. And that’s it, you are now talking with your Edison board.

If nothing appears on your TeraTerm screen, just tap enter. Then just write: root, for loggin into your Linux Yocto.

Step 2: Installing a Repo

We are gonna use an unoficcial Repo for Intel Edison, please just follow the next instructions from the next link:

Once you complete the steps from the link, use your fav text editor on Linux, I’m using “nano”, to install it just write: opkg Install nano.

Step 3: Sensors

Picture of Sensors

UV sensor that we used it’s a Grove UV sensor. You can see the wiki here:

We totally recommended to check this ebook to know more about Edison programming in Linux Enviroment : take a look on the libraries rmaa and upm.

You can find amazing examples in the next link for Python environment:

In additional we’re gonna use a Grove Temperature sensor, just to provide more information to the user. Wiki:

Step 4: Connecting Sensors to Edison Boards

Picture of Connecting Sensors to Edison Boards

So, let’s start to connect our Edison and sensors.

-Be carefull with the way that you connect your wires to the shield, I recommend to pair GND pin with Black wire, so it will be easier identify each pin on the shield and your sensor.

-Both are analog sensors, so you have to connect it to Analog Inputs, something like this.

-If you want to add a status led you can do it, I added a RGB Led, and connected in this way, each pin it’s a diffetent color, and the largest pin its Ground.

So, you will have something like this:

Step 5:

Now open

a new python file with: nano and paste the next code:

import time, sys, signal, atexit
import mraa #Lib for UV Sensor import pyupm_guvas12d as upmUV #Lib for Temp Sensor import pyupm_grove as upmTemp #Statys Led Variables RedLed = mraa.Gpio(3) GreenLed = mraa.Gpio(4) #Init sensors myUVSensor = upmUV.GUVAS12D(0); temp = upmTemp.GroveTemp(1) #Operating voltage for UV sensor GUVAS12D_AREF = 5.0; SAMPLES_PER_QUERY = 1024;

#Set to OUTPUT Led Pins RedLed.dir(mraa.DIR_OUT) GreenLed.dir(mraa.DIR_OUT) #Handler for error exit def SIGINTHandler(signum, frame): raise SystemExit

#Handler for ctrl+c def exitHandler(): RedLed.write(0) GreenLed.write(0) print "Exiting" sys.exit(0)

#Init our Handlers atexit.register(exitHandler) signal.signal(signal.SIGINT, SIGINTHandler)


#Read of temp sensor

celsius = temp.value()

#Read of UV sensor


s= s/200

print s

#Turn on GreenLED if UV is OK

if (s<4):



#Turn on RedLed if UV its not OK

#You can set your owns

elif (s>4):



#Print temp

print celsius


Run your file with: python

Step 6: Results

Picture of Results

Now you have a little sun station that it will indicate with a red led if the sun its getting rude, or green led if the sun its happy!

We take information about UV recommendations from the National Weather Services from the US:

Try it and tell me your results.



tomatoskins (author)2015-10-23

So cool! How long have you been working with the Intel Edison? How do you like it compaired to other micro controllers?

AlexisJ2 (author)tomatoskins2015-10-23

Hi, let me remember... Amm.. Exactly one day, haha. It's a great tool, you have all capabilities like a raspberry PI, but more integration for communications. It's a perfect tool to develop projects, very stable btw. I totally recommend to program in python if you want to send data using mqtt.