Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iot:labs:08 [2016/06/27 09:55]
ioana_maria.culic created
— (current)
Line 1: Line 1:
-====== Lab 8: Sensors and Dashboard====== 
  
-For the following applications,​ you will read data coming from sensors, which means that you will also need to use the Arduino board. As the Raspberry Pi has no ADCs, you cannot read values coming from analog sensors. ​ 
-===== Arduino Setup ===== 
- 
-==== What you need ==== 
- 
-  * One Raspberry Pi board connected to Wyliodrin STUDIO; 
-  * One Arduino board; 
-  * One USB cable. 
-==== The setup ==== 
-As previously stated, the classical Arduino board is basically a micro-controller,​ which is capable of running one piece of software at once and that has little processing power and no network connectivity. So you will use the board to gather data from the environment and then pass it on to the Raspberry Pi.  ​ 
- 
-The Raspberry Pi is a computer that is capable of processing data and communicating with other smart devices. For instance, you could visualise the temperature on your smart phone. 
- 
-The two boards need to be connected in order to send data between them. You can connect them via the USB cable and a serial connection will be established between the two. Once this is done, they can exchange data and the Arduino board can be controlled via the Raspberry Pi. This is done by the **firmata** protocol. The protocol allows the Raspberry Pi to send the Arduino messages in which it requests for a certain action or information and the Arduino will respond accordingly. 
- 
-In order to implement the protocol, you need to flash the Arduino with the **StandardFirmata** firmware. 
- 
-In the Wyliodrin STUDIO interface you have two tabs referring to **SOFTWARE** and **FIRMWARE**. So far, you used only the **SOFTWARE** tab, as you wrote applications for the Raspberry Pi solely. Now, select the **FIRMARE** tab and there is where you can write code which will be run on the Arduino. In this case, you will import an existing project. 
- 
-{{ :​iot:​labs:​select-firmata.png?​300 |}} 
- 
-Hit the **Show examples** button and select **Arduino**. Then **use** the **Firmata/​StandardFirmata** example. Now that you have the software to run on the Arduino, once you hit the **run** button, you will be asked the tyype of the Arduino board and if you want to flash it or not. Select the board you are using and **RUN AND FLASH**. The **StandardFirmata** firmware will be deployed on the Arduino. 
- 
-As you know, any micro-controller,​ including the Arduino, once flashed, runs the same firmware until another one is uploaded on the board. Thus, you don't have to flash the board each time you run a new Raspberry Pi application. If you are confident that the Arduino is running **StandardFirmata**,​ you can skip this step. 
-{{ :​iot:​labs:​flash-arduino.png?​300 |}} 
- 
-===== Street Lightning ===== 
- 
-In this application,​ you will build a system to monitor the light level and if there is the case, you will turn on the street lights brighter or dimmer, depending on the amount of light. 
- 
-==== What you need ===== 
-  * One Raspberry Pi connect to \Wyliodrin; 
-  * One Arduino connected to the Raspberry Pi; 
-  * One photocell; 
-  * One LED; 
-  * One 220 $\Omega$ resistor; 
-  * One 10 k$\Omega$ resistor; 
-  * Jumper wires. ​ 
- 
-===== See how the light changes in a room ===== 
- 
- 
-You that now have a thermometer can you find something extra to make it more interesting?​ Try a light sensor. ​ 
-  *  One photocell; 
-  *  One 220 $\Omega$ resistor; 
-  *  Three jumper wires. 
-==== The Setup ==== 
-{{ :​iot2015:​labs:​light.png?​400 |}} 
- 
-The photocell works just like a voltage divider, as well (check the //​Introduction to Electronics//​ chapter for more details). You need to connect it to the Gnd and Vcc and from between the photocell and the resistor to the analog pin of the board. This light sensor has a resistance that varies with the light, the more light there is, the lower the resistance of the photocell. Depending on how you place the sensor you can obtain a pull up or pull down voltage divider. 
-==== The Code ==== 
-The new nodes are much simpler. You just add a block to read the analog pin that you use and send it to the chart. ​ 
-{{ :​iot2015:​labs:​lightstreams.png?​400 |}} 
- 
-===== Exercises===== 
-  - Connect a photoresistor. Send the values to a chart. Set a maximum value. In case the sensor detects a value higher that the maximum, an LED will turn on for a few seconds. 
-  -  Do the same, but set the limit value from a slider, in the dashboard. This slider gives values between 0 and a maximum of your choice.  ​ 
-  - For this exercise you will have to make a chart using the values of a photoresistor as well, only that this time, the team next to you will have the sensor and they will send a signal with its values. You will receive this values and send them to the dashboard. In short, make a line chart using the values of a photoresistor connected to the neighbour'​s board. \\ {{ :​iot2015:​labs:​boardid.png?​300 |}} \\  ** Hint** In order to get a message from another board, you will need its Board ID. To find it, go to the main IOT page and in the boards settings, choose BoardID. 
-  -  Use a thermistor. You need to find online the value // B // and it's resistance at 25 degrees. Put its values in degrees in a thermometer chart. ​ \\ **Hint** You will wire it as a voltage divider with a similar resistance. ​ 
iot/labs/08.1467010523.txt.gz ยท Last modified: 2016/06/27 09:55 by ioana_maria.culic
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0