Skill Level: Beginner


• Raspberry 3.

• L-Tek IoT Sensor (L-Tek FF1502 Sensor BLE).

• Philips Hue Led Strip.

• Philips Hue Bridge.

• IBM Cloud Account.

• IBM IoT Account.


  1. IBM Cloud Account

    First of all we need to create a resource in our IBM Cloud Account,



    Now we will Click in the first one, we will see a new screen asking for name of the service and what plan we want to use. We will use the free plan, after that we click in create.



    Now we will Click in the first one, we will see a new screen asking for name of the service and what plan we want to use. We will use the free plan, after that we click in create.





    Now we will do the same with the Weather Company Data.

    If we go to our Dashboard we will see our Resource summary there we will see our app.
    If we click in Cloud Foundry Apps, we will see something like this.



    If we choose aletestiot, it will show us information about our app and the URL to our Node Red environment.



    If we choose that it will send us to our editor, by default we will see a few nodes, you can delete them or create a new one, it’s your choice.

  2. IBM IoT Plattform

    Now we will forget about node red and configure our IoT platform. We should go to this web page to create our IoT organization.
    Once we are log in, we will see a Dashboard, in the corner we will see the name of our organization.


    Now we will add our Raspberry Pi, you need to give it a Device ID and a device type.


    We can leave empty the next screen, after that it will ask for a authentication token.


    And we will see a summary with all the info, Now we can click Done.


    We will see a resume of the Information recommend you to copy everything to a notepad. We will need it later.




  3. Set up the Raspberry Pi

    Now we should go to our Raspberry Pi.
    We need to copy the file RPI_Gateway.py that we will see inside the folder RPI_Nodes.


    Open RPI_Gateway.py file and change the lines in the picture below, following directions in the comments of the code.




  4. Node Red in the Cloud

    Ok now we will go back to our Cloud Node Red.
    In the GitHub you will find the code for the next Flow. Inside Cloud_Nodes.



    Ok, let me explain what this flow does.
    When we start the flow, it will go to the weather service and save the reply into our cloudant db, it will check what time it is and look for the weather and with the weather it will send the signal to our Raspberry pi and it will turn on the lights depending of the weather.
    Once a day it will ask the weather service for todays forecast and store it in the database and every hour it will read from the database and change the colors. And at night it will delete the info that we have in the database and ask the service for new info.


  5. Node Red in the Raspberry Pi

    Now we go to our RPi Node Red.
    How to launch Node Red in the RPi.



    Now we go to a web browser and write the IP address the node red terminal show us.


    We copy the Flow, it will send the command to the Hue controller to turn off and on the lights and to change colors. You will need to change the IP Address and the user in the web socket node.





    Time to configure our HUE Lights.
    Follow this tutorial.
    Once you have done it, you can start playing with the lights.


  6. Using Cloud and the Sensor

    With this Flow we will send the information to the cloud. This flow is in the cloud.


    Now in our Raspberry we will add a Flow to read the temperature from our L-Tek FF1502 Sensor BLE and change the lights to the temperature of the room.



    First, we need to run the RPI_Gateway file in the RPi, and we will see something like this. The sensor must be on.


    It will get the temperature from the sensor and turn the lights red or blue according to the temperature.
    Now we will connect the Flows in the cloud to check if the sensor is on, if it is it will show the lights according to the temperature of the room, if its off it will go to the weather service and change the colors according the weather.


  7. Final Result

Join The Discussion