How To Create a Cross Platform App for the Particle Platform Using Blynk

Jared Wolff · 2018.11.12· 2 Minute Read · particle · blynk

Phone screen

As “fun” as it is to take days if not months to create a mobile app, no one likes to wait. So, how can you get to something working that you can get up and running and focus on the next thing?

Enter Blynk.

Blynk is an app that creates apps. You can use it to monitor the air inside your house or even turn your lights on and off. Your imagination is your limitation.

The best part about it?

It took about two minutes.

Here’s the steps to get started:

  1. Install the library in Particle Dev

    Install the library in Particle Dev

  2. Include the library in your project.

    #include <blynk.h>
  3. Add the auth key

    char blynk_auth[] = "<your key here>";

    Note: Once you setup the Blynk app, it should give you your API key. Insert that above.

    Note: Also, for safety, make sure you don’t commit this!

  4. In your setup() initialize Blynk:

  5. Write data where needed:

    Blynk.virtualWrite(<Vpin>, millis() / 1000);

    Where is the virtual “pin” you’re writing to.

    Here are some examples of how I’m using it in my project:

    Blynk.virtualWrite(V0, String::format("%.2f", onboard_humidity / 100.0));
    Blynk.virtualWrite(V1, String::format("%.2f", onboard_temp / 100.0));
    Blynk.virtualWrite(V2, String::format("%.3f", thermo_temp));

    String::format generates a string from the floating point data from the sensors.

  6. Compile and load the firmware.

    Compile the firmware

  7. Now, in the Blynk app, and add your widget of choice:

    Adding the widget

    I added a labeled value in this case. I changed the label to match what I wanted it to display.

  8. Finally, connect the virtual pin to that

    Connecting a virtual "pin"

  9. “Start the application”

    Start the application

  10. Your app should start updating as long as your Particle is up and running. The frequency depends on your update interval. Thus, tweak that as necessary in your firmware.

In conclusion, this was a fast and convenient way to get data into a visual and mobile format. It saved me time and allowed me to focus on other things like writing this post!

Thanks for reading and be sure to signup for my free newsletter below so you’re never be in the dark.


The Ultimate Guide to Particle Mesh Cover

Get Ready for the Ultimate Guide

Signup to get updates on The Ultimate Guide to Particle Mesh. Early subscribers get a discount when it becomes available!

Sign me up!

You may also like

Particle Mesh App Highlights

The Particle application for iPhone and Android can be a handy tool. Particle has been working hard on improvements to make it more versatile than it used to be. No longer are the…

How to Real Time Processing on Particle Mesh

Sometimes you run into an application that requires something to happen in real-time. I’m not talking about seconds or milliseconds, we’re talking about microsecond accuracy here.…

Better Battery Life for Delightful Particle Deployments

IoT devices (almost) always need batteries. With those batteries some important things to think about: How long your device will last. How your device will perform in the…