So, you want to create an IoT Device?
At n-Coders we help companies to create Internet of Things devices, from proof of concept through to manufacture and post development maintenance, we can guide you through the journey beginning to end. We have a lot of experience when it comes to creating Internet of Things devices. With such devices the starting point can be a proof of concept prototype, and creating a prototype can be easy, but taking that prototype through to a commercial product is often challenging. Bad choices made early on can accumulate into an unmanageable amount of technical debt at the point you need it least, when the product becomes a success. All too often a Raspberry Pi is assumed to the best starting point, and it is excellent for prototyping but not always the best choice for a commercial product.
Step 1: Plan
What appears obvious at the start may not be the best solution, and the Agile development process does not always suit embedded projects. It is important to choose the technologies you will be using, time spent getting these technologies right can save a great deal of money in the future. Some of the questions you will need to answer are:
What are the price constraints on the system?
This question will drive everything as it will restrict the hardware available. If the price point of the final product is to be < £20 then there would little point in prototyping on a system that has a relatively fast processor and gigabytes of RAM. Should the price point be < £10 then we may be forced to have a very tightly integrated system.
What are the power constraints on the system?
This is something that is very important, but all too often overlooked. Some of the obvious questions are:
- What is the power source?
- How many different voltages are required, and at what current demands?
- Will the power supply cope as you add more features?
- Is the equipment required to work outdoors?
What networking technologies will be used?
By it’s nature an IoT device will be on the network, but again there are questions:
- Will it be wireless?
- What network range is required?
- How will the system function when the network is lost?
- Will it be possible to remotely upgrade the system?
- Will it be possible to remotely login to the system?
The network technologies used can have a big impact on both cost and user experience, and therefore need to be carefully selected.
Will the system have a Graphical User Interface?
If the system has a web browser then the interface can be built using web technologies. The limitations here are browser compatibility issues and potentially speed. If the UI is required to be very quick and responsive then having it in a browser would not be the best choice, but if speed of development and flexibility is key, then a web browser would be attractive.
How will the system interface with peripherals?
The system may integrate with external displays, switches or sensors. The communication method will depend on factors such as data rates, distance between controller and device, and factors relating to the enviroment it’s in. Again, selecting the right communication technologies at the outset can make the system much more scalable in the future.
What are the real time performance requirements?
Real-time performance is something that is often assumed to happen with electronics, but is not always the case. If there are hard real time requirements on the system, such as the system must do something in under 20mS of an event happening, then a real-time operating system is required. These requirements should be established at the start of the project.
What are the memory requirements of the system?
In the case of a system being very low cost, there may only be 64K of memory available for code and data which maybe sufficient, but that is something that can only be established through careful planning. There is often a trade-off between amount of memory, performance and development effort.
How reliable does the system need to be?
Of course you want the system to be completely reliable and to never fail, but that can be difficult to achieve, especially as the system grows in complexity. If the system draws a lot of current then components can get hot leading to failure, and if the system has any form of disc for storing information then this can fail over time.
Step 2: Create a prototype
Choose the platform to prototype the system.
The Raspberry Pi is often the first choice for prototyping low cost internet enabled devices as it’s a small, low cost single board computer.
- Easy to use
- Ideal for when a graphical user interface is required
- Supports a wide range of languages
- Linux operating system
- Lots of I/O
- Very good networking support
However, because it’s so easy to start using, it can find it’s way into prototypes when it’s not the ideal solution. It’s relatively expensive and overkill for a lot of IoT projects. Not all projects can tolerate the relatively long startup time of the Pi, and a corrupted SD card can kill the system.
There are many variants of the Arduino board, and in many cases they are more suited to IoT projects than a Pi as the system is based around relatively simple micro-controller that is used for controlling the I/O.
- Used for single program I/O control
- Very simple to use
- Low power
Don’t expect to be able to do much more than control I/O pins, but expansion boards can add lots of functionality.
PIC micro-controllers are an excellent choice for a lot of IoT projects. They are very low cost and have considerable built in functionality.
- Low cost
- Low power
- Lots of inbuilt functionality
The PIC is a popular first choice for many projects, because of its low cost, capabilities, and the low effort required to put it into a commercial quality product.
Step 3: Start developing software
As with all software projects, getting the fundamentals including the architecture, build and deployment process right at the start can save a lot of time in the future.