02.May.2023

As one of the site editors, I wanted to participate in Artificial Intelligence, the most popular and rapidly developing field of the last few years.

I examined the Artificial Intelligence applications of different companies. I tested the Copy.ai artificial intelligence application, one of the first popular ones, by asking different questions.

Then I experimented with different topics on chat.openai.com.

I examined Microsoft's artificial intelligence application only in terms of visual applications.

In fact, as it is known, Google had started artificial intelligence applications years ago, but did not make a breakthrough for users to use it openly.

After this short introduction about artificial intelligence, let's come to our main question. Writing code to Artificial Intelligence?

We are making Android applications with some microcontrollers on our site. We use Flutter-Dart codes to make Android apps. We also do coding examples on the microcontroller side.

When we ask the chat.openai artificial intelligence about some examples we have published on our site, it gives very good answers. Flutter-Dart is pretty good at coding and Arduino coding.

I asked openAi artificial intelligence to write a code about a relatively new topic, "Can you write sample codes for Arduino and MQTT Publisher?" I asked one. Response time did not reach 10 seconds. Before writing the sample codes, let me give a short excerpt about MQTT:

MQTT (Message Queuing Telemetry Transport) is a messaging protocol. It is designed for use between devices that require low bandwidth and low power consumption, and is often used for data transmission between Internet of Things(IoT) devices.

MQTT uses the broadcast-subscription model and provides a way for devices to broadcast data and for other devices to receive it. Messages are managed by a server called an MQTT Broker and subscribers subscribe to a specific thread to receive messages.

The MQTT system consists of the following components:

Publisher: A device that sends a message to a specific topic.
Subscriber: A device that subscribes to a specific topic and receives messages from that topic.

Broker: It is the medium where Publishers and Subscribers communicate. It is responsible for forwarding incoming messages to the correct subscribers.

Topic: Specifies the topics of the messages. It determines which topics the subscriber will subscribe to.

QoS (Quality of Service): Specifies the transmission quality of messages. There are 3 different QoS levels in MQTT.

Retained messages: These are the messages that keep the last values. Subscribers can use retained messages to get the latest values.

Publisher, one of the MQTT components, is the component that sends data under a certain topic. Data can be any kind of data; temperature, light intensity, decibel etc.

How to do our example question with a microcontroller system? We asked how. Of course, the same question can be asked for any other microcontroller board.

After the question we asked, the codes that openai gave are below:

#include
 #include

const char* ssid="SSID";
const char* password="PASSWORD";
const char* mqtt_server="BROKER IP";
 const char* topic="test";

WiFiClient espClient;
 PubSubClient client(espClient);

void setup() {
   Serial.begin(9600);
    WiFi.begin(ssid, password);

   while (WiFi.status() !=WL_CONNECTED) {
     delay(1000);
     Serial.println("Connecting to WiFi...");
   }
   Serial.println("Connected to WiFi");
   client.setServer(mqtt_server, 1883);
   while (!client.connected()) {
     Serial.println("Connecting to MQTT server...");
     if (client.connect("arduino-client")) {
       Serial.println("Connected to MQTT server");
     } else {
       Serial.print("Failed with state ");
       Serial.print(client.state());
       delay(2000);
     }
   }
}
void loop() {
   client.loop();
   client.publish(topic, "hello world");
   delay(5000);
 }

Of course, it's nice that artificial intelligence helps us with coding. However, there is an important issue: do we have enough information to ask questions?

What do we need to know for these codes to really help us? Let's look at the codes above again...

How well do we know, for example, a TCP/IP issue, although it is never mentioned as a term in the code?

These codes can be very useful when making beginner and intermediate applications. However, we need to have knowledge of many technical issues when making advanced IoT applications.

 

About Ümit Sönmez: Electronic-Computer Trainer, Author

İlgili Haberler

Energy Savings Will Be Achieved with 'Internet of Things'

Energy saving and sustainability with IoT! IoT technology provides companies with innovation in energy management

11.10.2023

Digital Flies Everywhere

What else could happen in a world with artificially intelligent flies and other animals?

24.04.2023

Ways to Make Money by Building an IoT Platform

Technological new business models on IoT platforms

19.05.2023

Artificial Intelligence Revolution: Rapidly Changing Roles in the Business World and Adaptation to the New Era

The effects of Artificial Intelligence are rapidly emerging. Creating data and models is important for layoffs, industry transformations and adaptation to the new age.

13.01.2024

Tesla's New Robot: Takes on the Task of Folding Clothes

Tesla's Optimus Gen 2 robot draws attention with its ability to fold clothes. A look at the future of robotics with Elon Musk's sharing and artificial muscle technology

17.01.2024

New Developments from Neuralink

With Elon Musk's Neuralink project, it may be possible to control the mouse cursor thanks to implants inserted into the brain. Synapses and the brain-computer interface

21.02.2024

Artificial Intelligence and Electronics: From Unemployment Peril to Creative Business Opportunities

Artificial intelligence and electronics offer creative job opportunities for programmers to reduce the risk of unemployment. A detailed review with examples from agriculture, healthcare, finance and other sectors.

29.02.2024

How humanized will humanoid robots become?

The development of humanoid robot technology and the fast movement ability of the Phoenix robot developed by Sanctuary AI. Hydraulic systems and future prospects

02.03.2024

Robotization of Humans - Are we one step closer to robotization?

In Education, we examine how mixed reality technology can be used to enhance the learning experience and present information in a more interactive way. In the business world, we discuss how mixed reality technology can deliver innovative solutions to companies and increase productivity by getting employees to receive real-time instructions while performing complex tasks more effectively.

20.06.2023

One day, an alien robot comes to town...

An article on the future role of artificial intelligence and robotics. The new artificial intelligence model developed by Google for garbage-collecting robots and the usability of different artificial intelligence models for various purposes are explained.

31.07.2023

X=Elon Musk

Discover the enigmatic symbol 'X' associated with Elon Musk - a visionary entrepreneur and innovator behind a wide range of groundbreaking projects such as SpaceX, Tesla, Neuralink, and more. Unravel the multifaceted meanings of 'X' as it represents unknowns, stoppages, and unlimited possibilities in the context of Elon Musk's global endeavors

01.08.2023

Drone Dog

In our article titled Drone Dog: What Happens When Adding Drone Feature to Robot Dogs?

16.08.2023

Security of IoT Systems: Bluetooth Modules and Threats

In the article focusing on the security of IoT systems and Bluetooth modules, threats and protection methods are discussed. Learn IoT security

20.09.2023

Security of IoT Devices with Wi-Fi Modules: Threats and Protection Methods

Security of IoT Devices with Wi-Fi Modules: Threats and Protection Methods. Learn the necessary precautions for IoT security.

22.09.2023

Robots of the Future: TeslaBot and K5 Security Robot

TeslaBot and the K5 security robot: The future of human-robot collaboration. The evolution of robotics and a new era for city security.

25.09.2023

The Rise of 5G Technology: New Professions and Business Opportunities

The spread of 5G technology creates new professions and business opportunities. Career tips on the transition from 5G to 4G and jobs of the future

28.09.2023