Book Image

Learning IoT with Particle Photon and Electron

By : Rashid Khan, Kajari Ghoshdastidar, Ajith Vasudevan
Book Image

Learning IoT with Particle Photon and Electron

By: Rashid Khan, Kajari Ghoshdastidar, Ajith Vasudevan

Overview of this book

IoT is basically the network of physical devices, vehicles, buildings and other items—embedded with electronics, software, sensors, actuators, and network connectivity that enable these objects to collect and exchange data.. The number of connected devices is growing rapidly and will continue to do so over years to come. By 2020, there will be more than 20 billion connected devices and the ability to program such devices will be in high demand. Particle provides prototyping boards for IoT that are easy to program and deploy. Most importantly, the boards provided by Particle can be connected to the Internet very easily as they include Wi-Fi or a GSM module. Starting with the basics of programming Particle Photon and Electron, this book will take you through setting up your local servers and running custom firmware, to using the Photon and Electron to program autonomous cars. This book also covers in brief a basic architecture and design of IoT applications. It gives you an overview of the IoT stack. You will also get information on how to debug and troubleshoot Particle Photon and Electron and set up your own debugging framework for any IoT board. Finally, you’ll tinker with the firmware of the Photon and Electron by modifying the existing firmware and deploying them to your boards. By the end of this book, you should have a fairly good understanding of the IoT ecosystem and you should be able to build standalone projects using your own local server or the Particle Cloud Server.
Table of Contents (11 chapters)

What is Particle?


Particle (https://www.particle.io), formerly known as Spark, is a company started by Zach Supalla. It provides hardware and software for the development of IoT projects.

The journey of Particle

The first company started by Zach Supalla in 2011 was known as Hex Goods, and it sold designer products online. In early 2012, Hex Goods was shut down, and Zach started a second company called Switch Devices, which dealt with connected lighting. Switch Devices was then renamed Spark Devices. The name Spark was used as it provided a double meaning to the founders. Spark stood for spark of light and also sparks of inspiration.

In early 2013, Spark transformed to an IoT platform for engineers and developers. The name Spark also did not last long as the founders felt Spark created confusion for a lot of users. There exist 681 live trademarks that include the word Spark. Apart from the number of trademarks, there are some other great, unrelated software and hardware products employing the name Spark in them—some of them being Apache Spark, SparkFun, and Spark NZ. It has been reported that a lot of people logged on to Zach's #spark IRC channel and asked questions about big data.

The name Particle was finally chosen, as it gave plenty of room to grow in terms of products and offerings. Particle, in scientific terms, is a single discreet unit within a larger system. The name draws a parallel with the mission of Particle—the company which provides development kits and devices as single units used to build the greater whole of IoT.

We'll cover Particle IoT products in depth, and see how and when they perform better than other IoT development boards.

Why Particle?

Today, the most recurring problem with all existing IoT prototyping boards is that of connectivity. In order to connect the existing boards to the Internet, additional components such as Wi-Fi or GSM modules have to be attached in the development environment as well as in production. Attaching external devices for communication is cumbersome, and adds another point of failure with frequent issues such as Internet unavailability, intermittent network connectivity, and so on. This leads to a bad experience for the developer.

Developers have to frequently (re)write code, deploy it onto the device(s), test, debug, fix any bugs, rinse, and repeat. The problem with code deployment with existing boards is that the boards need to be connected to a computer, which means for even the smallest code update, the device/board needs to be connected to the developer's computer, either by moving the computer to the device (which may be located at a not-so-easily accessible location) or vice versa. This poses a problem when the device, after an update at the developer's site, has to be placed back in its original production environment for testing and debugging the new changes. This means large turnaround times to load new code into production.

Particle provides products that have built-in Wi-Fi modules or GSM modules, which help in easy connection to a network or the Internet, with support for Over-The-Air (OTA) code deployment. This removes the hassle of adding extra modules on the prototyping boards for connectivity, and it also allows pushing code or testing/debugging onsite. As previously mentioned, one of the important features that differentiates Particle products from other devices is the Particle device's ability of deploying code over the air. New code can be deployed onto the device or burnt, as the process is called in embedded systems parlance, via REST API calls, which makes it very convenient to provide updates. This feature of Particle products helps with a faster code release cycle and testing/debugging.

What does Particle offer?

Particle offers a suite of hardware and software tools to help prototype, scale, and manage the IoT products. It also provides the ability to build cloud-connected IoT prototypes quickly. If you're satisfied with your prototype and want to productize your IoT design, no problem there. It helps us to go from a single prototype to millions of units with a cloud platform that can scale as the number of devices grow.

The popular Particle hardware devices are listed as follows:

  • Core: A tiny Wi-Fi development kit for prototyping and scaling your IoT product. Reprogrammable and connected to the cloud, this has now been superseded by the Photon.

  • Photon: A tiny Wi-Fi development kit for prototyping and scaling your IoT product. Reprogrammable and connected to the cloud.

  • Electron: A tiny development kit for creating 2G/3G cellular connected products.

The Photon and the Core are bundled with Wi-Fi modules, which help them connect to a network or the Internet without adding any extra modules.

The Electron has a 3G/2G GSM module, that can be used to send or receive messages directly or connect to the Internet.

The firmware for the Photon, Electron, and Core can be written in a web-based IDE provided by Particle, and the deployment of the firmware code to the device is done over the air. Particle also offers SDKs for mobile and the Web to extend the IoT experience from the devices/sensors to the phone and the Web.

A detailed comparison between Photon, Electron, and Core is given in the next section.