Vibe Coding
What I made was an HA dashboard for my inverter, a sprinkler controller, a fan control to cool down my inverter, and a temperature reader. What I discovered was the despite my fears of being unable, I can code! Well, I can vibe code. I have a solid understanding of C, and I can read C++. I can follow flow and logic. And I have basic troubleshooting skills.
I had purchased a 12,000 Watt inverter, and the firmware had a couple of bugs, making it nearly unusable for me. So using an ESP8266 I had laying around from my WLED christmas lights project, and Home Assistant, I read MODBUS registers through the RS485 bus utilizing ESPHome. I also write a MODBUS register in order to enable or disable battery charging.
I have another Instructable outlining how I created my own sprinkler controller. My degree is in Electrical and Computer Engineering. I haven't programmed in years. My biggest fear in these projects was that I would not be able to write the necessary code, or that it would take me months to get there. I'm 55. I haven't done large scale programming for 30 years. But even an old dog can learn new tricks. Read below and see how I overcame this challenge.
NOTE: Some images are generated using AI.
Supplies
This isn't really about the projects, it is about the coding. The only thing you need is a web browser. If you want to build an inverter monitor, or any monitor, or a sprinkler controller, then you need other supplies like breadboards, microcontrollers, jumper wires, temperature sensors, etc. But for the main piece of this, you need a web browser.
What Are You Coding?
No matter what you are coding, just pull up your browser. Open Gemini, ChatGPT, CoPilot: take your pick. I've used them all now. Word is that Claude is the best at the moment, but I haven't used it yet. Paying for a subscription gives you more time and processing power and speed. But you don't need a paid subscription to give it a try.
Prompts
In my case, for the sprinkler controller, the first thing I wanted to do is have the onboard LED blink every second. I prompted the LLM to do so. It already had the information about what board I was using and walked me through the wiring. I took a picture, it reviewed it and confirmed that everything was correct. It then provided the code for the blinking light in a separate box. That box included a button to copy to the clipboard. Ctrl-V and I was in business.
Have a Conversation
An important principle in vibe coding is the back and forth with the LLM AI. I didn't like that it had hard coded the blink time. So I asked it to change that to a variable. I then received some education about variables. The AI tools I have used also give suggestions for follow-up prompts. You can use those suggestions or come up with your own. Over the course of a couple of hours, I would suggest a feature, and the LLM would add the code. Pretty soon I had a full-featured sprinkler controller. I could turn on/off zones, run a zone for a specific amount of time, start/pause/stop a full program, and edit the full program. All from a web page. All with AI-produced code.
Troubleshooting
AI does make mistakes. Sometimes it will use older syntax. Or it might mess up on the formatting. In my project, it used some C++ that it said would work for a different board or an earlier version. I pasted in the compiler error, and it provided a fix that I copied and pasted back in. It also recognized it had done that same thing on a different line and gave a fix for that line too. When it makes a mistake, point it out. Ask for troubleshooting. Copy/paste the text of the error, or provide a screenshot. Here is an important key: a human still needs to be in the loop. AI may be able to take the place of a junior coder, but you need to be in charge of the flow, the features, and the troubleshooting.
Conclusion
My initial fears about coding for my various projects were founded in reality. It would have taken me weeks or even months to figure out how to do the coding for my sprinkler controller. I see a lot of among developers over AI. It is displacing some jobs. It is much harder to get an entry software developer job as a new Computer Science graduate. We just hired one, and he had graduated a year before. And he is not doing any strict coding. He is providing support for a couple of our applications. And there were about 8 other people we didn't hire, and about a hundred other applicants that we didn't even call back. But if you want useable skills, and you want to be a productive coder, you NEED TO LEARN to vibe code!
What are you coding today?
Note: I asked AI to produce me a vibe coder, and it gave me the cool dude with the apple laptop. But many vibe coders work for a business in a cube farm at a desktop as their day job, like the business casual guy.