Skip to main content

Posts

Showing posts from September, 2017

Using ESP-Link transparent bridge (ESP-01 and Arduino Pro Mini)

Recently stumbled across an interesting open source project ESP-Link. Its main purpose is to network-enable a non-network microcontroller (MCU) such as Arduino Uno, Pro mini or Nano using ESP8266. The author termed it as "Transparent Bridge". The ESP and MCU  communicate via the serial link and there is a companion Arduino library EL-Client for the MCU to connect up the network using MQTT, REST, TCP and UDP.
Setup I have put together an ESP-01 and an Arduino Pro Mini for this experiment. I have chosen a 3.3 version Pro mini so that I do not need to do any voltage level shifting between the I/O pins. In order to have a stable voltage source, the ESP8266 is powered by Pro Mini and the Pro Mini "RAW" pin is connected to a 5v USB power source. The RAW pin can take voltage up to 12V. The reset pin of Pro Mini is connected to GPIO 0 of ESP-01. This enables the ESP-01 to reset the Pro Mini.




I have linked up an APDS 9960 sensor to it and periodically send the luminosity a…

Using Google App Scripts to collect telemetry data - part 2 (ESP32 and Mongoose OS setup)

There are many ESP32 form factor breakout boards that can be purchased cheaply. In this mini project, I am using a form factor that looks like Wemos D1 Mini, so that I can reuse my shield without any wiring. Although no wiring is required, the pinout is different from Wemos D1 Mini. The DHT11 GPIO is 16 in ESP32 instead of 2 (note that Mongoose is using port pin definition. in Arduino, it is defined as D4 but it is mapped IO2).





ESP32 mini board is quite warm when in operation. I have put a dummy shield in between to reduce the interference it may cause to the DHT11 temperature reading.

The source code for the mongoose-os javascript can be found on github.

The setup of Mongoose OS is straightforward. Go to Mongoose site and download the binary, select the board type and change the init.js.


Part 1 Using Google App Scripts to collect telemetry data

Using Google App Scripts to collect telemetry data - part 1

This is one of Google best-kept secrets, Google App Script (GAS). GAS is a Javascript engine that can link various Google front and back end services together. e.g. Periodic scanning a GDrive folder, detect a CSV file and insert into MySQL. The best part of this, it is FREE !!!

Having said that, is there a limit? Yes, there is. Quotas for App Scripts

In the next few articles, I am going to demonstrate how we can collect the IoT data into Google Sheet and dynamically visualise the data using Google Sheet and/or Data Studio.

For this simple demo, I will use an ESP32 and runs Mongoose OS to act as the bridge between GAS and local MQTT server and send temperature/humidity data from DHT11 to Google Sheet.

As written in my previous article on Mongoose OS, the connectivity aspect of Mongoose is very powerful. it provides simple and easy to use Javascript APIs which glued the underlying C/C++ library. To read the sensor value and to Google Apps Script, it needs less than 20 lines of code. The…

Mongoose OS

Recently I was experimenting on the Mongoose OS. It is an open source IoT platform for developing applications on ESP32, ESP8266, STM32, TI CC3200 and TI CC3220 microcontrollers. It supports a simplified version of Javascript (mJS) and C/C++ as the development language for calling the OS APIs.
What are the features that impressed me?
1. Installation There is only 1 executable. (mos.exe) to be downloaded. Just clicked on the EXE and the web based IDE is displayed. Then I connect up ESP32 using the selected serial port, flashed the firmware and connect to my WIFI network. That's it! The MCU is setup! Amazingly simple.



2. Connection to MQTT After the initial setup, the connection to MQTT is only a few clicks away and the ESP32 is setup to send/receive message from MQTT server. Zero code for this entire process. Super impressed!!


Publishing to the MQTT is only a single line of code.
load('api_mqtt.js'); let topic = 'myesp32/topic'; let res = MQTT.pub(topic, JSON.stringify…

A Super IR Transmitter

One of the difficulties I had with the common IR transmitter module block from Arduino kit is it is not powerful. It can only transmit from a distance of about 1 m and the angle is very narrow. I need an effective distance of more than 3m and a wider angle and I wanted to use Tasmota as the bridge so that I can send the IR commands from my PC or another remote non-IR device.

The circuit for the super IR transmitter is as follows. On the web, I have found 2 approaches: connect multiple IR LEDs in series or parallel. The parallel configuration will provide more current to the LEDs and the series configuration will provide less current. I chose the series circuit because the resistance in the parallel circuit cannot be matched properly and the LED with the lowest resistance will get more power than the other which may result in 1 IR Led brighter than the other.






I managed to find a super bright IR transmitter LED in Aliexpress. The LED has a blueish tint compared to the normal white LED.