A Few More Words on Pinpoint
My localisation module was made from a few blocks:
If you think it's possible to build a mobile phone from those components, you're totally right. ;) Every element has its purpose and is incorporated in an electronic device for a reason. Let's talk more about what can hide behind the modern IoT devices.
Let's start with the basic one.
Do you know Amazon Dash Button? It's an IoT device that has only one sensor, and it's a button. ;-)
Quite many people still remember mercury thermometers which are no longer popular. That's because we have this tiny, smart thing called thermistor. It's a type of resistor the resistance of which is dependent on the temperature. By measuring the resistance and doing a few simple calculations, we're able to determine how hot it is at the moment. So, have all modern weather stations made the module too complicated? Not exactly. Currently, there are a lot of solutions that are much smarter and easier to incorporate. One of the most popular solutions - mostly for its price ($1-2) - is DS18B20 sensor by Maxim. It provides digital signals which the microprocessors can easily process.
Let's stay with the weather station topic. What else can we measure? Humidity? No problem, as we have all sorts of hygrometers. One of them, a resistive hygrometer, works like the aforementioned resistive thermistor. The market offers a lot of complete solutions, i.e. we have DHT11 which provides the same digital interface as DS18B20.
There is a wide range of sensors that can be integrated in IoT devices:
Even if we decide to go with a particular sensor, we will face a challenge to pick out the one that will be suited for our needs. This could be very challenging, as we need to make allowances for a number of factors, such as the size, supply voltage, power consumption, communication standard, a range of measured values, ability to work in the desired environment, etc.
Besides, LEDs are the fundamental element of almost all types of displays - from a simple seven-segment display to 4k LCD monitors.
Let's move on to the issue of motors which are more complicated than LEDs and speakers. There is a range of motors and picking the one that suits our needs could be more difficult than picking a sensor. Motors are used for many purposes. One of them is the production of drones. Simple ones could be considered as toys, but there are models which may qualify as IoT devices. What we should consider when picking the right motor for a drone?
What if we want an actuator that will produce rotating movement with an ability to move in a predefined range and at a specified angle? For that purpose, we can use servo - a motor with attached gears and electronics designed for controlling the whole mechanism. Where can we use it? As always, possible applications are limitless - here are some of them:
Another element which a motor usually contains is a pump which can be used in the home automation system.
We can find a variety of microcontrollers on the market. The most basic way to divide them is by their microprocessor architecture. We can consider an 8-bit architecture as the minimum. Does it ring a bell? Let me explain. In 8-bit microprocessors, the memory addresses or other data units are those that are 8-bit wide. Every processor has a limited set of operations which can be performed. Let's look into it based on the easiest example: Addition. An 8-bit processor can add two 8-bit values in a single microprocessor cycle. The number of cycles per second is described by the clock rate usually expressed in MHz. If the processor is running at the clock rate equal to 12MHz, it can perform 12,000,000 add operations on 8-bit values within one second. An 8-bit value can take a number from 0 to 255. To sum up, the 8-bit microprocessor running at the 12MHz clock rate can add on the numbers from 0 to 255 twelve million times. This could raise the question if one can calculate numbers above 255 on an 8-bit processor? Certainly, but it will take more cycles. A single addition will take a few cycles. These types of processors can be used in applications where high computing power is not needed. I used an 8-bit microprocessor in my Pinpoint device - Atmega128 by Atmel. As a side note, modern smartphones use 32-bit or 64-bit architecture with a high clock rate. Thanks to that, it can run the whole operating system and very complex applications with ease.
As mentioned before, the microcontrollers can have different types of in/out peripherals. Those are used to communicate with both the sensors and actuators. As always, we employ the easiest way of communication, i.e. the logic level communication. There are only two states - 1 and 0. Simple? Yes, but it's enough to control the diode.
Let's go back to the DS18B20 temperature sensor. It provides an easy to use transmission interface called 1 Wire. As the name implies, it requires only one wire (plus ground). The transmission speed can reach up to 115.2 kbps, which is not much comparing to wifi or LTE but enough for basic applications that pass the temperature value.
Another example of a simple communication standard is I^2C. The work concept is pretty similar to 1-Wire, but - in this case - we can achieve higher data rates. As for the downsides, it works on smaller distances.
What is more, certain modules support USB by default, but more often than not, they are pretty advanced and require higher data speed.
If you've enjoyed my post, stay tuned. More about programming microcontrollers, development boards and connecting them with mobile apps soon!