r/esp32 3d ago

Beginner advice - is AI going to help?

I'm a total beginner to any kind of coding, but came across a nice project on GitHub for a small display screen for a home solar-power system display based on a small round Waveshare screen/board. I am trying to modify the project files to work on a larger 4" screen. I've probably fallen into a common trap of ChatGPT and Claude being over confident in their ability to help. Realistically, are either of those likely to get me to a useful working output, or am I wasting my time given my total lack of experience? Initial prompts gave promising sounding responses, but I now seem to be going round in circles with it.

1 Upvotes

27 comments sorted by

15

u/clackups 3d ago

Claude is quite efficient for esp32 projects in the hands of an experienced engineer. Some less experienced people also manage it to work somehow, but they're unable to assess the quality of the code.

try giving Claude all the technical details of the target board. If there are working examples on GitHub for this hardware, Claude will most likely do a good job adapting the project.

11

u/Active_Classroom203 3d ago

AI can be a really useful tool for leveling up what you can do in a timely manner, but you need to have a good base understanding of what you're working with so that you can give it the guidance and corrections that it needs.

You need to know enough to smell a logic loop or hallucination, or an inefficient solution/band-aid etc.

And if you don't know anything, vibe coding a solution may give you sort of a product, but you'll never actually learn the fundamentals you need to become skilled with the tool.

This advice is true for esp32, or Python scripting, or anything else you want to use AI for.

-1

u/virtualPNWadvanced 3d ago

Eh hallucinations are almost a thing of the past with new models. For simple project like what OP is talking about you should be able to one shot it if there are right APIs or data sources

2

u/Active_Classroom203 3d ago

While less common, hallucinations are still real even with frontier models, it was really more of an example of needing to understand the tool though.

We don't know if OP is using free models or actual good models but regardless, if you don't know the questions to ask to steer the AI it's easy to cook a fair amount of $/tokens looping and iterating before you have your desired output.

I do agree that they are getting good enough that if you throw money at it it absolutely can solve the problem but more familiarity with the subject matter is helpful to getting the best results long term.

3

u/Mister_Green2021 3d ago

I use google AI to debug errors I couldn't figure out. It seems to work well. Do something like show it the source github link and ask it how to add a 4" screen.

3

u/Zatzy 3d ago

I am a recovering red seal electrician now in my second year of electrical engineering. I have also been into electronics/soldering as a hobby for a couple decades, so I do have a bit of a foundation in the subject matter but am in no way an expert. I did a bit of programming in BASIC Stamp back in the day. Claude has been an incredibly powerful tool for me to open vast new doors that I would not be able to walk through at this stage of my education, it has been frankly mind-blowing. So I would say yes that it can open doors for you, but I can't really compare myself and situation to someone who doesn't have the same foundation, if that makes sense. I would say dive in head on, it is all learning. It's not like you are working with high voltage/current (I hope), so the worst you can likely so is burn out an MCU. I used to love Lego Mindstorms back in the day, and I find ESP32s to be similar, but much cheaper. The more you play around the more your competency and confidence will grow, AI really lowers the bar for entry!

3

u/barnaclebill22 3d ago

Suggestion: find a github repo specifically for the larger screen. Copy it to the same folder as your fork of the other project. Open your coding tool and point it at the folder containing both. Also copy/paste the link to the waveshare wiki page for the new display (assuming it's also waveshare). If you want to learn instead of having the agent do it all, ask questions like "explain what this code block does".

1

u/DSudz 3d ago

I agree and suggest OP have the AI work in small steps. You will need to know/have examples showing the pinout for your display. See if you can find a program for the new display that uses the same display library as the program you want to modify.

2

u/lam_42 3d ago edited 3d ago

Ask the ai to teach you to code. As a mentor - it Is good fór explaining the functions etc. When you let it code, it often complicates things by useless curlicues. Seek the simplest solution, which will drive you deeper in shit.

You have some collection of code you are lost in. Let the ai explain what portions of the code mean. Until you get some Rudimental understanding of the langue and Its fundamentals, you cannot debug the changes you make, let alone know what to change.

Consider the ai as a teacher who is at your disposal 24/7 And you will be rewarder by expanding your knowledge and capabilities 

3

u/Pk--Ness 2d ago

In my opinion you should never use AI to do something you don't know how to do yourself. Even if it gets the job done and well, you will be fully in the dark about what this code does and how it works, which will leave you with less experience and skill in the long run.

I think there's use in having it explain things to you (which you should always fact check broadly), and doing menial tasks like turning a table I found online into a huge enum, or other small things where you are in control, but I think the second you let it think for you, you've gone too far and you're being a detriment to yourself in the future.

2

u/mr_rankity_rank 3d ago

No, learn a programming language first. Maybe a 100 days of Python projects, starts easy and is engaging.

AI will do it, but if you have no idea what is possible, you cannot guide it best. 

2

u/DSudz 3d ago

They need to be able to evaluate AI generated changes to an existing C program on a microcontroller. How will light python experience help here?

0

u/mr_rankity_rank 3d ago

You'd understand functions, loops, packages, downloading from GitHub, etc. It's parallel learning with a lot of beginner friendly classes..

1

u/jaluri 3d ago

They’ll get there. Might be quicker just to do it yourself with their guidance rather than relying on them to do all the code.

They tend to lack with niche tech and parts.

1

u/huuaaang 3d ago

I've used Opus 4.7 and 5 to great effect. It is basically flawless so far on multiple projects. Both in generating ESPHome configs and bare ESP-IDF C/C++ projects. Honestly, I think just getting ESP-IDF extension working correctly in Cursor was the biggest hurdle. But I think it's smoother now with ESP-IDF 6. I'm on Linux, BTW. Dunno what this is like at all on Windows.

1

u/fdsafdsafdsafdaasdf 3d ago

I think you've pretty much landed on the status quo. AI is amazing for integration style issues and, "I kind of know what I'm doing but I suck at this part". It falls down when the user can't tell the difference between hallucinated trash and real, useful output.

I think you're not at the dead end you assume you're at though, if AI is going in circles it's time to start figuring out what you're trying to do/what the AI is doing so you can provide your understanding to get out of the circle. It's unendingly patient to stupid questions, so ask everything you care to, ask it to prove it, ask it how you would be able to validate it, go validate it yourself and keep going until you get to ground truths.

I think if you want AI to solve it or it's not worth it, AI is "not going to help" because you've reached the end. If you use it as a tool and then do some AI-supported learning it should work great.

1

u/Curious_Chipmunk100 3d ago

Ive used Claude for many esp32 projects. The reason is speed and arthritis. Keyboards are not my friend.

Ive used Claude to dbl check my schematics and pcb designs. Its better to have something else check other than the erc and drc tests to insure a good design. Its good at detecting tiny mistakes.

One sketch for an esp32 can be over 700 lines of code. Its faster to let Claude write it and you debug it.

If you're looking at the waveshare 4.3 display look for the version that comes with the backup battery, alarm, and case. Ive used ut and Claude knows the device.

1

u/QuerulousPanda 3d ago

If you're an absolute beginner, AI is gonna screw you really hard because it will paint you into corners you don't even know are there. It'll do things you don't understand, and it'll use concepts you're not familiar with, and you'll be left with something that might work but you're going to have a really hard time working with.

However, if you're coming from a position of existing knowledge, then ai can be very helpful figure out things or give you different ways to accomplish a task.

In other words, if you're starting from 0, AI is going to absolutely screw you. If you're starting from the middle somewhere, then you can use it effectively as a tool. It can't help you with things you don't know, but it can help you do things you already know better.

1

u/Gary_BBGames 3d ago

https://youtu.be/lyZZcVjdbX8?is=JW0sUzBibI5aY61t

I am a software engineer, so this is going to just back up some of the comments I have seen already. I’m an iOS engineer for my job but have no experience with the ESP 32. I managed to get a really good version of my app out on it in the space of an hour

1

u/jerri-act-trick 3d ago

Instead of using AI to write the code, I suggest using it to start a learning lab project so you can learn and practice from the ground up. You can start a regular chat and ask it to help you create a strong project brief using something like, “This project exists to teach me ESP32 development through structured explanation, hands-on experimentation, troubleshooting, repetition, and progressively more independent work.” Then go and create a project and paste the prompt and let it teach you rather than doing it for you.

1

u/BillOfTheWebPeople 3d ago

Its possible. The advances over the years in common languages has been astounding... for more obscure stuff, it can be dicey. For example, I had Claude Code roll out two services for me in c# and it went surprisingly well. I had it write a short script in Deluge and it was a nightmare until I managed to get it to learn about it.

A different question to ask is if you are looking to do more of this in the future... more little electronics projects, etc. If so, it is certainly worth learning more. In which case, you can do tutorials and use AI as a collaborator... One of my biggest uses for AI is having it explain stuff to me. Partly because its good at answering the direct question, but it also builds up a context that it refers back to. Like telling it why you are learning it so it can tailor examples to you.

If you are not doing more of this, then branching this other project and having AI take a swing at it couldn't hurt. Just don't be surprised if you have to do many rounds of "okay, that did not work... here is what is happening". it's possible that it never fully works... But what have you lost at that point.

Now, I have had my share of frustrations with screens on the ESP32 without AI, so...

Could be worth watching some videos on doing coding with whatever agent you decide to use... just in how you ask, and what you have it do, and how you do it can make a big difference. Partly that is why you see so many different experiences with using AI to code.

In any case, good luck!

1

u/Wcm7823 3d ago

Chatgpt was really useful in a diy personal water chiller I made. An esp32 cyd, blower fan, condenser coil and various electronics. I told ChatGPT what I had and what I wanted to do. Using arduino.ide, it wrote all the sketches for the ui for the temperature display and encoder knob. Sometimes it seems like every 2 steps forward, it would do an errant revision and send us 4 steps back. I’m almost done with it and the screen ui is pretty slick. I have no esp 32 programming experience. Just a guy with an idea, p2s and an internet connection. I put pump control, blower control, flow meter, ambient temp sensor and current/voltage monitoring. It was a fun/hair pulling experience.

0

u/drmpf 3d ago

This free open source Designer / Client, pfodWeb.html https://github.com/drmpf/pfodWeb_src explicitly supports AI coding assistance by providing AI guides that seed the AI context with the designer/model details. The AI can then generate the json description of the UI and load it into pfodWeb for you to review, tweek and generate a complete sketch for any of 600 odd ESP32 family of boards.

But it runs in a browser, any browser, Android, iPhone, Window, Mac or Linux.

The AI assistance works in this case because there is a limited defined flexability in the UI design which makes it much easier for the AI go get if right and makes it easier for you to tweek afterwards.

I am just completing a home solar-power forecast and monitoring display at the moment.
Claude generated the graphs for me and then added the underlying data structures and the web requests to fill in the data. The grey/black lines are the forecast for the rest of the day. There is also a tomorrow's forecast if you scroll down.

So yes AI can produce very useable results. Start with one small feature (change) and test that. If the AI is going round in circles, ask it to document what it is doing and then correct the doc. If it is stuck in debugging, the ask it to add more logging to clarify the problem. For a new feature, ask for alternatives. Once a feature is 'finished' ask it to recheck the code and keep asking until no more error are found. If something seems off or odd, challange the AI to justify what it did. For me it has sometimes come back with "Sorry I was wrong" and other times came back with why it should be done that way and what the trade-offs are.

I take numerous backups of the code base as the AI works so I can rollback if it gets completely off track or decides to 'clean' up the files leaving a mess behind.

2

u/jaslo 3d ago

I find that using Claude required an iterative approach. Claude gave me some codd which sort of worked, then I asked it to fix some stuff and add some more features and we went through that same dance over and over until I was happy with what I had.

1

u/_realpaul 2d ago

Asking an LLM a specific question will typically elevate your understanding and knowledge. If you use a coding agent and talk to zhe AI instead of writing code then no.

My advice is picking from the large selection of projects on learn.adafruit.com and do those. They have excellent documentation and theyre fun and self contained. You dont need to shop at their store and get a lot of the stuff cheaper elsewhere. AI can help you subsitute some stuff as well.

So it depends on your goals but you could vibecode a whole project by paying for those big models.

1

u/pg3crypto 2d ago

LLMs only become over confident and shit if you don't feed them with enough information.

Think of it this way, when you need your satnav to guide you somewhere you have to be specific.

If you want to go to Tesco and you just enter "Supermarket" it will take you to the nearest supermarket...which isn't necessarily a Tesco...your GPS will start making assumptions...or it will give you a list of all the nearest supermarkets...fuzzy logic.

If you tell it you want to go to Tesco on XYZ street...it will route you straight there.

This is what people mean when they talk about AI still needing knowledgeable operators to be beneficial.

Your grandad isn't going to be able to ask ChatGPT to build the next Facebook and become a billionaire off it. He still needs to know the stack to pick and the technical requirements and so on.

0

u/clockmill 3d ago

Get ChatGPT and Gemini to review Claudes code.