Learn to connect your ESPresso Lite V2 to external open web services



    A free web application that allow users to send and retrieve sensor data for logging and visualization purpose.



    A free web-service that allow users to create customized dashboards to visualize the sensor data sent to the cloud.



    A free web-service that allow users to connect other web-services together, triggered based on the conditional statement of “if this then that”


    Data logging and visualization tool

    ThingSpeak is a free web application that allow users to send and retrieve sensor data for logging and visualization purpose.

    1. Set up the circuit

    Connect the DHT22 & OLED directly

    The ESPresso Lite V2 is specially designed to accomodate the pins of the DHT22 digital humidity & temperature sensor and the OLED 128x64C directly without the need of jumper wires.


    (The illustration on the left is used to indicate the layout of the jumper wires in event breadboard is used.)

    2. Create new ThingSpeak account

    3. Create a new channel

    • Click on New Channel and enter the necessary information about this channel e.g. Name, Description, Fields etc
    • For this tutorial, enter Temperature in the box and select Field 1 and Humidity for Field 2

    4. Get the channel API key

    • Click on the API Keys tab and copy the key under the section Write API Key
    • The format of the API Keys are something like



    • If you feel your API key has been compromised, click Generate New Write API Key to create a new key.​
    • For your information, the API keys enable you to write data to a channel or read data from a private channel. API keys are auto-generated when you create a new channel.

    5. Upload the Arduino sketch to the ESPresso Lite V2

    Run the Arduino IDE (latest version 1.6.9) and use the following example sketch (authored by Shahrulnizam). Change the API Key in the sketch to the Write API key indicated in your ThingSpeak channel.

    6. Connect to the Internet

    • Once the sketch is successfully uploaded to the ESPresso Lite V2, connect the board to the Internet.
    • Refer to the section Connect to Internet for more information (http://www.espressolite.com/connect-to-internet)
    • The board will reboot and the OLED will display the temperature and humidity data every 8 seconds. (See image on the left).

    7. Visualize the DHT22 data

    At the Channels section, click on the Private View tab to display the temperature and humidity charts.


    We will be using Freeboard as our data visualization service

    If you are already subscribed to the MQTT broker, you will receive JSON messages at specific intervals. Unfortunately we cannot easily make sense of the JSON data without visualizing it. As such, Freeboard allows us convert the JSON information into 2-D graphics for the purpose of visualization.

    1. Using DHT22 sensor

    By default, the V2.0 out of the box is already pre-loaded with the workshop sketch that also controls the DHT22 digital temperature and humidity sensors.

    2. Let's visualize temperature from our sensor

    Assuming you have DHT22 connected into the V2.0 board:


    At Datasources, click on Add

    3. Select type of data source

    Select the type of datasource as Paho MQTT.

    4. Fill in the following details

    Key in the following details:

    • Name: <something>
    • MQTT Server: mqtt.espert.io
    • Port: 8000
    • Use SSL: No
    • Client Id: <copy from MQTT Websocket panel>
    • Topic: ESPert/xxxxxxxx/Status
    • JSON Message?: Yes


    Make sure xxxxx is replaced with your own board id.

    5. Making a temperature gauge

    • Click Add Pane > + (add widget) > Gauge and key in ‘Temperature’.
    • Set the units as ‘C’ and min and max units as ‘0’ and ‘100’ respectively
    • Click Datasource > Espert (name of datasource) > msg > temperature

    6. Complete it.

    • Once this is completed, a temperature gauge will be displayed.

    If you want to publish the Freeboard panel to a website, save the panel under <name>.json.

    Go to http://www.espert.io

    Create a new object

    Click on the GREEN square to add new object

    Create a new object under My Freeboard > (add object-click on the green square at the upper left corner)

    Enter the name of the object and the corresponding <name>. JSON file and Save it.

    Get the Freeboard key

    Click on the BLUE icon to create object

    Click on the blue icon and copy the URL display in the browser.


    The format of the URL looks like:



    In your website, embed this URL in iFrame:


    <iframe src="http://www.espert.io/freeboard/index.html#key=xxxxxxxxxxx" width="800" height="600" align="top">


  • Using IFTTT

    Conditional programming with IFTTT web service

    IFTTT or “If This Then That” is a free web-service that allow users to connect other web-services together, triggered based on the conditional statement of “if this then that”. IFTTT can help novice IoT learner to create simple a IoT service as you can turn everyday things into ‘smart’ objects by setting up its relationship using simple logic such as “if the room is too hot, then turn on the air-conditioning”.


    In this case, you can create your own IoT service e.g. using your voice to control actuators (e.g. LEDs or servo).

    1. Connect ESPresso Lite to the Internet

    2. Create IFTTT account

    Begin by creating an IFTTT account at http://ifttt.com

    3. Create a new applet*

    *previously known as 'recipe'

    Create an applet (or recipe) by selecting a channel for the trigger. You can choose either "Google Assistant" or "Alexa" channel.


    4. Complete trigger fields

    In this example, we will use 'Google Assistant' as the trigger.


    Just complete the fields indicating:

    • What do you want to say? 
    • What's another way to say it?
    • And another way?
    • What do you want the Assistant to say in response?
    • Language > English
    Click 'Create Trigger'.

    5. Choose 'Webhooks' as 'that' trigger

    6. Make a web request

    7. Indicate the URL for web request.

    8. Complete trigger fields

    Name the Event Name as 'button'*.


    *Any other name may not work for this example

    9.Choose action service for 'THAT'

    Select and choose maker

    10. Choose an action

    Click on Make a web request.

    11. Get ready your smartphone key

    Your smartphone key is a series of numbers generated randomly by espert.io (check out the URL panel) when you have complete the user registration with the mobile app.


    For more information about obtaining the smartphone key, refer to instructions to 'Create a Cloud account' here.

    12. Complete action fields

    In the URL box, key in the HTTP-MQTT bridge using the format:




    where xxxxxx is the smartphone key and yyyyy is the message you want to trigger.


    In this example, we use the message

    "This is triggered by IFTT"


    For Method, select GET or POST from the drop-down menu.


    Leave the Content Type and Body empty.


    Click 'Create Action'.

    13. Test it out.

    Proceed to test out your first IoT service.


    Press the button GPIO0 firmly (hold for at least 1 sec)

      14. Check the OLED display

      When the user button GPIO0 is pressed, the screen will show 'Requesting...'


      If the IFTTT trigger is successfully fired, it will show the message, "Congratulations! You've fired the button event".

      15. Check your smartphone

      When you open your ESPert IoT Mobile App , you will be able to see the message and its timestamp.

      If it works, congratulations!


      If it doesn’t, continue to troubleshoot and identify the steps you may have missed out:

      • Are your board and/or smartphone connected to the Internet?
      • Have you created a cloud account at espert.io ?
      • Have you installed the app and tried sending push notification to yourself?
      • Have you connected or subscribed to the MQTT broker?
      • Did you use or key in your own board id instead of the one shown in the examples?
      • Did you use your own IFTTT channel key instead of the one shown in the examples?