Code

IoT Programming: What Languages ​​Are Used to Create Internet of Things Devices

IoT Programming: What Languages ​​Are Used to Create Internet of Things Devices

Free Python Course ➞ Mini-course for beginners and experienced coders. 4 cool projects in the portfolio, live communication with the speaker. Click and find out what you can learn in this course.

Learn More

The Internet of Things (IoT) is a concept in which physical objects and devices can interact with each other without the need for human intervention. This interaction occurs over the internet, allowing for the collection and analysis of data in real time. IoT opens up new opportunities for automating processes, improving efficiency, and enhancing quality of life. The application of IoT technologies spans various fields, including smart homes, industry, healthcare, and transportation. With IoT, devices can exchange information, optimizing operations and creating smart ecosystems.

Modern technologies are actively being integrated into our daily lives, and examples of smart devices are becoming more and more common. For example, a refrigerator that independently monitors the supply of milk and other products can automatically place an order in an online store as soon as the stock is depleted. Smart speakers integrated with leak and smoke detectors and other devices in your home also provide effective control and monitoring of your home's health. These innovations not only simplify everyday tasks but also enhance home security and comfort. The architecture of IoT solutions is divided into four main layers. Each of these layers plays a key role in the operation and interaction of IoT devices. The first layer contains devices that collect data and interact with their environment. The second layer includes networks that facilitate data transfer between devices and cloud services. The third layer comprises cloud platforms where data is processed and analyzed, enabling the extraction of useful information. The fourth layer comprises user applications and interfaces that provide access to data and device management. All these levels interact with each other, creating an effective and functional IoT ecosystem.

  • sensors that collect data: for example, leak, motion, lighting sensors, and the like, connected to a microcontroller;
  • local gateways - devices that transmit and ensure the exchange of data;
  • Edge Servers - edge servers that store, accumulate, and process data directly where the information is produced (for example, these can be production facilities);
  • cloud infrastructure.

Companies developing IoT devices and solutions often create both the devices themselves and all the necessary software for all four levels. The exception is those companies that produce individual sensors or devices designed to integrate with existing ecosystems and standards developed by large vendors. In this context, we won't delve into the hardware and various architectures, as detailed information on this aspect of the IoT can be found in our "People and Code" podcast, which is dedicated to microcontrollers. This will give you a better understanding of how the devices function and the technologies used to develop them.

What is the Internet of Things Programmed With?

The Internet of Things (IoT) architecture includes four layers, and developers choose different technologies to program each of these layers. According to a December 2021 study by the Eclipse Foundation, the following programming languages ​​are the most popular in the IoT field:

Popularity of programming languages ​​in IoT. From the Eclipse Foundation study Infographic: Eclipse Foundation
  • The leaders in embedded devices and microcontrollers are C, C++, Java, and Python.
  • Python, C++, C, and Java are most often chosen for gateway programming.
  • Python, Java, C++, and C are preferred for server-side development.
  • In the cloud—Python, Java, JavaScript, and C++.

IoT device development is carried out using generally accepted approaches, which makes the process fairly predictable, without unexpected complications. The choice of programming language is mainly determined by convenience and accepted industry standards. However, it is worth noting that this choice has virtually no impact on the level of device security. It's important to remember that IoT security requires a comprehensive approach, encompassing not only language selection but also system architecture, data encryption, and other aspects.

Ivan Yushkov is an experienced Internet of Things (IoT) developer. His professional work encompasses the creation and implementation of innovative IoT solutions, which optimize processes and improve business efficiency. Ivan actively works with modern technologies, developing software for various devices and systems, ensuring their integration and functionality. His expertise includes not only programming but also IoT system architecture design, making him a valuable specialist in this field.

At the end of 2021, Python became the clear leader among programming languages, overtaking Java, which held the top spot the previous year. This shift in programming language popularity highlights an interesting trend: according to the TIOBE ranking, Python has finally surpassed Java and C, which have held the top spot for many years. Thus, Python has strengthened its position as the most in-demand programming language, reflecting its widespread use and growing popularity among developers.

Python is a programming language that is easy to learn thanks to its simple and straightforward syntax. This makes it attractive to a wide range of professionals, including sociologists and biologists, who use Python to program laboratory devices. Furthermore, Python has become the preferred language for working with popular microcontrollers, such as the Raspberry Pi. This community actively supports developers, which facilitates the rapid resolution of emerging issues and the development of programming skills.

Kinman Covey is an expert in the field of microcontroller development. His work is distinguished by a high level of innovation and quality. Covey has created a number of effective solutions for microcontroller control, which significantly improves the performance and functionality of various devices. His experience and knowledge make him one of the leading experts in this field. Microcontroller development based on Covey's methods continues to inspire engineers and researchers around the world, opening up new possibilities for creating smart technologies and process automation.

Python's growing popularity is due to its ease of use and high speed of coding. This programming language offers a rich set of libraries suitable for virtually any task, especially in the fields of machine learning and data processing. Python also demonstrates excellent compatibility with other programming languages, making it a versatile tool for developers. With devices becoming more powerful every year, the emphasis shifts from optimization to the speed of software development and delivery. Python perfectly meets modern development requirements, which contributes to its further adoption and implementation in various fields.

If your project does not require complex computing resources, Python's standard libraries are an excellent choice. However, if you plan to work with microcontrollers, we recommend considering MicroPython. This package is ideal for running Python on compact boards with only 256 KB of memory and 16 KB of RAM, and occupying only a few square centimeters. MicroPython enables the efficient use of limited microcontroller resources, opening up wide opportunities for developing a variety of applications.

Python hasn't gained a strong position in the microcontroller and embedded device niche due to high demands on execution speed, power efficiency, and memory efficiency. In these conditions, Python and its lightweight version, MicroPython, are inferior to more powerful languages ​​such as C, C++, and Java. These languages ​​provide the necessary speed and optimization, making them more suitable for developing embedded systems and microcontrollers.

The Internet of Things (IoT) faces specific constraints, such as low internet connection speeds (e.g., one kilobit per second) and data transfer rate limitations. These constraints are related to the need to conserve resources, which is especially important for battery-powered devices. For example, for some devices, it may be critical to ensure their operation for 100 years on a single battery. These requirements influence the design and development of IoT solutions, making them more efficient and resilient in operation.

Ivan Ignatiev is a Cloud Solution Architect at Pluto Informatics. His experience and knowledge of cloud technologies enable him to effectively develop and implement solutions that optimize business processes. Ivan's specialization includes cloud system architecture, service integration, and data security. He actively works on projects aimed at improving the performance and reliability of cloud infrastructures, making him a valuable specialist in the rapidly evolving world of IT.

Second place goes to the "Pluses" programming language, which continues to attract enthusiasts of extreme and unconventional solutions. This language is often used on single-board computers, such as the Raspberry Pi, due to its high speed, comparable to C, and a faster development process. The advantages provide developers with flexibility and powerful tools for creating efficient programs.

Java has a unique strength due to its portability and the "write once, run anywhere" principle. If the Java Virtual Machine (JVM) supports a particular architecture, you can be sure that your code will run correctly on it, similar to its execution on other platforms. This makes Java an ideal choice for developers looking to create cross-platform applications that easily adapt to different operating systems and devices.

Java is a classic object-oriented programming language that is ideal for developing enterprise solutions. It offers an extensive set of libraries and tools that ensure high application security. Over the years, the bytecode and the Java Virtual Machine (JVM) have been significantly optimized, allowing for high-performance execution of programs. Java remains a popular choice for building reliable and scalable applications across various industries.

The choice of programming language for a project depends on specific tasks and use cases. For example, if there is a need to monitor the filling of trash bins in a city, sensors are installed inside them to track the level. It is important that the sensors be energy-efficient, as it is not possible to connect each bin to a power grid or regularly change the batteries. Low-level languages ​​such as C and Java Embedded, specifically designed for embedded systems, are optimal for such applications. Using these languages ​​enables the efficient development of IoT (Internet of Things) solutions and ensures the longevity of devices.

Ivan Ignatiev is a Cloud Solution Architect at Pluto Informatics. In this role, he develops and implements cloud solutions, optimizing business processes for clients. With deep knowledge of cloud technologies, Ivan helps companies effectively utilize cloud resources, ensuring data reliability and security. His expertise covers a wide range of technologies, including cloud system architecture, data management, and service integration. With his experience in the IT sector, Ivan Ignatiev is actively involved in creating innovative solutions that facilitate the digital transformation of businesses and enhance their competitiveness. The old, but still relevant, C language continues to be popular in embedded systems and systems programming. This is due both to its tradition and to the extensive codebase written in C, which is difficult, and often impractical, to translate into more modern programming languages. One of the main advantages of C is its high execution speed. Furthermore, the language allows developers to directly interact with memory and hardware components, making it an ideal choice for low-level programming. It's no coincidence that C is often called a "portable assembler," as it combines powerful hardware control capabilities with portability across various platforms.

I worked on an Industrial Internet of Things (IoT) project for Rosneft, which included a predictive analytics system. Using installed sensors, the system monitored the volume of oil passing through the scales and the amount entering the storage facilities. The data was then analyzed to identify possible discrepancies or losses. The scale sensors were connected to the internet and transmitted information to the server. The software to work with them was developed in C.

Alexey Baryshnikov is an experienced Java and JavaScript developer. He has a deep knowledge of the technologies and tools needed to create high-quality web applications. Alexey successfully implements projects of varying complexity, applying modern development approaches and best programming practices. His experience spans both front-end and back-end development, enabling him to create comprehensive business solutions. Alexey is results-oriented and always strives to optimize development processes. JavaScript is widely used in the Internet of Things (IoT). It is used not only for developing web application interfaces but also for creating server-side software. When combined with the Node.js framework, JavaScript enables efficient interaction with sensors, servers, and gateways running the Linux operating system. For example, Node.js can be used in microcontrollers from manufacturers such as Espruino and Tessel, opening up new horizons for developing IoT solutions. If an object can be connected to a solar panel or other external power source, programming languages ​​such as Python, MicroPython, JavaScript, and Node.js are most often used in IoT applications. These languages ​​are ideal for developing IoT applications due to their flexibility, ease of use, and broad developer community. Python and MicroPython provide convenient data manipulation and device control, while JavaScript and Node.js allow for efficient processing of asynchronous events and interaction with cloud services. The choice of programming language depends on the project's requirements and the specifics of integration with hardware components.

Ivan Ignatiev is a Cloud Solutions Architect at Pluto Informatics. With his expertise in cloud technologies and solution architecture, he plays a key role in developing and implementing effective cloud strategies for businesses. Ivan helps clients optimize their infrastructure and adapt to modern challenges associated with digital transformation. His expertise in cloud solutions enables him to build reliable and scalable systems that foster growth and innovation.

This language, although not among the most popular in research, is often considered in the context of the Internet of Things (IoT). Its uniqueness lies in the fact that it was specifically created to support data description tools. An important feature is the presence of the Node.lua framework, which is an analogue of Node.js in the LUA ecosystem. This framework is built on a lightweight LUA interpreter, making it particularly effective for developing IoT applications. Go has a comprehensive standard library and provides efficient concurrency out of the box. The Go programming language continues to grow steadily in popularity in the development world, making it a sought-after choice for building high-performance applications. Golang is largely replacing JavaScript and Node.js for building server-side HTTP applications. In my opinion, Golang significantly outperforms JavaScript in performance and development ease. While Golang can be used in various Internet of Things (IoT) components, in my opinion, it is not always the optimal choice. IoT projects often require a combination of high-level code with low-level, hardware-like solutions. Thus, the IoT requires the use of both high-level and low-level programming languages, making the choice of technologies an important development aspect. Go is not suitable for low-level programming. It handles data poorly, and the use of pointers is perceived as outdated. As a result, Go is inefficient when working with protocols. Although it can outperform Java in some tasks, its capabilities are still significantly inferior to those of C. If you are concerned about the complexity of C and are looking for an alternative, Julia, which offers more modern solutions, is worth considering. JP Norair, an IoT development specialist, left a comment on the Quora platform discussing current trends and technologies in the Internet of Things. He noted the importance of integrating IoT devices into everyday life and their impact on various areas, including smart homes, industry, and healthcare. Norair emphasized that successful IoT implementation requires a deep understanding of both software and hardware, as well as data security. His commentary has become a useful resource for those interested in the development of the IoT and its application across various industries.

This is a specialized version of PHP designed for working with microcontrollers and IoT devices. It is ideal for developers already familiar with PHP who want to delve deeper into the field of the Internet of Things. This PHP dialect provides built-in tools and libraries necessary for the effective development of IoT applications. Over 90% of servers worldwide use PHP, confirming its high popularity in the IoT field. The language is actively used to manage microservices on the Linux platform, making it an essential tool for modern developers.

Swift is a programming language used to develop applications for smart devices in the Apple ecosystem. It includes unique libraries for the HomeKit platform, allowing for the effective integration of data feeds from a network of compatible devices. Using Swift in developing applications for smart devices ensures high performance and reliability, making it an ideal choice for creating modern smart home solutions.

What operating systems and communication channels are used in IoT

The choice of operating system depends on the architecture you are working with, similar to programming languages. It is important to note that for microcontrollers and embedded devices, an operating system is not required. In such cases, developers often use firmware or minimalistic solutions, which optimize resources and improve performance. This is important to consider when choosing a development platform, since the right choice of operating system can significantly simplify the development process and ensure efficient use of hardware resources.

In embedded devices, gateways, and microcontrollers, Linux is the most popular operating system. Stripped-down or specialized versions are most often used, and CentOS stands out among the "regular" distributions. Linux offers flexibility and freedom, allowing the system to be tailored to the user's specific needs. This OS supports multiple architectures, making it a versatile solution for a variety of tasks. Furthermore, Linux has a huge community and a wide selection of ready-made software suitable for most scenarios. However, it's worth noting that applications such as Photoshop and Microsoft Office may have certain limitations, which is not critical in the context of the Internet of Things (IoT).

The Linux operating system is suitable for all devices that can be connected to the power grid. For example, it can be used to ensure the security of train doors. In this case, regular computers are used, connected to sensors via a wired connection or Bluetooth. For this system to function correctly, a stable power supply and internet access are required. Smart home applications can be developed on various platforms. The server side uses firewalls, routers, and App Storage for file uploads. There are numerous open-source projects for application development, many of which are based on PHP, making them accessible and flexible for various tasks.

Ivan Ignatiev, a Cloud Solutions Architect at Pluto Informatics, has deep knowledge and experience in cloud technologies. His expertise covers the design, implementation, and optimization of cloud solutions for business. In his work, Ivan focuses on creating efficient and secure infrastructures that help companies achieve their goals. Through an innovative approach and the use of advanced technologies, Ivan Ignatiev contributes to the development of cloud services, ensuring their high performance and reliability.

After Linux, comes FreeRTOS, a real-time operating system designed specifically for microcontrollers. It efficiently uses limited resources, making it ideal for embedded systems. A key feature of real-time systems is that they ensure the execution of tasks within strictly defined deadlines. This predictable behavior is critical in areas such as the military and space industries, as well as in cases where the accuracy of task processing determines the lives of people or the operability of expensive equipment. Unlike FreeRTOS, Linux doesn't provide such guarantees for task completion within specified timeframes.

The third most popular operating system is Windows. Many of us have encountered payment terminals or ATMs, which often use this Microsoft operating system. Windows is a closed and less flexible platform, making it suitable only for devices with sufficient free resources.

In fourth place is Zephyr, a real-time operating system designed for use in embedded devices and microcontrollers. Zephyr offers flexibility and efficiency, making it an ideal choice for building modern IoT solutions. This system supports multiple architectures and provides developers with the tools they need to quickly and efficiently create high-quality applications.

Operating systems for gateways and embedded devices. From the Eclipse Foundation study. Infographic: Eclipse Foundation.

On servers and in the cloud, the situation differs from desktop systems. Linux remains the leading operating system, significantly outpacing its competitors. Microsoft Azure Sphere, the version of Linux that powers the Azure cloud platform, one of the world's leading, has also seen a significant increase in popularity. Fourth place goes to FreeBSD, another free operating system known for its reliability and security compared to Linux.

Operating systems for servers and clouds, popular in IoT. From the Eclipse Foundation studyInfographic: Eclipse Foundation

Classic Ethernet occupies a leading position among communication channels due to its wired, reliable, and stable nature. This type of network provides high data transfer rates and is characterized by predictable operation. In addition, Ethernet is characterized by low power consumption, which makes it practically “free” in this regard.

Among wireless technologies, Wi-Fi occupies a leading position due to its availability and efficiency. Its deployment is cost-effective since it does not require the installation of base stations associated with telecom operators. Wi-Fi provides high data transfer rates and is capable of covering significant distances, making it an ideal solution for home and office networks.

Cellular networks are slightly less popular, but they offer significant advantages. These networks are already integrated into many smartphones, providing reliable coverage and stable communication over long distances. They are especially convenient in areas where wired connections are unavailable and Wi-Fi doesn't provide the required signal quality. Cellular communications are becoming indispensable in situations where reliable communication is required regardless of location. Bluetooth ranks fourth among data transmission technologies. Its main drawbacks include low data transfer rates, unstable operation, and significant limitations in the range between connected devices. However, despite these limitations, Bluetooth has the advantage of lower power consumption compared to Wi-Fi and cellular networks. This makes it an ideal choice for use in devices where energy conservation is important, such as wireless headphones and fitness trackers.

Communication technologies popular in the IoT. From the Eclipse Foundation study. Infographic: Eclipse Foundation.

An example of an industrial IoT project is a color-coded map of factories displaying the current status of each. Using this map, managers can easily access information about a specific factory and identify problems by viewing dashboards with metrics such as pressure, temperature, and other data collected from industrial IoT devices. A DSL line was used to transmit data, through which Python scripts were downloaded. These scripts were used to create predictive models of oil production volumes at the Sochi refinery. Node.js, React, Polymer, and Angular technologies were used to visualize the results in a single platform. These tools made it possible to build tables and graphs based on processed data provided by data scientists, as well as raw data downloaded from a data lake. This approach ensures effective monitoring and management of production processes, which is key to improving efficiency and reducing costs in industry.

The final result of the project will be an interactive map in SVG format displaying Rosneft's refineries. This map will allow users to easily find and explore the locations of the refineries, as well as obtain additional information about each one. The interactive format provides convenient access to data and improves the user experience.

Alexey Baryshnikov is an experienced Java and JavaScript developer. In his professional work, he successfully applies modern software development technologies and methodologies. Alexey specializes in creating high-quality web applications and ensuring their efficient operation. His skills include server-side and client-side development, as well as application performance optimization. Alexey's experience enables him to solve complex problems and implement projects of varying complexity.

Conclusion

The Internet of Things (IoT) is the future of technology, and IoT software development is becoming increasingly relevant. If you already have knowledge of programming languages ​​such as Python, PHP, Java, Go, or JavaScript, you can easily transition into this field using your existing skills. Python is an excellent choice for beginning programmers, as it is easy to learn and has powerful libraries for working with IoT. If you are interested in interacting with hardware and low-level programming, C and C++ are worth considering. By developing in this field, you will be able to participate in the creation of smart devices and systems that will shape our future.

Please indicate the text that needs to be rewritten and optimized for SEO.

  • Toit open-sources its language for IoT devices.
  • Test: AI on the table - oversalted on the back. Recognize what dish the computer invented. All about Java: the ecosystem, popular frameworks, build systems, JDK, JVM, and the future of the language.