Use Losant on a Cellular Arduino

Use Losant on a Cellular Arduino © MIT

Connect to the Losant IoT platform via MQTT on an Arduino connected over the Hologram cellular network!

  • 2,333 views
  • 0 comments
  • 7 respects

Components and supplies

Apps and online services

About this project

Losant + Hologram + TinyGSM = Match Made in Maker Heaven

Losant is a great tool for developing IoT applications and API gateways using a visual designer. It's great for building software integrations that interact with devices, which can be anything that connects to their service. In this example, we'll set up an Arduino connected to an off-the-shelf cellular module so that we can send it commands from a Losant workflow. This way, you'll be able to visually program applications that interact with remote hardware!

Hologram Network

Hologram.io is a cellular network provider perfect for makers. At $0.60 /mo plus $0.40 per mb, you'll have plenty of data for most IoT projects. You can get a free SIM card by going to hologram.io and then activate it at dashboard.hologram.io.

Wiring

Most GSM modules, like the SIM800L, will have Power, Ground, RX, and TX. Although you can use certain other pins for SoftwareSerial, it is unstable. Use an Arduino that has extra onboard serial pins. For the Arduino Micro, wire to Serial1. If you end up using SoftwareSerial, set the baudrate to 57600, 38400, or 9600 (unstable)

Before inserting the SIM card make sure you are putting it in the right way.

Not all Arduino boards have regulated power, so in many cases you'll want to supply a separate power supply for your cellular module.

Install TinyGSM Arduino Library

  • Open the Arduino IDE
  • Go to Sketch > Include Library > Manage Libraries
  • Search for TinyGSM and install it

Install Losant MQTT Arduino Library

  • Go to Sketch > Include Library > ADD.ZIP Library
  • Select the downloaded library and it should install

Losant Arduino Device Setup

  • Create a New Application in Losant
  • Create a New Standalone Device for your application
  • Generate an Access Key and Access Key Secret
  • Copy the Device ID, Key and Secret to the correct field in the Arduino sketch
  • Program the Arduino sketch, be sure to set the correct modem you're using at the top of the sketch

Losant Workflow Setup

We need a flow that sends a command "toggle" to the device we set up before.

  • Create a New Cloud Workflow in your app
  • Drag the toggle.flow to the "Import Existing Flow" box in the Settings panel
  • Save and deploy

You should be able to toggle the virtual button to turn Pin 13 on and off!

Code

Comments

Similar projects you might like

Cellular IoT with Blynk & Hologram

by Moheeb Zara

  • 7,364 views
  • 11 comments
  • 25 respects

LTE Cellular Shield for Arduino with Voice!

by Timothy Woo

  • 7,723 views
  • 9 comments
  • 14 respects

Using Chirpers with Hologram. io

by Moheeb Zara

  • 2,358 views
  • 1 comment
  • 8 respects

Arduino and OLED based Cellular Automata

Project tutorial by runtimeprojects

  • 15,594 views
  • 7 comments
  • 9 respects

Home Automation System for a Camp with Cellular Internet

Project tutorial by Dana Mah

  • 11,899 views
  • 4 comments
  • 40 respects

Unicorn Finder (Kid Tracker for Techie Parents)

Project tutorial by Hologram

  • 5,852 views
  • 2 comments
  • 15 respects
Add projectSign up / Login