Getting Started with ESPresso Lite V2.0

INTRODUCTION

ESPresso Lite V2.0 is an affordable Wi-Fi development board designed by Singapore-based IoT company, Espert Pte Ltd and manufactured & distributed by Cytron Technologies. It uses the ESP8266 chipset as the main microcontroller and supports the Arduino environment. Beginners with no experience in software programming or electronics can start building objects that can respond to light, sound, touch and movement autonomously and wirelessly (‘smart’ objects) connect them together.

The board consists of the following distinctive features:

  • Espressif’s certified ESP-WROOM-02 Wi-Fi module (which houses the popular 32-bit 80 Mhz ESP8266 SoC with 64kb RAM & 4Mb flash),
  • Two user-programmable buttons (connected to pin 0 & 13) and a reset button,
  • Green SMD LED indicator,
  • On board 3.3V Voltage Regulator with maximum current of 800mA continuous, 1A peak,
  • Input voltage Vin: 5 – 12 VDC; operating voltage at 3.3VDC,
  • Supports the Arduino IDE with own board manager and libraries,
  • Auto program loading from Arduino IDE; no manual resetting required,
  • Custom-arranged I2C pads for I2C-compliant sensors or OLED LC display,
  • Breakout pins are breadboard-friendly .

Basic Wi-fi Concepts

In order to be connected to the internet, the ‘wireless access point’ (WAP) (aka ‘access point” or AP) serves as the communication hub. An example of a WAP will be the home modem or router. Any other devices (e.g the our laptop/desktop computer) that requires the WAP to be connected to the internet are called ‘station’. The ESPresso Lite V2 board can either serves as a station or as an access point (and sometimes as both). The communication protocol that these devices use WiFi (IEEE 802.11 wireless LAN architecture).

Each WAP will have its own network identifier (know as ‘service set identifier’ or SSID) and often require a password before access to the internet is granted. As such each station (e.g ESPresso Lite V2) that is to be connected must be associated to the WAP.


Note!

If you install ESPresso lite V2.0 for the first time, and you find out that the LED on GPIO2 blinks in normal blink. That means your ESPresso Lite V2.0 works and OLED will display “SmartConfig”

PROGRAM WITH ARDUINO IDE

Download the Arduino IDE

The Arduino IDE can be downloaded from https://www.arduino.cc/en/Main/Software

  • Install Arduino 1.8.8
  • Start Arduino and open Preferences window

Install the Arduino core for ESP8266 (WROOM-02)

  • From menu Tools > Board select “ESPresso Lite 2.0”

Open Library Manager (menu Sketch > Include Library > Manager Libraries…. ) install the following libraries.

  • ESPert by Jimmy version 1.2.6
  • DHT sensor library by Adafruit version 1.2.3
  • PubSubClient by Nick O’Leary version 2.6.0
  • ArduinoJson by Benoit Blanchon version 5.8.3
  • HttpClient by Adrian McEwen version 2.2.0
  • ESP8266 Oled Driver for SSD1306 display by Daniel Eichborn, Fabrice Weinberg version 3.2.6
  • Adafruit NeoPixel by Adafruit version 1.0.6
  • ArduinoHttpClient by Arduino version 0.3.1
  • When you are ready, open the Arduino IDE and try uploading some examples from ESPert
  • To restore to the default factory program, go to File > Example > ESPert > _2000_ESPert_workshop and upload the sketch

  CONNECTING TO THE INTERNET

Method 1:  Using the SmartConfig app method

The ESPert SmartConfig application is a quick and easy way to set up Internet connection for ESPresso Lite (both version 1 & 2) devices. This application can also be used by any ESP8266-based devices that can be configured wirelessly to accept existing WiFi network SSID & password credentials broadcasted by the app.

Download & install ESPert SmartConfig.

Android:  https://play.google.com/store/apps/details?id=com.cmmakerclub.iot.esptouch

Enter your email address if requested and it will automatically download to your phone

Watch how the LED flashed

When the board is in ‘SmartConfig mode’, the LED will produce a long period of flashed. If it does not produce long blinks, hold the GPIO13 button for about 5 seconds and release it. The board should reset and enter another mode

All in all there are a few:

  • Long blinks: SmartConfig mode
  • LED off: connected to WiFi
  • Short blinks: AP mode
  • Normal blinks: Trying to connect to WiFi
  • LED off: Not connected to WiFi

If the board does not reset upon holding GPIO13 button, press the RESET button once to reset it, then try again.

Open the ESPert SmartConfig app.

Enter the password of the existing Internet connection between the smartphone and the WiFi. Press ‘Confirm’ and wait for the ESPresso Lite to be successfully connected.

Success.

If the correct password is entered, the OLED display will indicated successful connection

Else, it will simply reboot to either SmartConfig mode again or enter into AP mode (where you will have to manually configure the internet access)

Method 2: Using the AP mode (access point)

When connecting to the Internet, the ESPresso Lite V2.0 is pre-programmed to cycle through several modes simply by holding the GPIO13 button (middle button) for about 5 seconds and releasing

Watch how the LED flashed

When the board is in ‘AP mode’, the LED will produce a short period of flashed. If it does not produce short blinks, hold the GPIO13 button for about 5 seconds and release it. The board should reset and enter another mode

All in all there are a few:

  • Long blinks: SmartConfig mode
  • LED off: connected to WiFi
  • Short blinks: AP mode
  • Normal bliks: Trying to connect to WiFi
  • LED off: Not connected to WiFi

If the board does not reset upon holding GPIO13 button, press the RESET button once to reset it, then try again

If you have the OLED display

The string of number after ‘ESPert’ is the board unique ID. A string of IP (internet protocol) number or IP address is also display. You will need to use the IP address later.

  • Scan the WiFi networks. Select the corresponding board ID. The board unique id will appear as a selectable SSID. connect to this network (Should your unique id is in hexadecimal format, please proceed to update the dependencies, libraries & sketch [_2000_Espert_Workshop] to latest version)
  •    Nevertheless, even if the ID is in hexadecimal format, there’s a way to make meaning out. This,        use a scientific calculator to convert hexadecimal to decimal format.
  •   Go to your Internet browser. Key in the IP address 192.168.4.1
  •   Choose your WiFi network. Choose from the drop-down list

A bow will appear and prompt you to choose the WiFi network with internet connectivity from a list of SSID. Key in the password and the board will reboot.

  •    Success. The LED stops flashing

When the board is successful connected to the internet via the wi-fi network, the OLED will display the indicators. The LED will also stop flashing.

Method 3: Connecting to WAP using direct coding

Open a new Arduino sketch. To use the ESPert library, include the header file at the top of the sketch

#include <ESPert.h>

This ‘wrapper’ file automatically include the ESP8266Wifi Library#include <ESPert.h>

const char* ssid = “Insert your SSID here”;
const char* password = “Insert your password here”;

void setup()
{                                                                                                                                                      //put your setup code here, to run once:

WiFi.begin (ssid, password);                  //execute a function call
int mode = espert.WiFi.init();                //check the connectivity and display the connect/disconnect
if (mode == ESPERT_WIFI_MODE_CONNECT
{
espert.println(“>>>WiFi mode: connected.”);   //Display at serial print
espert.oled.println(“WiFi: connected.”);      //Display at oled screen, if have an oled screen
espert.oled.print(“IP..:”);
espert.oled.println(espert.wifi.getLocalIP());  //Get the local IP address
}
else if (mode == ESPERT_WIFI_MODE_DISCONNECT)
{
espert.println(“>>>WiFi mode: disconnected.”);
espeert.oled.println(“WiFi: not connected.”);
}
}

Create Cayenne Account

You can create an Account from mobile or online. Mobile in the easiest and fastest way, but instruction for online set up are below:

On the sign up page, enter your Name, Email and create a password.

Choose Device

Cayenne currently supports Raspberry Pi, Arduino and LoRa devices. Select the device you would like to get started with in your IoT project

ESP8266

Before you can manage your Arduino device using the online dashboard, you must setup your device and install the Cayenne Arduino Library. Begin by selecting which type of ESP8266 board you will be adding

In the Cayenne dashboard, select the All Devices option. From the Device list that appears, select the MicroController category and then select the types of ESP8266 board that you will be adding.

ESP8266

Begin by verifying that your ESP8266 board and PC/Mac are correctly set up before continuing

Install USB driver on computer

Before you can program your ESP8266, you must install the require USB driver (UC00A) on your computer.

Connect the ESP8266 to your PC/Mac

Connect the ESP8266 to your PC/Mac via data-capable USB cable.

Using Cayenne ESP library

The Cayenne MQTT ESP Library gives you everything you need to quickly get your board connected with Cayenne using MQTT and the Arduino IDE. Using the Arduino IDE is a fast and easy way to program your ESP8266 board

Add Cayenne MQTT ESP Library

  • Download the Cayenne MQTT ESP library from Github
  • Go to Sketch > Include Library > Add.ZIP Library and install the Cayenne MQTT ESP library from the download archive.

The Cayenne MQTT ESP library has now been expanded in the libraries folder in your Arduino sketches directory. You can verify this by going to the Sketch > Include Library menu where you should now see the Cayenne-MQTT-ESP8266 library under contributed libraries. The Cayenne MQTT ESP library is now ready to be used in your project.

Configure Arduino IDE

In order to successfully program your ESP8266, you will need to verify that the appropriate Board and Port are selected in the Arduino IDE. First , verify that the correct Board is selected in the Tools > Board menu. Be sure to select the board type that you will be programming.

Then, verify that you have the correct Port selected for communicating with your ESP8266. Pick the correct port based upon how you are connecting your ESP8266 to your PC/Mac.

Connect your ESP8266 to Cayenne

After setting up your PC/Mac computer with the Arduino IDE and the Cayenne MQTT ESP library, you are ready to install Cayenne onto your device.

 Open the included sketch file example for connecting your board to cayenne. You can obtain this example from Arduino IDE by clicking on File > Example > Cayenne-MQTT-ESP. Alternatively, you can open the Github repository on the Github button next to the board you will be using on the Connect screen.

Add Network & MQTT Credentials

The example sketch file includes everything we need to connect to Cayenne and publish our first set of test data, but it is missing our Wifi SSID, Password and unique MQTT credentials that will allow us to connect this device into our account. Let’s add those now.

All of the required account information we need can be found on the Connect screen. Refer to this screen and copy & paste MQTT username, MQTT Password and Client ID into the sketch file. The example sketch file includes placeholders for these values, so we just need to update them with the values provided to us on our dashboard.

Connect board to Cayenne

Once you have double checked the sketch file, select Sketch > Upload to upload the sketch file to your device. As soon as your ESP8266 board comes online and connects to Cayenne, your device’s dashboard will appear.

Congrats! Your hardware is now connected to the Cayenne Cloud!

Sensors

Cayenne works with any sensor that is connected to an ESP8266 board. We’ve created sketch files for the various temperature, luminosity, pressure, proximity, motion and generic sensor models.

Example: Let’s add a DHT22 Temperature and Humidity Sensor to see how easy it is.

Connect the DHT22 Temperature and Humidity Sensor here.

Download CayenneMQTT_esp library at github

The Cayenne MQTT ESP Library provides functions to easily connect to the Cayenne IoT project builder. This library is designed to work with ESP8266 and ESP32 WiFi modules. With it you can send data to and receive data from Cayenne.

Download DHT library for ESP32/ESP8266  at github

This DHT library provides function that can collect data from DHT family sensor and display it at Cayenne.

Oled Display 

Oled display is use to display the temperature and humidity not just at the Cayenne dashboard but also at the oled display. It easier for us to compare the reading at Cayenne MyDevice

Download Adafruit-GFX-Library at github

This library is the core graphics library for all our display, providing a common set of graphics primitives (point, lines, circles, etc). It needs to be paired with a hardware-specific library for each display device we carry.

Download Adafruit_SSD1306 at github

Add the library at Arduino IDE

  1. Extract the file
  2. Open Sketch > Include Library > Add ZIP file

After add the ZIP file. Open Sketch > Include Library > Managed LibrariesWrite the code at Arduino IDE as shown below

  1. Choose board ESPresso Lite V 2.0 and com
  2. Compile the sketch and upload

//Make sure you install the ESP8266 Board Package via the Arduino IDE Board Manager and select the correct ESP8266 board before compiling.

#include “DHTesp.h” //An Arduino library for reading the DHT family of temperature and humidity sensors
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneMQTTESP8266.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display = Adafruit_SSD1306(128, 64, &Wire); //Size of OLED (128×64) / (128×32)

char ssid[]= “Insert your ssid here “;
char wifiPassword[] = “Insert your WiFi password here”;

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = “Insert your username here”;
char password[] = “Insert your password here”;
char clientID[] = “Insert your client ID here”;

float humidity = 0; //Define humidity
float temperature = 0; //Define temperature

DHTesp dht;
void setup()

{

Serial.begin(9600);

display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128×64

Serial.println(“OLED begun”);

// Since the buffer is intialized with an Adafruit splashscreen
// internally, this will display the splashscreen.
display.display();
delay(1000);

dht.setup(12, DHTesp::DHT22); //define the GPIO pin to which sensor is connected
Cayenne.begin(username, password, clientID, ssid, wifiPassword);

display.clearDisplay();
display.display();
}

void loop()
{
Cayenne.loop();

delay(dht.getMinimumSamplingPeriod());

humidity = dht.getHumidity(); //Get the value of the humidity
temperature = dht.getTemperature(); //Get the value on the temperature

Serial.print(dht.getStatusString());
Serial.print(“t”);
Serial.print(humidity, 1);
Serial.print(“tt”);
Serial.print(temperature, 1);
Serial.print(“tt”);
Serial.println(dht.toFahrenheit(temperature), 1);
delay (500);

display.setTextSize(1); //for display text size
display.setTextColor(WHITE); //for display text colour
display.setCursor(0,0); //place to display
display.print(“Temperature :”); //diaplay humidity
display.println(temperature);
display.setCursor(0,10);
display.print(“Humidity :”);
display.println(humidity);
display.display(); // actually display all of the above
display.clearDisplay(); //clear the previous display data

}

// Default function for sending sensor data at intervals to Cayenne.
CAYENNE_OUT_DEFAULT()
{
// Write data to Cayenne here.
Cayenne.virtualWrite(1, temperature); //Data of temperature will appear at dashboard cayenne
Cayenne.virtualWrite(0, humidity); //Data of humidity will appear at dasgboard cayenne
}

Cayenne Dashboard

After the uploading is done, cayenne dashboard will appear this two channel.

You can change the name of the channel and can add your icon by click setting button at upper right of the channel. Here some example.

You also can see the record data that have been collect every 1 second. Just go to data and wait for it to refresh.

Oled Display

SHARE CAYENNE DASHBOARD TO PUBLIC

After finish all the code uploading cayenne dashboard will appear at monitor. You can share the data to public as long your ESPresso Lite V2 is connected to internet

First, create new project, give it a name.

Open the new project that have been created drag your project inside. Choose channel/widget you want to share

Click the sharing tab on top of Cayenne dashboard. Copy the link and paste the link in the new tab

Cayenne dashboard will appear as public

THINGSPEAK AS A WEB SERVICE

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

  • Set up the circuit

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

  • Create new ThingSpeak account

Sign up for a new ThingSpeak account at http://thingspeak.com

  • Click on New Channel and enter the 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

  • Get the channel API key
  • Click on the API Keys tab
  • Write API Key: Use this key to write data to a channel. If you feel your key has been compromised, click Generate New Write API Key

Read API Key: Use this key to allow other people to view your private channel feeds and charts. Click Generate New Read API Key

  • Upload the Arduino sketch to the ESPresso Lite V2

Run the Arduino IDE 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.

#include <ESPert.h>
  
 ESPert espert;
  
 const char *host = “api.thingspeak.com”;
 String apiKey = “Insert your API key here”; //replace with your channel’s thingspeak API key
 float temperature = 0.0f, humidity = 0.0f;
  
 void setup()
 {
 espert.init();
 espert.dht.init();
 espert.oled.init();
 delay(2000);
  
 espert.oled.clear();
 espert.oled.println(espert.info.getId());
 espert.oled.println();
  
 int mode = espert.wifi.init();
  
 if (mode == ESPERT_WIFI_MODE_CONNECT)
 {
 espert.println(“>>> WiFi mode: connected.”);
 espert.oled.println(“WiFi: connected.”);
 espert.oled.print(“IP..: “);
 espert.oled.println(espert.wifi.getLocalIP());
 }
 else if (mode == ESPERT_WIFI_MODE_DISCONNECT)
 {
 espert.println(“>>> WiFi mode: disconnected.”);
 espert.oled.println(“WiFi: not connected.”);
 }
 else if (mode == ESPERT_WIFI_MODE_SMARTCONFIG)
 {
 espert.println(“>>> WiFi mode: smart config.”);
 }
 else if (mode == ESPERT_WIFI_MODE_SETTINGAP)
 {
 espert.println(“>>> WiFi mode: access point.”);
 }
 delay(2000);
 }
  
 void loop()
 {
 espert.loop();
  
 float t = espert.dht.getTemperature();
 float h = espert.dht.getHumidity();
 if(!isnan(t) && !isnan(h))
 {
 temperature = t;
 humidity = h;
 }
  
 String path = “/update?api_key=” + apiKey + “&field1=” + (String)(temperature) + “&field2=” + (String)(humidity);
 espert.wifi.getHTTP(host, path.c_str());
 espert.oled.clear();
 espert.oled.println(“Temperature=” + (String)(temperature) + “C”);
 espert.oled.println(“Humidity=” + (String)(humidity) + “%”);
  
 delay(8000);
 }
  • Once the sketch is successfully uploaded to the ESPresso Lite V2, connect the board to the internet
  • Connect to the Internet  
  • The board will reboot and the OLED will display the temperature and humidity data every 8 seconds.
  • Visualize the DHT22 data

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

FRITZING

Fritzing is an interesting tool that makers can use to design their prototypes easily thought simple drag-and-drop approach. Developers or educators wanting o build your circuits can make use of ‘ESPresso Lite V2.0’ as an importable Fritzing part.

Download Fritzing library

Download the fritzing library from Github at https://github.com/JimmySoftware/ESPert

Download Fritzing software

Head over to Fritzing website to look for the most updated Fritzing software

Download and install

The fritzing software can be downloaded for free or if you like to, though a small token donation. Install Fritzing in your computer acording to your preferred operating system.

Open a new sketch Open a new sketch 

To start, open a new sketch and make sure that you are in the ‘Breadboard’ view. If the parts library window is not visible, go to Windows > Parts to select it.

Import part

Click import and select the folder where the ESPresso Lite V2.0 is being stored (Fritzing Library)

Click and drag part to main window

You can now start to design your own circuit using the ‘Breadboard’ view by dragging other parts that are useful. You can also search for any parts that are not in the library and import them

Complete your design

Ensure that your wires are properly arranged to avoid confusion. Check out examples of other projects and parts contributed by other at fritzing.org website

INTERNATIONAL DISTRIBUTOR/RESELLERS

Exclusive manufacture & distributor 

Cytron Technology Sdn Bhd

1, Lorong Industri Impian 1

14000 Bukit Mertajam

Pulau Pinang Malaysia

Tel: +604-504 1878

Fax: +604-504 0138

sales@cytron.com.my

Singapore

12 Geeks

344B King George’s Ave,

King George’s Building

Singapore 208576

Phone: +65 9179 8353/ +65 9129 2492

contact@12geeks.com

Singapore

Tertiary Robotics

170 Upper Bukit Timah Road

#05-23 Butik Timah Shopping

Centre Singapore 588179

Tel: +65 6100 061

SMS: +65 9698 3731

enquiry@tertiaryinfotech.com

URL: https://www.tertiaryrobotics.com/espresso-lite-v2.html

Thailand

Chiang Mai Maker Club c/o MakerAsia Co Ltd

1-2 81/21-25 Aruk Road,

Phrasingha, Muang, Chiang Mai, 50200,

Thailand.

info@makerasia.com

URL:https://www.cmmcshop.com/product/2/espresso-lite-v2-0

India

Fab.To.Labs

#520, 2nd Floor, 17th E Main,

3rd Cross KHB Colony,

Koramangala 5th Block, 560095

Bengaluru, India

Phone: +9180500322289

store@fabtolab.com

URL: https://www.fabtolab.com/espresso-lite-wifi

 India

Robu.In

PAP/J131, Bhosari Telco Road,

Bhosari Midc, 411026 Pune,

Maharashtra, India

Phone: +91-9860119164

info@robu.in

www.robu.in

Japan

Elefine

Phone: +81-2666-78-1020

info@elefine.jp

www.elefine.jp

Italy

Future Elletronica

Via Adige 11

21013 – Gallarate (VA)

Italy

info@futuragroupsrl.it 

URL: https://www.futurashop.it/

Australia

TronixLabs Pty Ltd

PO Box 313

Mooroolbark 3138

Australia

Toll-free ( within North America): 1-866-627-3178

Fax: 450-420-1447

support@tronixlabs.com

URL: https://tronixlabs.com.au/eps8266-development-board-australia/

Canada

Robotshop Inc

18005 Lapointe, Building #305

Mirabel, Québec, Canada

J7J 0G2

Tol-free (within North America): 1-866-627-3178

Fax: 450-420-1447

supportcentre@roboshop.com

www.robotshop.com/ca

France & Europe

Robotshop Inc

Europe (France)

RobotShop Inc.

5 rue Ampere

95500 Gonesse

suppotcentre@robotshop.com

www.robotshop.com.eu

USA

RobotShop USA

555 Route 78, suite 367

Swanton, Vermont, USA.

05488

Tol-free (within North America): 1-866-627-3174

Fax: 450-420-1447

supportcenter@robotshop.com

www.robotshop.com/store

USA

OzRobotics USA

Oz Robotics, LLC.

15 East 40th Street, Suite 502

New York, NY 10016

United States of America

General: info@ozrobotics.com

Sales : sales@ozrobotics.com

Support: support@ozrobotics.com

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorail

Display Temperature and Humidity on OLED using DHT22 and Arduino
Getting Started With Teensy Using Arduino IDE
Night Light
Arduino Device Tracker Using GSM GPS SIM7600E Module
Chocolate Box with Touch Sensor and Arduino
Scroll to Top