5. Example 2 with Slider

Goal

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.

Hardware

Be careful when connecting other sensors to J5, J6 and J7. J5 to J7 have a 5V supply voltage. 3.3V devices can be damaged. Use J3, if you are using analog sensors, like the UV- Sensor in the box.

Software for the IoT Cube

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

Explanations

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.

Intelligent edge devices in IoT (Internet of Things) are crucial components for modern smart systems. These devices have several key features that make them “intelligent” and efficient for various applications.

Integration on things board

Proceed in the same way as in example 1: Go to the website againClavis Cloud (ThingsBoard) and create a suitable dashboard!

Exercise

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