Interactive Ambient Sensor With Intel Edison & Grove Starter Kit Plus

by freddyngl in Circuits > Electronics

1195 Views, 37 Favorites, 0 Comments

Interactive Ambient Sensor With Intel Edison & Grove Starter Kit Plus

Interactive_Ambient_Sensor.png
20151017_152341.jpg

Hi i've seen a lot of Instructables here but i'd like to make a project where you can see the use of different sensors, buttons, buzzers, leds and lcd togheter!!! What we're going to realize is an INTERACTIVE AMBIENT SENSOR in which you can select what sensor check and every functional mode will have a different led and lcd colour!!!!

You can switch between the sensors with the button or with the touch sensor (you will see that the second will be "faster") and every time that you press the button or the touch sensor, the buzzer will give you a feedback and the proper led will switch on. The lcd display will have the colour of the led that is active and will give us information about the value of the sensor.

I'm a student in Computer Science Engineering and i'd like to thanks my university that give me this fantastic board for a little time!!! I can't buy this board for now, and this is why i'm partecipate to the Intel IoT Invitational!!! If i win a prize you can be sure that i'll buy an Edison for me as soon as i can!! :P

I hope that this Instructable will be useful for a lot of user!!!! This is my first guide here, but i'd like to make other guide where i can show you how to connect our Ambient Sensor to the cloud!!! ;) Stay Tuned

Hardware Needed

20151019_231200.jpg
20151019_231625.jpg

For this project we need:

- Intel Edison Board

- Arduino Breakout Kit

- Grove Starter Kit Plus - Intel IoT Edition

In particular i've made the project with:

- Grove Base Shield v2

- Grove LCD RGB Backlight

- Grove Touch Sensor v1.1

- Grove Sound Sensor v1.6

- Grove Temperature Sensor v1.2

- Grove Buzzer v1.2

- Grove Button v1.1

- Grove Green Led 5mm

- Grove Red Led 5mm

- Grove Blue Led 5mm

- My Mother's Shoes Box (she is still finding it :P)

What i've used to write the code for the project?

I've used the Arduino IDE, but you can easly made the porting for other IDE!

It's Time to Connect Our Hardware!!!

As first thing we must assemble our Intel Edison board!!!

I'd like to give you a step by step guide, but i think that the Official Intel Guide is full and easy for everyone!!! then check this link and follow all the step!!!

ASSEMBLING THE INTELĀ® EDISON BOARD WITH THE ARDUINO* EXPANSION BOARD

Done? Well now it's time to be sure that everything is working! Then in the guide that i've provided, select ARDUINO as IDE, and follow the step for how to make a led blinking. With this simple example you can check that everything is well installed and you haven't hardware or software problem with your board.

When you're sure that everything is working, we can proceed to link our sensor and button!!!

As first thing connect the Base Shield to the Arduino Expansion Board. Make all this operation when the board is shutted down.

After this, connect the sensor in this way:

- LCD RGB Screen to I2C

- Temperature Sensor to the socket marked A0

- Sound Sensor to the socket marked A1

- Light Sensor to the socket marked A2

- Button to D2

- Touch Sensor to D3

- Buzzer to D4

- Red LED to D6

- Green LED to D7

- Blue LED to D8

Ok, now switch on your Intel Edison and wait less than a minute to make it power up!

Are You Ready to Write Code?

Ok, now open your arduino IDE. I hope that you've learned this easy tool in the link that i've provided in the previsious step. If not, please retry some examples to learn how is it working!!! In this step you can download the code that i've write for you, then you must only compile it and transfer to your board, but my reccomendation is to write and understand the code. In this way you'll learn how to instantiate the item and how to specify the pin modality. Try also to change the connection pin and to modify the code to learn also this!!! But now a little explanation about the code:

-In the first section you'll find a declaration of all "things" that are connected to our board, and the pin that i've specified before

- In the SETUP section you'll find all the declaration that must be execute one time only. Then we have the declaration of the mode of all used pin (we are specifying if they are Output or Input Pin) and some declaration to initialize the LCD (we set the color to white, specify its size and write some text)

-In the LOOP section you'll find all the code that is execute in loop! Then here the code says that "If the button OR the touch sensor is pressed, it must switch on the buzzer and must update the lcd (via the custom UpdateLCD function) in order to check the selection of the sensor. Then in case of "temperature" selection, we have a tone from the buzzer, the red led is active and the lcd will have red colour and will show us the value registered by the sensor. If we press the button (or the touch sensor) we will switch the modality and everything will change.

- Note that the value from the temperature sensor must be formatted in order to be showed by the lcd screen (from Double to String). I've provided a function for this that make all the work. I've differentiate the function that take care about the single sensor and return it's value. Why? For reusability. You can paste this function in other project to make the same operation and you'll earn time ;)

The Result and the Idea for the Next Instructable

20151018_162426.jpg
20151018_163538.jpg
20151018_163548.jpg

In the picture you can see the result of the project...i'm sure that you'll realize your sensor in a better esthetical way (and probably you'll find a better base then a shoes box), but you must understand that i can have this board only for few days and i've no time to realize a good shield for it :)

What will be the next step?

I'd like to show you how to connect your Intel Edison and your Interactive Ambient Sensor to the CLOUD!!!

If you've liked this Instructable please vote me, and if you have question feel free to ask ;)

A little note: in the picture you can see that there isn't a light sensor...this is why it wasn't present in my university's kit...probably someone have lost it :( but if you connect it the arduino code will work ;)

Thanks and i hope that this will be useful for you ;)