Now we want to connect a sliding Potentiometer to the IoT Cube. Whenever the slider is moved, a value is to be transmitted via LoRaWAN. The value can be used for various scenarios, e.g. to dim a remote smart light. The value is also shown on the OLED display.
Connect the USB-A Connector with your computer
Try to recreate this example. You will need nodes from the following categories. The colors help you to choose the right category:
Before you despair, you can also use this ready-made example: Shared Example 2
In the current configuration of the IoT Cubes, transmission is only possible approx. every 6 seconds. Shorter intervals are therefore prevented with a simple timer. When moving the slider, the system first checks whether the value has changed. If so, the program attempts to send the data. However, this is only possible if the IoT Cube has joined the network and nothing has been sent in the last six seconds. Compared to the first example, the edge device acts more intelligently here. Data is only sent if something has changed. This saves energy and extends the battery life.
Proceed in the same way as in example 1: Go to the website againClavis Cloud (ThingsBoard) and create a suitable dashboard!
Try to combine the two examples so that the light measurement and the potentiometer measurement are made on the same IoT cube.
Tipp: You can add more than one sensor value to the buffer and transmit them together. Like this:
If you use Channel 2 instead of Channel 1, the data key looks like the one in the Clavis Cloud (ThingsBoard):
Fabian Reifler | Copyright © 2024