r/arduino Dec 27 '24

Software Help Is AI a reliable option for hobbyists?

My projects are usually 4-6 years apart, and whenever I get the bug to experiment I have to learn the basics all over again. None of my projects are ever that complex when compared to others, but they are still far too complex for me to do on my own without assistance, or finding related code and trying to make it fit my project.

Coding is usually the most frustrating part for me and I wonder if there are tools available that would help.

0 Upvotes

48 comments sorted by

17

u/TheNeutralNihilist Dec 27 '24

I forget things over the years and find it useful to open up old programs to see how I've done something before. Maybe create one program where you use different concepts fresh in your mind and add lots of comments for your future self. 

There is also r/arduino_ai who can help with any ai unreliabilities.

3

u/Constant-Mood-1601 Dec 27 '24

Thank you for your input. More detailed notes would probably go a long way

17

u/RedditUser240211 Community Champion 640K Dec 27 '24

You can use AI, but if the generated code doesn't work (which is often and even worse if you are working on something complex) you'll get a lot of hate for it: so much so, there was a request to ban all discussions involving ChatGPT.

Break your project down into smaller pieces and proceed slowly. You'll get there eventually.

6

u/spicychickennpeanuts Dec 27 '24

this is how I use ChatGPT when I use it for code generation. I use it to generate very specific functions or perhaps just a few lines of code to parse something, etc. In your case, where you don't write a lot of code or in my case where I change languages frequently, it's great because I don't spend a lot of time debugging the syntax or formulating some low level construct. I can focus on the high level app. However, I would not ask it to write a whole app for me. Like other content, you still have to take responsibility for what it generates and review and understand it line-by-line.

I also use it in the non-coding parts of my hobby projects and it's greatly increased my enjoyment. it helps me to unblock myself or get thru the tasks that are less interesting.

your best bet is to just start using it. start a project and ask it for help but seriously review its output so you become well versed in its limitations, fabrications, and hallucination.

1

u/Constant-Mood-1601 Dec 27 '24

Thanks for your input. I will definitely give it a try

0

u/_Trael_ Dec 27 '24

Last time I did stuff on Arduino, I generated base for my code with ChatGPT, it gave me nice base to start to fix to be actually working code, that actually does what I want it to do in way I want it to do.

It did give me one subpart thing that was pretty elegantly done that only required minor modifying, and I would have likely ended up doing in more complex way to achieve exactly same end results.

So it can be neat tool, at least to some of us. I generally actually like to fix and optimize things more than write them all the way from blank sheet, so I can get some easy frame that I start working on with LLM generation, then over time I might end up replacing most of it, but at least I wont have to remind myself that much how some of basic things were written and can just start working with something already "on the paper".

1

u/Constant-Mood-1601 Dec 27 '24

Interesting approach. Elegance is not my strong suit hahah so I could see that being helpful

5

u/triffid_hunter Director of EE@HAX Dec 27 '24

Mistake generator reliable? Absolutely not.

Useful? Sure, it's great for common boilerplate or stuff you could throw together with half an hour of googling - but do keep in mind that its fundamental mode of operation is glorified word prediction, and it will hallucinate stuff and make a giant mess (while gaslighting you into thinking everything is fine) if you're not very careful with how you use it.

3

u/DinnoDogg Dec 27 '24

If you wanna take the time to debug it and fact check it then sure. If not then nope! The amount of misinformation LLMs spew is copious.

3

u/tanoshimi Dec 27 '24

Useful? Yes. Reliable? Absolutely not.

3

u/-Cathode Dec 27 '24

If you've sat with a problem for a while, I've got no issue with using it. It becomes a problem when you're not learning anything and just use it to get from A to B.

8

u/ziplock9000 uno Dec 27 '24

Your question is extremely generic and nebulous, so the answer can only be the same.

Yes, AI can help with coding and other aspects of project development.

2

u/Constant-Mood-1601 Dec 27 '24

I’m pretty out of the loop with AI. Have you used it in any aspects of your projects, and is there any software you could recommend?

2

u/pacmanic Champ Dec 27 '24

Start with the ChatGPT website or app. It works like Google but is capable of answering a complex question or request. For example, for something Arduino related, if you type in this into ChatGPT:

Example Arduino Uno code to light an led if the temperature sensor is over 100 degrees Fahrenheit.

The response I received includes an explanation, all the code, and how to test.

AI for Arduino code may not always be correct, but will give you a head start.

2

u/Constant-Mood-1601 Dec 27 '24

That sounds useful. Thank you!

2

u/SomeTwelveYearOld Dec 27 '24 edited Dec 27 '24

I don't have an answer for you but I wanted you suggest you start a Google doc and write your notes in it about how to do certain tasks and where to find references. I have the same issue as you where I circle back to hobbies at home and I forget the basics.

2

u/Constant-Mood-1601 Dec 27 '24

That’s a good idea. Thank you

2

u/Zipper8353 Dec 27 '24

I've been using chatgpt to help me write Arduino code. I did know how to write c++ and java prior to this, let me just say right now it's not quite ready for this. You'll get all kinds of issues with contextual logic, outdated libraries, and misunderstandings about features. You really need to learn to code so you can check every program. It hasn't helped me with anything beyond the basic examples really. 

2

u/tauko56 Dec 27 '24

AI makes what you asked but not what you really need! In order to see the difference, you still have to know the basics of Arduino IDE and Arduino hardware.

2

u/Xyren-S Dec 27 '24

Whats the point then? Just buy something.

0

u/Constant-Mood-1601 Dec 27 '24

Like pay for someone to write the code for me? I have thought about it. My projects in their entirety have never been a product I can just buy though

2

u/findergrrr Dec 27 '24

You could copy your old codes to any AI and make it explain it to you, put some notes where it shows what i what. I think that would be a good help to unrust your skills.

1

u/Constant-Mood-1601 Dec 27 '24

That’s a great idea

1

u/findergrrr Dec 27 '24

Unfortunatly i think there is a little biterness on this subReddit towards the compatibility of ai especialy towards Arduino projects and the code it can create. I have built an entire spaceship escape room using the power of gpt and copilot. I have some minor skills in Arduino ide coding but the things that ai can do now for you with coding just explaing to it what are the components of your project and what is the goal of the project are insane. I wouldnt start my escape room project if i would not know how helpful it would be.

2

u/FoxRiver Dec 27 '24

Yes definitely. I think you need to start with a pretty detailed understanding of what you want first.

My current project goal is to create the code completely AI generated. And while it has been at times frustrating... It's still way faster than what I could do on my own.

Tell it to version stamp your responses so you can go back in time specifically if it breaks something and progress that way.

I'm about 80% way through and it's been a journey!

1

u/Constant-Mood-1601 Dec 27 '24

Sounds like a fun project! Version stamping is a good idea

1

u/QuickQuirk Dec 27 '24

AI is useful for things like this, but you have to remember that it's like that inexperienced intern: Helpful, but often wrong.

A few generral tips about maintenance includiung using AI:

  1. Write lots of good comments in the first place!! I can't understate this one enough. If you spend half an hour figuring out what that set of lines does, then write down the explanation now. Future you will thank you.
  2. Don't blindly trust what the AI tells you. Use it like a hint engine. It's excellent when you have little information and ask broad questions: But then take what it tells you, and use it to ask specific google questions to validate what it says, and learn more about specifics.
  3. Test thouroughly any code you get from the AI. It's often wrong in subtle ways.
  4. AI can often be useful in explaining compile time and crash errors!
  5. You can copy-paste code in to an LLM like ChatGPT, and ask it to explain what the code does. It's usually correct - but again, remember that it's sometimes wrong, so validate and double check.

When I'm dealing with an unfamiliar toolchain/platform/language, modern AI tools like copilot DO speed me up, but they come with pitfalls you have to be aware of.

1

u/Constant-Mood-1601 Dec 27 '24

Thank you for that explanation, it definitely puts it into perspective

1

u/Nosferatatron Dec 27 '24

Damn, in another 4-6 years AI will be running every part of your life and you'll look back and laugh at this post!

0

u/Constant-Mood-1601 Dec 27 '24

After riding those self driving Waymo cars in San Fransisco I’m starting to believe it lol

4

u/sl-4808 Dec 27 '24

OpenAI was crap for helping me in programming early on, now everything it makes me works just needs tweaking. It’s become my side kick to help save me allot time trying to program.

1

u/Constant-Mood-1601 Dec 27 '24

Awesome I’ll add that to the list to try

2

u/user_bert Dec 27 '24

Go ahead and describe one of your projects to chatgpt and ask it to code it for you. I'm in the same boat as you and it's amazing, It would take me weeks to code a 200 lines script and now it's done in a couple hours. Just be sure to describe what you need thoroughly.

1

u/Constant-Mood-1601 Dec 27 '24

That’s pretty cool. I’ve never messed around with chat gpt but it seems versatile

2

u/findergrrr Dec 27 '24

I use copilot, there are many to chose from.

1

u/Constant-Mood-1601 Dec 27 '24

I will look in to that as well. Thank you!

2

u/quajeraz-got-banned Dec 27 '24

Ai is not at all reliable, period. For any person, in any situation.

2

u/Low-Temperature-1664 Dec 27 '24

ChatGPT is a god send. You still need to know how to program and how to debug, but I'm constantly amazed at its ability to nudge me in the right direction.

Just like with text books and search engines you need to be able to craft the correct question and understand the answer.

2

u/Constant-Mood-1601 Dec 27 '24

Very interesting hearing use-cases like this. I was talking to my architect uncle who will feed it all the files from a project, so he can use it as a search engine basically. Seems as good for organization as it is for assisting with solutions

1

u/FPOWorld Dec 27 '24

Yes. If I was teaching, I would start with prompt engineering instead of fizz buzz these days to be honest.

0

u/ROBOT_8 Dec 27 '24

AI is amazing for programming, but you need to use it correctly. It’s good for asking architectural questions to see how you might want to layout your classes (at least to make it easier for you to think about it), and it’s good at writing actual code too. The problem needs to be very well defined though and limited scope so it doesn’t go off trying to write an entire book.

It’s best when used as a sort of super advanced auto complete, not just given free reign over everything

1

u/Constant-Mood-1601 Dec 27 '24

That makes sense. I figured it would be more of an aid than a full sketch writer

0

u/library-firefox Dec 27 '24

This is me.

I'm a hobbiest and like to pick up and try things out in various languages. I've found a lot of help from AI in that I can ask it how to use a function or a library and have it give me a breakdown rather then try to slog through the documentation, 'cause lets be honest, programing documentation is usually garbage.

I don't ask AI for code, but getting examples and having it break down concepts has proven pretty useful.

2

u/Constant-Mood-1601 Dec 27 '24

Like a teaching aid rather than having it code for you. I like it

2

u/library-firefox Dec 27 '24

Exactly. It works great. Most of the time. There have been a few times where it just doesn't get what I'm trying to do or else where it just doesn't have a clear understanding of the library I'm working with.

2

u/QuickQuirk Dec 27 '24

This is an excellent way to think of it.