Wiznet makers

jaden

Published April 24, 2023 ©

72 UCC

18 WCC

49 VAR

0 Contests

0 Followers

0 Following

How to use chatGPT with arduino

chatGPT usecase

COMPONENTS Hardware components

Arduino - Arduino UNO

x 1


Arduino - Arduino Ethernet Shield 2

x 1


PROJECT DESCRIPTION

Have you ever wondered how you can use ChatGPT to help you create an Arduino project?

 I recently had the opportunity to try it out(Link), and the results were amazing!

 

In fact, I was so impressed with the experience that I wanted to share it with the community. 

In this article, I'll be discussing my experience of creating an Arduino project with the help of ChatGPT, and I'll also be sharing some tips on how you can use ChatGPT to create your own projects. 

So, whether you're new to Arduino programming or an experienced programmer, read on to learn how ChatGPT can help you bring your ideas to life!

Before we get started, here are some things to consider when writing an Arduino project using chatGPT

 

      1. ChatGPT is not perfect

          This means that chatGPT may not generate perfect code, which is why you need to be able

           to verify the generated code and at least give the user some idea of what went wrong.

 

      2. Clearly describe the project you want to implement to Chatgpt

            Because Chatgpt generates projects based on your needs, the more precisely you express

            them, the closer it will come to generating the output you want.

 

      3. Use HW that many people have been using for a long time.

           Chatgpt is trained based on information on the internet, so HWs with a lot of information

           or examples are easier to implement. Also, since the data up to 2021 was trained, it may 

               be difficult to implement if you use HWs released after that.

 

With the above considerations in mind, let's start writing commands to chatGPT.

I have an Arduino Uno with an Ethernet shield 2, a DHT11 sensor, a 0.96" OLED, sending temperature and humidity data to a TCP client every 10 seconds, and I want to display the network connection status on the OLED.

Now, let's write a prompt to enter into chatgpt so that it can generate the desired content.

I wrote the prompt like this

using Arduino UNO, Ethernet shield 2, DHT11 sensor, 0.96" OLED.
Arduino UNO is TCP server. 
display Ethernet status in 0.96" OLED
send DHT11 data to client every 10 s.

generate code.

 

ChatGPT will then write the code for me, and while I get the correct code, others may get code that gives them compilation errors.

If that happens, you can type a compilation error message into Chatgpt and it will fix the code, so give that a try, and if it doesn't work, check the code yourself and explain to Chatgpt what went wrong so it can fix it.

 

So far, we've briefly described how we built our project using Chat GPT.

Next time, we'll go into more detail.

Documents
Comments Write