Summary: Development for the Internet of Things is more complex than mobile app development. Here’s a summary of how it’s done.
Valuable as rapid prototyping is when creating iOS apps, it's even more valuable when building an IoT device. This is because with an IoT device, all tiers of the application, from front-end to back-end, are custom-built.
When building web apps or iOS apps, we can use an IDE to simulate what the front end would look like. We can also rely on the device (smartphone or computer) to handle any outbound communication. For an IoT device, the front end is a circuit board plus sensors, and figuring out how to manage communications is part of the design challenge.
Using off-the-shelf prototyping tools, we can figure out what works before investing in custom-manufacturing a hardware device. The tools let us model and try out hardware, infrastructure, and applications, developing a functional prototype across all layers and shortening the design cycle. Having a working prototype lets us see how it works in the real world and make design adjustments based on observed behavior before locking in a solution.
When building an IoT device, there are actually two front ends to consider. The first is the physical device itself, which will obtain and independently respond to sensor input, communicate the data to the back end servers, and respond to instructions from the back end. The second front end is a web or mobile app used for monitoring and controlling the hardware. Good design lets both front ends communicate with the same back end processes.
Device Front End
Arduino is a family of microcontroller boards. It gets input from sensors and can control lights and motors in response. Standard connectors and add-on circuit boards called "shields" let us extend the basic functionality. There are shields that add Ethernet, Wi-Fi, and GPRS (cellular) communication capabilities to the board. Some Arduino boards have built-in Wi-Fi and Ethernet capability, plus Linux processors to support more complex functionality. The Arduino boards are programmed through USB-to-serial adapters.
Arduino comes with a basic IDE that supports debugging the Arduino programming language by simple communication through a serial line. Services are exposed and accessed via a RESTful interface over HTTP.
We can buy pre-assembled Arduino boards or build them by hand. The hardware modules are licensed under Creative Commons, so we can extend them as needed. Arduino's software is also open source, and is expandable via C++ libraries.
Raspberry Pi is actually a small-size Linux computer; it's fully functional to the point where it can run desktop applications (or any existing Linux-compatible software that would be useful for the IoT device). It can be programmed in standard languages like Python and comes with it already installed. Raspberry Pi has multiprocessing capability and can run more than one application at a time.
Choose One or Use Both
Either Arduino or Raspberry Pi can be used, and they can even be used together. Arduino is cheaper, but has a slower clock and less RAM and flash memory. It uses less power than Raspberry Pi. Raspberry Pi can easily drive video displays and USB devices like keyboards and mice, but is harder to wire up to sensors.
It's easier to jump right into programming an Arduino board than Raspberry Pi (there's no need to load an OS or other software), but you can only run one program at a time. Debugging is easier on Raspberry Pi, with more advanced tools available and the ability to run Python interactively.
Sometimes the ideal choice is to get the best of both worlds and use an Arduino board to control the sensors and Raspberry Pi to control the overall process.
iOS and Mobile App Front Ends
Most IoT devices have an app front end to display status and control settings. We build these with our standard rapid prototyping tools, including Django and Swift.
The IoT device needs a mechanism to connect to the Internet to communicate with the backend servers. Any communication mechanism, wired or wireless, will work. We can add connectivity modules to the prototype to support Ethernet, Wi-Fi, BLE (Bluetooth), NFC, or cellular.
Bluetooth and NFC are useful for local proximity communication between the IoT device and the linked smartphone. (Apple tends toward Bluetooth, while Android leans to NFC). Sometimes we want this for security reasons or to let the phone interact with the device when a network connection isn't available. It can also enable more real-time interaction between the user and the device. These protocols also can trigger automatic actions when the device and phone are in range, without requiring any specific user instruction, such as a smart door unlocking when the owner approaches.
IoT Back End
Despite the novel front ends created for IoT development, there's nothing unique about the back end. We can still apply our proven tech stack, using the same database, frameworks, and other software development tools that we use for web and iOS development.
Benefits of Rapid Prototyping for IoT Development
Rapid prototyping lets us develop IoT hardware and software the same way we'd develop any application, working in short sprints that get working product versions out for frequent testing. With software, creating new product versions only requires time and effort; with IoT devices, if we didn't have the rapid prototyping tools, we'd need to custom-make new hardware with each sprint.
Although it's always tempting to ship the last prototype as the product, it's more cost effective and efficient to make custom PCBs through circuit integration. Rapid prototyping should remain a development technique—not a manufacturing methodology.