Tag

iot

Browsing

When running on a battery, it is important to know what parts of your circuit draw the most current. Profiling is a process where you look at sections of code or interactions with hardware to see how much power each requires. In this video, James shows four tools (and their tradeoffs) when profiling IoT or Edge Machine Learning devices. See if it makes more sense for you to use a Digital Multimeter (DMM), Power Supply with history graphs, an oscilloscope

Everywhere I look, I see a new device with a microcontroller, some sensors, a battery, and 2.4 GHz radio. All of these things connect to the Internet. It is like the internet is becoming full of these things. (There should be a catchy name for that.)

As a hardware designer, there is always a concern about how much power these devices consume. Modern microcontrollers (and sensors) are very dynamic devices. In other words, they go from sipping nanoamps to hundreds of milliamps in a few microseconds (or faster.) So, slower devices like a DMM may not be fastest enough to measure a device’s current consumption for an accurate view of its full behavior.

In this element14 Presents video, I compare Handheld DMM, Bench DMM, Power Supply (with graphing), Oscilloscope with Current probe, and Source Measurement Units (SMU) for measuring an IoT device’s current consumption. My favorite tool for this activity is the Nordic Power Profilier Kit 2. It is a USB-based SMU designed for measuring the power consumption of IoT devices. The best part is they only cost around $100!

Whether you are developing a WiFi-enabled coffee maker, a sensor to detect rainfall, or a livestock tracking drone, an IoT device will follow the same product development cycle.

[featured-image single_newwindow=”false”]

A common mistake that engineers will make is trying to own the development at each stage, at least up until “deliver.” Who can blame us? The idea of delegating any part of our new product introduction can be daunting. Delegating, or outsourcing can be a powerful tool. It allows you to focus on the elements of your process that only you can do. Let others handle the rest. If your core contribution is the machine learning algorithm, then focus your effort there. Spending time designing the enclosure, or negotiating with suppliers, or even laying out the printed circuit board is a waste. Let the people who excel in each of those areas apply their expertise to your product.

Production, or making, is the prominent point for outsourcing. It is common to work with a contract manufacturer to build your product. Some offer complete services that allow them to source your components, produce the product, package it, and drop ship it to your customer. This next statement might sound recursive, but consider outsourcing the step of finding someone to outsource manufacturing.

Let’s look at the Idea, Design, and Source stages for a typical IoT device. At each of these steps, I give some pointers to help identify what you should focus on and what you can delegate to a third-party, as well as, introduce you to a partner to consider.

In my Arduino MQTT Examples, I kept things simple by only subscribing to a single topic. One of the strengths of MQTT is that a device can subscribe (or publish) to multiple topics. The broker will sort things out. Even though my first example only showed one, it is straight forward to get the Arduino PubSubClient library to subscribe to Multiple MQTT topics. The quick answer is that you need to look at the MQTT response to find out which topic sent the payload.

tl;dr version

If you’re looking for a quick answer, here’s the magic code we’ll add to the callback() function.

void callback(char* topic, byte* payload, unsigned int length) {
if (strcmp(topic,"pir1Status")==0)
  // whatever you want for this topic
}
Keep reading for a more detailed explanation of how to Subscribe to Multiple MQTT topics with Arduino’s PubSubClient. Obviously, this code will work on Arduino boards with a TCP/IP interface and, of course, the ESP8266 based boards.

Pulse Width Modulation (PWM) makes it possible to dim lights, control the speed of motors, and (with the help of filters) generate analog reference voltages. When measuring the voltage or current of a PWM signal, there are unique challenges. You can use this tutorial to measure PWM current with a modified moving average (MMA).