Designing a complete IOT Product - Outliers

Designing a complete IOT Product - Outliers

It's my first Blog Post and I feel I should discuss somethings on a platform like this. I hope you like this and my future contents.

We see IOT becoming largely popular these days and there exist good scope and demand for IOT developers. However in some way I feel it is being misunderstood by some individuals as Electronics and Embedded Systems, though these are the core parts which creates the Thingy!. So beginner developers and enthusiasts have this question in mind "how to get started with learning and developing IOT products?".

Now to answer this and also complying to the agenda of today's blog post, we will go through various stages of how an IOT product is built and how it works. Lets take the example of a beer vending machine which has payment options with cash and digital wallet and 3 variety of beers. It also has UI screen to interact with the user for operating and can be also operated via an Android App. So an IOT developer should think about the architecture of the machine and how to design it. For this he must have sufficient knowledge of Embedded Systems and Communication protocols, Deployment Servers and programming experience. If not then too entrepreneurs with low technical background can get a quick idea of abstract designing of the product, this would give an idea of the kind of resources needed to develop.

We shall discuss the architecture now,

Required blocks Diagram(1).png

Fig 1.0 shows us some basic blocks of such machine or any IOT product with such use case. We will first talk about each block in brief then we will learn about basic communication protocols and then finally we will learn how to plan the architecture of the complete system.

1. Operator System

This is the basic building block of the system, based mostly electronics and embedded system design. It can be a single micro-controller or multiple interfaced to the motors, sensors or any other I/O devices to physically run the system. This block should mostly act as a slave block performing a specific function, as in our use case it is performing the dispensing mechanism and all the how story behind it. The mechanical movement design also becomes a part of the operator system but is out of scope for us now as we are talking in on this topic in general terms.

2. Control System

This is the Master block which has all the administrative authority of their machine. As we see the Cash collector device, Operator System and UI screen are all interfaced here. This is usually a powerful Microprocessor which commands all the devices on the machine and they make processing and responses this processor. The same Microprocessor also accept wireless service requests through the Internet. Internet Provider interface in this block is a very important part in itself. We need to talk about this in detail, it can be classified into 3 general categories -

WiFi Interface -- Connects to a hot spot nearby. So is it good that our machine will wait for a person to come and give the machine access to the internet through their phone's hot spot ? You'll probably say absolutely NOT. And I agree, but how about I say I give it its own hot spot creating USB dongle or JIO-Fi like device. And doing some protection firewall thing on the hot spot make the WiFi publicly available, even monetize the WiFi usage on your machine. Would you buy that.....Maybe a YES now. So that's one option to use an external hot spot providing device.

Ethernet Connectivity -- This type of interface needs an Ethernet port. Ethernet interface is mostly used inside a campus where each machine has it's access to the Ethernet port.

PCB Cellular Interface -- This is the father of all the interfaces I'd say, because it involves high level complexity on the Hardware level and you can think of it as all the components of the USB dongle or JIO-Fi PCB interfaced on the same PCB of the Control System Card. And yes this is the best and most cost effective and can be highly customizable even configure device's own WiFi hot spot. Quectel, Telit, Lora are some good companies providing products for internet cellular connectivity in India and abroad. Quectel BG96 is a very famous module for 4G internet interface on PCB.

Now that we have an idea how to provide internet to the machine, we will move on to other parts of the control system.

UI Touchscreen -- This touchscreen will act as a specialized Human Machine Interface. The UI should consist of all options to control the dispensing, make payments and use WiFi. This means the UI needs to be such that it communicates both with the server and the Operator System through the Control System's Microprocessor. There are various types of touch L CDs available in the market which get interfaced to a processor and a UI can be designed on them. Processors of the system could be Linux based or Android based. It's better to use a processor capable of running Android such as Orange Pi or Raspberry Pi 4. Choosing Android as the development environment for the devices control system is a good idea although because it will save time and resources. Suppose you have an Android developer and as it is he would be developing the Application for your Vending Machine. With just some tweaks and hardware integration in that app can be used as a UI on the Vending Machine. The Application can be downloaded in processor device and configured on Boot. Have you seen POS devices for card swiping at various stores. They are doing the same thing. UI is also in a way part of the Client Side System, whether Android any framework is used.

Now that we have discussed the UI in Control System we will move to next block,

3. Client Side Systems

These systems are usually the front end of all IOT and web based systems. This can be an Android App, a Web App or a Desktop GUI. Often products have a Web Dashboard App with all admin access to gather and play on data of their machines, manage sales, etc. Products have a separate Android and IOS App for the common user. Basically a front end developer or a full stack developer working on technologies like Java-script, React, Angular works this part out. The main role of Client Side Systems is to generate requests to servers to operate a machine or get some data from server.

4. Cloud Server System

This is generally the master-mind of the whole product. A back end server written in Python or Java-script does all the processing of data, a client application interacts with not just one but a number of different back end servers to complete a process. Eg user initiates a monetary transaction-- data travels to server, server interacts with the database to match the user information, server then request payment gateway provider server to provide the SDK and processing for bank payment deduction. After it gets transaction response from the gateway server, it sends the response back to the App. Popular server development platforms are Nodejs, Django, Flask, PHP, etc.

We have briefly discussed about the components of the system, and we now need to discussed about how these will be connected with each other. There are various protocols to establish communcation between blocks and devices. For here we will discuss use case with protocols- HTTP, REST API, MQTT, UART, (read about the protocol by clicking name)

I'll cover each of these protocols and some more myself in depth later blog posts for now lets see the diagram below,

DFD3.png

Image above explains the connectivity of devices and systems with protocols used. With this we can sum up the architectural design of the product, now to take us into deeper sections it and something working live, I'll take up development of a complete system like this in soon to come series Blog posts, while in parallel I'll come up with small tutorials on different topics which will also involve real code and demonstrations.

However I see there are too many things involved in a complete Industrial grade product. So a full team of developers build it. So still the question remains unanswered "How to get started with learning IOT?" An IOT developer should know the product end-to-end, he can possibly lead the product development. End-to-end development means knowing exactly how each device of the project functions, how are they connected... IOT developers are generally from Electronics background and are able to do both hardware and software to much extent. One can start with learning Embedded Systems(using Arduino and ESP), then play around with MQTT and HTTP using free services like Node-Red and Thingspeak. After that dive into Linux systems and Python language. Learning full stack development on Flask and/or Django. One can then play around these to make and learn more about inter connected systems using actual hardware and internet.

I will try to cover these as much as possible in future posts. I have a lot to say but as this is my first blog post and I feel I have written a lot. I hope you would like it and support my posts.

Credits : Draw.io and Dreamstime for images