Arduino mobile development with Blynk, a dual device demo 

 September 19, 2020

By  Peter

Demonstration video:

After spending a bit of time playing with Blynk, I have created a demonstration of some of the things you can do with it. In this demo, I use an Arduino Nano 33 IoT and ESP32, and run a private Blynk server on a Raspberry Pi Zero W.

What is Blynk?

In case you are not familiar with Blynk, here’s a quick introduction:

Blynk is a platform for rapid development of smartphone applications that work with devices such as the Arduino, the Raspberry Pi, the ESP32/ESP8266, and many others.

Here’s a full list.

The real list of compatible hardware is much longer.

For example, the Arduino Nano 33 IoT is not included in the list. Still, because this specific Arduino model is WIFI-compatible with the Arduino MKR 1010 (which is in the list), it is also possible to use with Blynk.

The Arduino Nano 33 IoT is one of the devices that I am using in this demo (the other is a generic ESP32).

Blynk implements a server-centric model: A Blynk server provides connectivity and communications between any connected devices, such as Arduinos, ESP32 and smartphones.

An example Blynk app

Here’s an example of an app I put together in a few minutes:

An Arduino Nano 33 IoT that sends its accelerometer data to my phone:

The Arduino Nano 33 IoT has a built-in accelerometer and Wifi, so it is perfect for small experiments like this (and much more, of course).

In this experiment, I wrote a simple sketch that connects the Arduino to the public Blynk server and sends over data from its accelerate. On my phone, my custom Blynk app shows that data graphically.

I also added a couple of buttons to control the Arduino build-in LED, plus an external LED.

Blynk provides a comprehensive library for the Arduino IDE and a set of widgets for the mobile phone app so that you can prototype rapidly. I am impressed by how much you can do once you understand just the basics.

But what Blynk can deliver is much more than trivial applications for blinking LEDs (or as the Blynk developers would say “blynking LEDs”). You can use Blynk to develop professional smartphone applications (for iOS and Android) and deliver them to market at a massive scale.

An example multi-device app

Blynk apps can work with more than one devices. You can also implement a private Blynk server so that you have total control and ownership of the application data, with no restrictions that I am aware of.

So, I wanted to try this out. I build a Blynk application that interacts with two devices (an Arduino Nano 33 IoT and an ESP32), supported by a private Blynk server running on a Raspberry Pi Zero W.

You can see this application in action in this video (or continue to read).

The Raspberry Pi Zero is having no trouble at all running the Blynk server, despite having a single-core processor and just 512MB of RAM.

As you can see below, it is consuming a fraction of the available CPU cycles and memory (I did some basic optimization for the RAM).

The Blynk server is light on resources. Here, running on a Raspberry Pi Zero W.

I can control the connected devices via the widgets on the Blynk app. I can turn LED on/off using buttons, or their brightness using sliders. I can also get text output from the devices displayed in the terminal widget. I can organise those widgets in any way I like, and connect them to any device.

Use any of the wide range of Blynk widgets to interact with your devices.

A very interesting widget is the plotter. I “connected” the accelerometer X-Y-Z output from the Arduino Nano 33 IoT to the plotter widget. This shows the values in real-time, in a beautiful graph, that can also go full screen. Of course, you can export the data in CSV format for processing. Just imagine how difficult it would be to implement something like this outside of the Blynk platform.

You can also use the Blynk server to send emails from the devices. In my example, I connected a button widget to a function on the ESP32 so that when I press the button, the ESP32 will send me an email with the millis value.

Blynk supports email, Twitter and iOS/Android push notifications.

There are other communications options, such as Twitter or push notifications to your smartphone.

Very cool!

With this demo, I wanted to show you what I’ve done in the time I’ve been playing with Blynk.

If you have any ideas of experiments that you’d like me to conduct, please ask via the comments box below.

I’m also keen to know about any Blynk applications you have made.

Peter


Peter Dalmaris is an educator, electrical engineer, electronics hobbyist, and Maker. Creator of online video courses on DIY electronics and author of three technical books, and has recently released his book Maker Education Revolution.   As a Chief Tech Explorer since 2013 at Tech Explorations, the company he founded in Sydney, Australia, Peter’s mission is to explore technology and help educate the world.  Tech Explorations offers educational courses and Bootcamps for electronics hobbyists, STEM students and STEM teachers. A life-long learner, Peter’s core skill is in explaining difficult concepts through video and text. With over 15 years of tertiary teaching experience, Peter has developed a simple yet comprehensive style in teaching that students from all around the world appreciate.  His passion for technology and in particular for the world of DIY open source hardware has been a dominant driver that has guided his personal development and his work through Tech Explorations. Peter’s current online courses have helped over 60,000 people from around the world to be better Makers. 

Peter Dalmaris

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Subscribe to our newsletter now!

>