Doing Every Arduino Project: #1

Doing Every Arduino Project: #1
Photo by Harrison Broadbent / Unsplash

To continue the momentum from building a single-board computer, I decided to go through all of the projects in the Arduino Starter Kit. The idea was that this would be a fairly straightforward, plug-and-play endeavor. What actually happened is that I got shot headlong into firmware troubleshooting, but after the initial problems subsided, it was indeed easy to get started. That seems to be the problem inherent in any "beginning" electronics work: it's all straightforward until something goes wrong, at which point it can jump levels pretty quickly.

In the first kit I ordered, the board was actually bad. In order to find that out, I set up the Arduino and breadboard, downloaded the Arduino IDE, set up the first program...but when I attempted to upload the sketch to the board, I got an error that made it seem that I couldn't actually write anything to the board. This functionality is pretty much the backbone of doing anything in the IDE, so I had to get this working.

Side note on setting up the board: it's not explicitly listed in the instructions or items included, but there are fasteners that go with the screws, and you can affix the board easily without a screwdriver.

Image of the back side of the Arduino board mounted on the tray that contains the Arduino and the breadboard

I spent a lot of time reading through the support articles on the official site and posts on other sites. From all accounts, it appeared I needed to flash the USB to Serial firmware to the board to get it to be recognized appropriately. This involves setting the board to DFU mode by shorting the pins, then flashing the firmware using Flip on Windows or dfu-programmer via homebrew on Mac. I was probably going to set up homebrew set up anyway since I was considering some Qemu projects, so I started with that route. Unfortunately, that did not resolve the issue, so I switched to PC, and installed Flip. Oh, but first I had to install the libusb-win32 driver to get the device to show in the proper category in device manager. I did that, set up Flip, followed the instructions appropriately, but still no dice.

At this point, I decided to contact Arduino support directly. I detailed why I thought this was the issue, the steps I followed to correct it, and the outcome that I could still not upload sketches. I linked to the flashing the firmware article from the Arduino support site that I had already been through. The first email I got back was a "restore my faith in humanity"-level of good support. The questions they asked back made it clear that they understood the issue and gave me meaningful next steps, and they also asked me to send my invoice over, making me (correctly) anticipate that they'd replace the board if it continued not to work. I also now know how to set and interpret verbose output mode for more specific error tracking. Unfortunately, still nothing worked. The following response I got was a link back to the original article I started the whole journey with and had linked in my initial ticket, which was the support experience I was generally used to getting from other places. I explained that I already tried all that (and referenced my first email), and thankfully at that point they agreed to replace the board, which I'm very happy about.

I quickly received the new board, and, lo and behold, using the same Mac and the same PC as I did originally, I plugged it in, uploaded the sketch, and it worked immediately. This is the experience I had hoped for from the beginning. Now I could move on to my first project! I successfully made the built-in LED flash. Now it was time for some breadboarding.

The first project gave a great explanation of basic terms and how to set up the breadboard to allow the switch to turn the external LED on and off. This one was overall easy to configure, and I got it working as seen in the below video (may be slow to play, but will get going eventually).

0:00
/0:08

Now, it's on to resolving problems with my virtual environment for Python, because I reinstalled Python via Homebrew and I can't directly interact with a Python package that Homebrew doesn't officially support without a virtual environment (different than a VM). Troubleshooting comes for us all.

I'll be posting future updates as I complete the rest of the projects from the book, which I'm excited to go through, now that I am no longer in the trenches of getting the most basic part to work!