Easing into the IoT Cloud (Part 2)

Modules in Action

In Part 1 of this article series, Brian examined some of the technologies and services available today, enabling you to ease into the IoT cloud. Now, in Part 2, he discusses the hardware features of the Particle IoT modules, as well as the circuitry and program code for the project. He also explores the integration of a Raspberry Pi solution with the Particle cloud infrastructure.

By Brian Millier

After looking at broader aspects of easing into the IoT Cloud in Part 1, now it’s time to get into the hardware and software details. Let’s take a look at three of the Particle modules, shown in Figure 1. The P0 module contains the Cypress Semiconductor BCM43362 Wi-Fi chip and STMicroelectronics STM32F205RGY6 120 MHz Arm Cortex M3 microcontroller (MCU), in a small surface mount package. The Photon module contains this P0 module, plus a 3.3 V switch-mode power supply regulator, USB socket, mode switches and an RGB LED—all mounted on a 24-pin DIP package. The Electron module contains the U-blox SARA-U260/U270 3G cellular modem, the STM32F205RGT6 120  MHz Arm Cortex M3 MCU, a BQ24195 power management unit/battery charger, a Maxim Integrated battery gauge IC, plus the same mode switches and RGB LED contained on the Photon. It is mounted on a larger, 36-pin DIP module.

Figure 1
Shown here are three of the Particle IoT modules. The two on the left are Wi-Fi, and the one on the right is 3G Cellular.

The Photon and Electron share a common set of peripheral ports. These include 1x 12- bit ADC with up to 8 inputs, 2x 12-bit DACs, 2x  SPI, 1x I2C, 1x I2S, 1x CAN, 1x USB, 9x PWM, 1x UART and 18x GPIO.

The Electron module, having 12 more pins, has more of some of the above peripheral ports. Because the peripheral ports of both modules occupy many of the available pins, there will be fewer GPIO pins available if you use some the peripheral ports.
Particle provides libraries or high-level APIs for just about all the peripheral ports I’ve listed. The only peripheral port that I found was not supported was the I2S block. I2S is basically a high-speed bus dedicated to audio DACs/ADCs/Codecs. Due to the high speed, synchronous data transfers that I2S devices demand, such devices are generally not compatible with the real-time operating system (FreeRTOS) that the

Particle device runs under (unless you use DMA-based I2S).
Particle’s GPIO, I2C and SPI API’s are written to be compatible with their counterparts in Arduino. Because of that, third-party Arduino libraries that are available for many common peripheral chips/breakout modules will work with the Particle modules without further tweaking.

Both the Proton and Electron come with a tiny U.FL socket for an external antenna. In the Electron, a Taoglas external antenna is required and is provided. The Photon has a small PCB-mounted Wi-Fi chip antenna, but you can also use an external antenna if you are mounting the Photon in a case that doesn’t allow RF to penetrate. There is an Automatic RF mode, where the best signal from either the chip or external antenna is used.

The Electron module can draw around 2 A or more when communicating with a cell tower. This is more current than can be supplied if you were to plug the Electron into a PC’s USB port. Although you can get USB adapters that supply greater than 2 A, you wouldn’t be able to communicate with the Electron via USB, which would be handy during debugging. Particle wisely decided to include a Li-Po battery charger on-board and included a 2,000 mA-hours Li-Po battery with JST plug in the Electron kit. This assures the user that there will be enough power available to operate the cellular modem’s RF circuitry at full power.

As of this writing, the Particle 3G Electron (in the DIP package) is only available in an educational “kit” format, which includes the Electron module, antenna, LiPo battery, USB cable and a small protoboard. With all those support components included, it’s a good deal at $69. The E-Series SMT module, meant to be integrated into a commercial product, is more expensive ($79 in unit quantities), and doesn’t include any of the support components in the Electron kit.

PROJECT CIRCUIT DETAILS

The first Particle-based project I built was the over-temperature alarm that I described in Part 1 of this series. It also sends out an alert if the power fails. Figure 2 is a schematic of the circuit. I decided to use the Dallas Semiconductor (now Maxim Integrated) DS18S20 1-wire temperature measurement device. It is more expensive than a thermistor, but is accurate to within ± 0.5°C and doesn’t need any calibration procedure. The Particle library contains a “ds18x20” library that handles both the DS18B20 and the DS18S20 devices. These two devices differ in that each one outputs temperature at a different resolution, and the library handles this transparently. The DS18x20 can be operated in a 2-wire mode—signal and parasitic power on one wire, and ground on the other. However, timing constraints are less onerous if you use separate wires for the signal and power lines, and that is how I wired mine.

Figure 2
Schematic diagram of the project, using an Electron Cellular module.

I chose a small Nokia 5110 LCD display for the user interface. These are inexpensive, as they are pulled from or are surplus units from popular older Nokia cell phones. An Arduino-based Nokia 5110 library works with Particle devices. This can be found in the “Library” section of the Particle Web-based IDE. The 5110 LCD has a separate backlight pin, which can be driven by a PWM signal, to control the backlight LED’s brightness. I run the backlight with a PWM duty cycle of 25%, which is plenty bright and uses less power.

The user controls are as follows:

1) An SPDT switch acts as the Setpoint UP/DOWN adjustment.
2) A TEST pushbutton, when pressed, simulates an over-temperature condition and sends out the same message for test purposes.
3) A RESET pushbutton is connected to the Electron module’s *RST pin.
4) While not shown in my diagram, I later added a switch in series with the Li-Po battery’s positive wire, to disconnect the Li-Po completely. This allows the unit to be turned off when the USB power adapter is unplugged and this switch is shut off.
The LCD displays the current time, which is synchronized with the Particle cloud server, so it’s very accurate. It also displays the measured temperature and the Setpoint temperature. The fourth line of the display indicates the AC power status. Because the power status is only monitored once per minute, it will not report a momentary power-loss.

Read the full article in the January 342 issue of Circuit Cellar

Don’t miss out on upcoming issues of Circuit Cellar. Subscribe today!

Note: We’ve made the October 2017 issue of Circuit Cellar available as a free sample issue. In it, you’ll find a rich variety of the kinds of articles and information that exemplify a typical issue of the current magazine.

Firms Team for End-to-End, Open, Modular IoT Architecture

Eurotech has announced the availability of an end-to-end IoT architecture based on open standards, developed in collaboration with Cloudera and Red Hat. The new IoT architecture is an open, modular, multi-cloud architecture with security features organically built-in to enable scalable and more secure end-to-end device management and analytics from the edge to the cloud. It combines operational technology (OT), information technology (IT), data analytics and application integration.
The architecture has been built on top of key open source projects and innovations out of the Eclipse Foundation and Apache Foundation. By bridging OT and IT, this open source-based architecture can help address the main aspects of managing an IoT infrastructure including connectivity, configuration, and embedded application life cycle. The architecture can also aggregate real-time data streams from the edge, archive them, or route them towards enterprise IT systems and analytics.

With this solution, Eurotech, Red Hat and Cloudera are aiming to make it easier for organizations to roll out IoT use cases by providing a validated, modular, end-to-end IoT architecture built to be open, interoperable and cost effective.

Eurotech | www.eurotech.com

July Circuit Cellar: Sneak Preview

The July issue of Circuit Cellar magazine is coming soon. And we’ve rustled up a great herd of embedded electronics articles for you to enjoy.

Not a Circuit Cellar subscriber?  Don’t be left out! Sign up today:

 

Here’s a sneak preview of July 2018 Circuit Cellar:

TECHNOLOGIES FOR THE INTERNET-OF-THINGS

Wireless Standards and Solutions for IoT  
One of the critical enabling technologies making the Internet-of-Things possible is the set of well-established wireless standards that allow movement of data to and from low-power edge devices. Here, Circuit Cellar’s Editor-in-Chief, Jeff Child, looks at key wireless standards and solutions playing a role in IoT.

Product Focus: IoT Device Modules
The rapidly growing IoT phenomenon is driving demand for highly integrated modules designed to interface with IoT devices. This Product Focus section updates readers on this technology trend and provides a product album of representative IoT interface modules.

TOOLS AND TECHNIQUES AT THE DESIGN PHASE

EMC Analysis During PCB Layout
If your electronic product design fails EMC compliance testing for its target market, that product can’t be sold. That’s why EMC analysis is such an important step. In his article, Mentor Graphics’ Craig Armenti shows how implementing EMC analysis during the design phase provides an opportunity to avoid failing EMC compliance testing after fabrication.

Extreme Low-Power Design
Wearable consumer devices, IoT sensors and handheld systems are just a few of the applications that strive for extreme low-power consumption. Beyond just battery-driven designs, today’s system developers want no-battery solutions and even energy harvesting. Circuit Cellar’s Editor-in-Chief, Jeff Child, dives into the latest technology trends and product developments in extreme low power.

Op Amp Design Techniques
Op amps can play useful roles in circuit designs linking the real analog world to microcontrollers. Stuart Ball shares techniques for using op amps and related devices like comparators to optimize your designs and improve precision.

Wire Wrapping Revisited
Wire wrapping may seem old fashioned, but this tried and true technology can solve some tricky problems that arise when you try to interconnect different kinds of modules like Arduino, Raspberry Pi and so on. Wolfgang Matthes steps through how to best employ wire wrapping for this purpose and provides application examples.

DEEP DIVES ON MOTOR CONTROL AND MONITORING

BLDC Fan Current
Today’s small fans and blowers depend on brushless DC (BLDC) motor technology for their operation. In this article, Ed Nisley explains how these seemingly simple devices are actually quite complex when you measure them in action. He makes some measurements on the motor inside a tangential blower and explores how the data relates to the basic physics of moving air.

Electronic Speed Control (Part 1)
An Electronic Speed Controller (ESC) is an important device in motor control designs, especially in the world of radio-controlled (RC) model vehicles. In Part 1, Jeff Bachiochi lays the groundwork by discussing the evolution of brushed motors to brushless motors. He then explores in detail the role ESC devices play in RC vehicle motors.

MCU-Based Motor Condition Monitoring
Thanks to advances in microcontrollers and sensors, it’s now possible to electronically monitor aspects of a motor’s condition, like current consumption, pressure and vibration. In this article, Texas Instrument’s Amit Ashara steps through how to best use the resources on an MCU to preform condition monitoring on motors. He looks at the signal chain, connectivity issues and A-D conversion.

AND MORE FROM OUR EXPERT COLUMNISTS

Verifying Code Readout Protection Claims
How do you verify the security of microcontrollers? MCU manufacturers often make big claims, but sometimes it is in your best interest to verify them yourself. In this article, Colin O’Flynn discusses a few threats against code readout and looks at verifying some of those claimed levels.

Thermoelectric Cooling (Part 1)
When his thermoelectric water color died prematurely, George Novacek was curious whether it was a defective unit or a design problem. With that in mind, he decided to create a test chamber using some electronics combined with components salvaged from the water cooler. His tests provide some interesting insights into thermoelectric cooling.

 

June Circuit Cellar: Sneak Preview

The June issue of Circuit Cellar magazine is coming soon. And we’ve planted a lovely crop of embedded electronics articles for you to enjoy.

Not a Circuit Cellar subscriber?  Don’t be left out! Sign up today:

 

Here’s a sneak preview of June 2018 Circuit Cellar:

PCB DESIGN AND POWER: MAKING SMART CHOICES

PCB Design and Verification
PCB design tools and methods continue to evolve as they race to keep pace with faster, highly integrated electronics. Automated, rules-based chip placement is getting more sophisticated and leveraging AI in interesting ways. And supply chains are linking tighter with PCB design processes. Circuit Cellar Chief Editor Jeff Child looks at the latest PCB design and verification tools and technologies.

PCB Ground Planes
Tricky design decisions crop up when you’re faced with crafting a printed circuit board (PCB) for any complex system—and many of them involve the ground plane. There is dealing with noisy components and deciding between a common ground plane or separate ones—and that’s just the tip of the iceberg. Robert Lacoste shares his insights on the topic, examining the physics, simulation tools and design examples of ground plane implementations.

Product Focus: AC-DC Converters
To their peril, embedded system developers often treat their choice of power supply as an afterthought. But choosing the right AC-DC converter is critical to the ensuring your system delivers power efficiently to all parts of your system. This Product Focus section updates readers on these trends and provides a product album of representative AC-DC converter products.

SENSORS TAKE MANY FORMS AND FUNCTIONS

Sensors and Measurement
While sensors have always played a key role in embedded systems, the exploding Internet of Things (IoT) phenomenon has pushed sensor technology to the forefront. Any IoT implementation depends on an array of sensors that relay input back to the cloud. Circuit Cellar Chief Editor Jeff Child dives into the latest technology trends and product developments in sensors and measurement.

Passive Infrared Sensors
One way to make sure that lights get turned off when you leave a room is to use Passive Infrared (PIR) sensors. Jeff Bachiochi examines the science and technology behind PIR sensors. He then details how to craft effective program code and control electronics to use PIR sensors is a useful way.

Gesture-Recognition in Boxing Glove
Learn how two Boston University graduate students built a gesture-detection wearable that acts as a building block for a larger fitness telemetry system. Using a Linux-based Gumstix Verdex, the wearable couples an inertial measurement unit with a pressure sensor embedded in a boxing glove to recognize the user’s hits and classify them according to predefined, user-recorded gestures.

SECURITY, RELIABILITY AND MORE

Internet of Things Security (Part 3)
In this next part of his article series on IoT security, Bob Japenga looks at the security features of a specific series of microprocessors: Microchip’s SAMA5D2. He examines these security features and discusses what protection they provide.

Aeronautical Communication Protocols
Unlike ground networks, where data throughout is the priority, avionics networks are all about reliability. As a result, the communications protocols used in for aircraft networking seem pretty obscure to the average engineer. In this article, George Novacek reviews some of the most common aircraft comms protocols including ARINC 429, ARINC 629 and MIL-STD-1553B

DEEP DIVES ON PROCESSOR DESIGN AND DIGITAL SIGNAL PROCESSING

Murphy’s Laws in the DSP World (Part 1)
A Pandora’s box of unexpected issues gets opened the moment you move from the real world of analog signals and enter the world of digital signal processing (DSP). In Part 1 of this new article series, Mike Smith defines six “Murphy’s Laws of DSP” and provides you with methods and techniques to navigate around them.

Processor Design Techniques and Optimizations
As electronics get smaller and more complex day by day, knowing the basic building blocks of processors is more important than ever. In this article, Nishant Mittal explores processor design from various perspectives—including architecture types, pipelining and ALU varieties.

April Circuit Cellar: Sneak Preview

The April issue of Circuit Cellar magazine is coming soon. And we’ve got a healthy serving of embedded electronics articles for you. Here’s a sneak peak.

Not a Circuit Cellar subscriber?  Don’t be left out! Sign up today:

 

Here’s a sneak preview of April 2018 Circuit Cellar:

NAVIGATING THE INTERNET-OF-THINGS

IoT: From Gateway to Cloud
In this follow on to our March “IoT: Device to Gateway” feature, this time we look at technologies and solutions for the gateway to cloud side of IoT.  Circuit Cellar Chief Editor Jeff Child examines the tools and services available to get a cloud-connected IoT implementation up and running.

Texting and IoT Embedded Devices (Part 2)
In Part 1, Jeff Bachiochi laid the groundwork for describing a project involving texting. He puts that into action this, showing how to create messages on his Espressif System’s ESP8266EX-based device to be sent to an email account and end up with those messages going as texts to a cell phone.

Internet of Things Security (Part 2)
In this next part of his article series on IoT security, Bob Japenga takes a look at side-channel attacks. What are they? How much of a threat are they? And how can we prevent them?

Product Focus: 32-Bit Microcontrollers
As the workhorse of today’s embedded systems, 32-bit microcontrollers serve a wide variety of embedded applications—including the IoT. This Product Focus section updates readers on these trends and provides a product album of representative 32-bit MCU products.

GRAPHICS, VISION AND DISPLAYS

Graphics, Video and Displays
Thanks to advances in displays and innovations in graphics ICs, embedded systems can now routinely feature sophisticated graphical user interfaces. Circuit Cellar Chief Editor Jeff Child dives into the latest technology trends and product developments in graphics, video and displays.

Color Recognition and Segmentation in Real-time
Vision systems used to require big, multi-board systems—but not anymore. Learn how two Cornell undergraduates designed a hardware/software system that accelerates vision-based object recognition and tracking using an FPGA SoC. They made a min manufacturing line to demonstrate how their system can accurately track and categorize manufactured candies carried along a conveyor belt.

SPECIFICATIONS, QUALIFICATIONS AND MORE

Component tolerance
We perhaps take for granted sometimes that the tolerances of our electronic components fit the needs of our designs. In this article, Robert Lacoste takes a deep look into the subject of tolerances, using the simple resistor as an example. He goes through the math to help you better understand accuracy and drift along with other factors.

Understanding the Temperature Coefficient of Resistance
Temperature coefficient of resistance (TCR) is the calculation of a relative change of resistance per degree of temperature change. Even though it’s an important spec, different resistor manufacturers use different methods for defining TCR. In this article, Molly Bakewell Chamberlin examines TCR and its “best practice” interpretations using Vishay Precision Group’s vast experience in high-precision resistors.

Designing of Complex Systems
While some commercial software gets away without much qualification during development, the situation is very different when safety in involved. For aircraft, vehicles or any complex system where failure unacceptable, this means adhering to established standards throughout the development life cycle. In this article, George Novacek tackles these issues and examines some of these standards namely ARP4754.

AND MORE IN-DEPTH PROJECT ARTICLES

Build a Marginal Oscillator Proximity Switch
A damped or marginal oscillator will switch off when energy is siphoned from its resonant LC tank circuit. In his article, Dev Gualtieri presents a simple marginal oscillator that detects proximity to a small steel screw or steel plate. It lights an LED, and the LED can be part of an optically-isolated solid-state relay.

Obsolescence-Proof Your UI (Part 1)
After years of frustration dealing with graphical interface technologies that go obsolete, Steve Hendrix decided there must be a better way. Knowing that web browser technology is likely to be with us for a long while, he chose to build a web server that could perform common operations that he needed on the IEEE-488 bus. He then built it as a product available for sale to others—and it is basically obsolescence-proof.