Arduino Nano programming in 2023, obsolescence be damned

I’m working on a little PCB for a robotics competition. It is used by the competition volunteers to time races between competing robots. Cool!

The design is based on an Arduino Nano to keep things easy…. in theory. In practice, I couldn’t get a modern (or even outdated) version of the Arduino IDE to program this thing. It’s a common theme in the forums. Anyway, as a service to my future self and any other future selves, here is how I got it working, despite Arduino’s lack of care or interest in supporting their products:

  1. Abandon using the USB interface. I tried this on 3 operating systems & 3 versions of the Arduino IDE, I could not get it to work. According to legend, sometimes it may start working after a lot of wasted time. In these rare cases, nobody seems to know how they did it.
  2. Use an ISP programmer. Hopefully yours is not the Olimex avr-isp-mk2. This is what I have, and it is effectively not supported by Arduino since version 1.5.x
  3. For Linux users with the Olimex programmer:
    1. Download the source for avrdude (get version 6.4 from http://download.savannah.gnu.org/releases/avrdude/)
    2. Extract the source archive, enter the directory
    3. Apply this patch https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/endpointdetect_pass1.patch
      1. cd to avrdude[…] folder
      2. patch -p0 < endpointdetect_pass1.patch
    4. ./configure && make all
  4. I recommend using the legacy 1.8.x IDE from https://wiki-content.arduino.cc/en/software. Download that, extract the archive. Newer versions of the IDE seem to hang indefinitely on a vague loading screen.
  5. Applies to Olimex programmer: Find the avrdude executable included in the arduino archive. Replace it with your new compiled one
    1. find . -name ‘avrdude’
    2. it should be at hardware/tools/avr/bin
    3. use the ln command to link your compiled avrdude into this location. This replaces their older incompatible version with your newly patched binary
      1. ln -sf /path/to/your/src/avrdude/avrdude ./hardware/tools/avr/bin/avrdude
  6. You can now run ./arduino from the Arduino legacy archive – this was enough to get it working on my end
  7. In the Arduino IDE, upload the sketch by selecting your programmer from ‘Tools > Programmer’, and upload the sketch by using ‘Sketch > Upload using programmer’

Other things you may have to do on Linux systems: install a udev rule for the Olimex programmer, and add yourself to the appropriate group (probably dialout). See Olimex link below.

If you are on Windows with the Olimex interface – compiling will be different to some degree, but ultimately you still replace the avrdude executable to fix the issue.

If you are also stuck with the Olimex interface (why am I still using this thing??), there’s much more info here: https://www.olimex.com/forum/index.php?topic=5358.0

Projects from the grapevine: Bárány chair repair

Note: this blog post has been produced with permission from the client.

Update (2020-12-31): After receiving and installing the replacement parts, we have another successful repair! Here’s a video of the result:

Recently, a repair job came across my plate for some exotic test equipment: a “Bárány chair” used for testing pilots. This is one of those odd projects that comes through a friend-of-a-friend-of-a-friend. No electricians or repair technicians in the city were willing to touch this niche equipment – and I can’t blame them! I couldn’t find any information on this machine whatsoever.

Like most of you, I don’t specialize in exotic chairs – so what is a Bárány chair? From Wikipedia:

The Barany chair or Bárány chair, named for Hungarian physiologist Robert Bárány, is a device used for aerospace physiology training, particularly for student pilots.

Via Wikipedia

Here’s what the unit looks like:

The chair is motorized, with a wireless control to operate it:

The control allows the operator to adjust the rate and direction of rotation. The chair had stopped spinning, and the manufacturer was unresponsive and/or unwilling to repair the unit. It was clear from dead-end google searches that this unit is from a very limited run of a very niche product – there wasn’t an operator’s manual or service diagram to be found. Note the use of 3D printing for the remote control enclosure. If I had to guess, this probably came out of an R&D lab.

Upon arriving, the remote complained that it had no power to the base unit (“Dashes” observed). The only troubleshooting info available was listed on the side of the controller:

A quick investigation revealed that the power supply was plugged into a switched outlet, which had been turned off. Moving to a regular outlet caused the power supply to come online, and the controller sprang to life! No error code – just “00” on the two-digit readout. The chair was still not responding to the rotation settings – but when I manually spun the chair, it displayed the sensed rotation speed on its LED display. I concluded that the logic power supply and wireless communications were working. At this point, I suspected that the problem was in the motor, motor power supply, or the motor controller.

I investigated the power supply for the motor and found it to be outputting a steady 5V – which seemed unusual for a giant motorized chair. I would expect 12V or 24V for a large DC motor. I entertained the idea of adjusting the power supply to a higher voltage – could the power supply have degraded in its ten years of operation? The motor controller datasheet suggested that 6V was the minimum supply voltage, after all. Luckily I noticed that the motor controller had been modified for this application: it passes the motor power directly to the control logic. You can see a jumper wire that bypasses the 5V regulator in the image below. I expect that the 6V minimum is to accommodate the voltage drop incurred by the 5V regulator. Note, modifying off-the-shelf parts for out-of-spec operation is not a design technique that I recommend.

With this knowledge, I was reasonably confident that the entire system was designed to run at 5V, unintuitive as it may be. Good thing I didn’t adjust the power supply! I attached my scope to the control signal from the control logic to the motor controller to see what signs of life existed.

The control signal pictured above appeared to be a servo-style control signal – a carefully timed pulse controls the motor’s speed and direction. When I adjusted the speed control on the wireless remote, this control signal was unchanging. This suggested to me that the wireless receiver, control logic, and motor controller were likely all working – but receiving a “don’t spin” input signal. I turned my attention to the remote control:

And there it is – the rotary encoder for the speed control knob was split in two! One half was bolted to the plastic housing, but disconnected from the rest of the encoder. It still had an actuating “click” feel, without being electrically connected.

With the remote still disassembled, I pushed the rotary encoder back together to make a temporary connection – and the chair started spinning. If I had to guess, someone was a little too rough with this remote.

The replacement parts are ordered – with some careful soldering, I expect a successful repair and many dizzy pilots.

Tube amp repair

A few years ago I picked up this little gem of an amp at a gun show for a paltry 25 bucks.  Not a bad snag!

20140513_215846
vintage!

It worked great, except the volume knob didn’t seem to do much… it always sounded like it was on full blast.  So, I brought it down to Skullspace to tinker with it.

Aside from the potentiometer not really changing the volume, it was also quite scratchy when changing volumes.  This is usually a sign of a worn-out potentiometer, so I ripped out the old one and temporary wired up a replacement off ebay.

Doing a test run with alligator clips

I carefully tested the amplifier (you really dont want to touch the high-voltage tube supply wires in there when it’s powered…) and it sounded way better than before!  I deemed it a success and installed the new potentiometer, still with test connections:

20140513_220655
Dry fit before everything gets soldered

Everything seemed to work alright, so I soldered everything in place:

20140513_230304
hand-wired goodness

The only issue I faced was that the old wires did not really wick up the solder so well.  I suspect there are some poor connections because of this, but for now it works… maybe some proper flux paste would work better than rosin-core solder?

 

Stay tuned for an audio clip!

Don’t try this at home

My little Samsung netbook’s power supply died, so I thought I would see if it was an easy fix. Turns out the components are too tightly packed and coated with silicone adhesive-y stuff to easily find what is broken, but I did manage to shoot a video of a 150VDC capacitor discharge:

And that’s why you shouldn’t tinker with power supplies!