Breakout Board for Teensy 4.0

During the Teensy 4.0 beta test we made these breakout boards, to easily test hardware features.  They were also sent to Hackaday, Hackster, and Hackspace Magazine for reviews.

Now we’re sharing all the info, so you can make your own copy of this breakout board!

Breakout Board Features

First, let’s look at the main features.

  1. Main USB for Teensy 4.0.  The entire board gets power from this USB connector, so it must be plugged in for the eval board to work.
  2. Second USB host port.  To test this, plug in a USB keyboard or MIDI keyboard or drum pad.  In Arduino, click File > Examples > USBHost_t36 > Test for a simple program which responds to events from those types of USB devices.  The eval board has a TPS2055A current limit chip, which allows most USB devices to be hot plugged while running from USB power provided over the main USB port.
  3. Audio shield output.  Plug in headphones or computer speakers.  Recommend running File > Examples > Audio > Synthesis > Guitar to test the audio output.
  4. SD card accessed by SPI with pin 10 for CS.  The eval kit comes with a 32 GB card pre-loaded with 4 public domain music files.  Recommend running File > Examples > Audio > WavFilePlayer for a first test.
  5. SD card accessed by SDIO (4 bit).  To test this, run any of the SD library examples.  Edit the chip select pin to BUILTIN_SDCARD.  An 8 pin flat flex cable connects between the Teensy 4.0 and peripheral board to provide access to the SDIO pins.
  6. Coin cell holder (CR2032 type battery), for RTC backup.  Run File > Examples > Time > TimeTeensy3 to access the RTC date/time.
  7. Power On/Off button.  Hold for 5 seconds to completely shut off 3.3V power.  Press for 1/2 second to turn back on.  If a coin cell is installed, the power on/off state will be retained when you disconnect the USB cable.  Without the coin cell to maintain power management state, the 3.3V power will default to “on” when power is applied.
  8. Power LED, to visually confirm if the 3.3V power is turned on.
  9. Serial1 to Serial7.  These 6 pin headers mate with the commonly available FTDI TTL-level cables, and numerous boards following that 6 pin format.  For a quick test program, click File > Examples > Teensy > Serial > EchoBoth.  If using Serial2 or higher, edit the define in that program.
  10. CAN FD port.  Use the FlexCAN_t4 library to access this port.  Unfortunately, the labels printed on the eval board are backwards.  On the original boards (shown in these photos), the center pin labeled “CANL” is actually “CANH”, and the right hand pin labeled “CANH” is actually “CANL”.  The shared PCB files have this error corrected.  If your CAN bus requires a termination, a 120 ohm resistor can be soldered to the eval board.
  11. Ground test point.  Handy if you wish to make measurements with a voltmeter or oscilloscope.  🙂

Circuit Board

The PCB is available as an OSH Park shared board.  You can buy it from OSH Park, or use the Download button on that page to get the PCB gerber files.

Connections to Teensy 4.0 Bottom Side

To connect to the bottom side of Teensy 4.0, the breakout board uses these spring-loaded pogo pins.  Either 12 to 12.5 mm height can be used for the pins which touch the flat surface mount pads.  12.5 works best to contact to the On/Off and VBAT pins.

 

These pogo pins were purchased from RTLECS.  RTLECS sells on Aliexpress, Ebay and maybe other sites.  If you have trouble finding them, the ones we used for the beta test came in this bag with contact info.

While there are 14 locations to solder these these pogo pins, Teensy pins 26, 27, 32, 33 are not routed on the breakout board.  You only need 10 pogo pins to fully utilize all the breakout board features.  Many of the ones built for the beta test had only 6 pogo pins, leaving off the 4 pins to for Serial6 & Serial7.

The 8 pins for native SD card support are connected by a FFC (flat flex cable) between Teensy 4.0 and the breakout board.

Credit to Defragster for sharing this photo on the forum.  Also in this photo you can see one of the earlier beta test boards, which had a white wire soldered to the bottom to correct a brown-out restart problem discovered during beta testing.  The final Teensy 4.0 boards have this wire routed on layer 3 (of 6) inside the PCB.

Parts List

Here is a complete list of parts needed to fully build the breakout board.  Some of these parts may be left off if you do not need all the breakout board features.

 1 Teensy 4.0
 1 Audio Shield, Rev B or Rev C
 1 Resistor, 100 ohm, 805
 1 Resistor, 150 ohm, 805
 1 Resistor, 2.2K ohm, 805
 1 Resistor, 22K ohm, 805
 2 Capacitor, 0.1 uF, 805
 1 Capacitor, 1.0 uF, 805
 1 Capacitor, 4.7 uF, 805
 1 Capacitor, 100 uF, 1206
 1 MCP2558FD CAN-FD Transceiver, Digikey MCP2558FD-H/SN-ND
 1 TPS2055A USB Current Limit Switch, Digikey 296-3418-5-ND
 2 Connector, FFC 8 pin, HFW8R-1STE1LF
 1 Connector, Micro SD, DM3D-SF, Digikey HR1941TR-ND
 1 Battery Holder, CR2032 (commonly sold on Ebay & Aliexpress)
 4 Socket, 14 pin
 7 Header, 6 pins
 1 Connector, Terminal Block, 3 pin, 5.08mm
 1 Connector, USB Host, Digikey 609-1041-ND (good) or ED2991-ND (cheap)
 1 LED, Green, T1-3/4, Digikey 1080-1128-ND
 1 Connector, Test Point, Digikey 36-5011-ND
10 Pogo Pin, 12 mm, RTLECS PGTH1250
 1 Pushbutton, 5 pin
 1 FFC Cable, 8 pin, same side contacts, Digikey AE11351-ND
 4 Header, 14 pin
 1 Acrylic Base, 1/4, laser cut
 5 Standoff, Hex M-F, 4-40, 1/4, Digikey 36-4800-ND
 5 Machine Screw, 4-40, 3/16

Assembly Steps

To build the breakout board, first solder the bottom side parts.

When building the top side, first solder the FFC connector and SD socket, if you wish the use the native SD card.

Before soldering any other through-hole parts, solder the pogo pins.  Getting these 12.5 mm tall pins aligned at a right angle to the PCB is tricky.  The beta boards were held in a Stick Vise to keep the board flat with the table facing top side up and the surface covered with extra liquid flux, then the pins inserted and heated from their side while a small amount of solder was applied.  They take quite some time to cool down.  Use caution to avoid burned fingers!

After soldering the pogo pins, the rest of the through-hole parts can be soldered in any order.  The 14 pins sockets make a nice a temporary alignment tool to hold the 6 pin headers straight.  Placing your Teensy into the 14 pin sockets during soldering guarantees they are aligned so it will later fit properly.

Acrylic Base

The final (optional) piece is this laser cut acrylic base.

The file used for these as SVG (zip download) can be used to get a proper fit.  After laser cutting, the 5 holes were threaded with a #4-40 tap.

Kurt’s Breakout Board

Kurt shared on the forum this breakout board, plus another he is developing.  His boards have many features not found on the PJRC beta test breakout board.

Kurt publishes his designs on github, as Diptrace files and gerber files you can send to any PCB fabrication company.

Mike’s Breakout Board

Mike also shared his breakout board on the forum.

 

Tall Dog’s Upcoming Breakout Board

Tall Dog is working on a breakout board for Teensy 4.0, which you will be able to buy as a kit.  They shared this preliminary image on the forum.  This is still in the planning stage, so the final product may look different.

 

 

 

MIDI Control of El Wire

This is an older project from 2012, firmware to control el wires by MIDI.

Hand-Eye Supply used it for their 2012 float in the Starlight Parade.

Their prior float was controlled by the Vixen X-mas lighting software.  For 2012, Laurence wanted to make the float interactively respond to sounds. Tobias investigated different software and found excellent sound processing software, but no way to interface it to Vixen or last year’s firmware using Renard protocol.  All sound processing software works with MIDI, so I decided to reprogram the controllers.

I wrote the MIDI firmware, just in time for their float kick-off party where the announce the winners of a contest for who will ride on the float.  Lots of pictures and info on that Core77 page.  This blog is about the technical details, making the el wires respond to MIDI control this year.

The el wires are controlled by this modified Sparkfun el wire sequencer.

 

This is the same board that had many problems last year. You can see in the photo 3 of the triacs blew on this board and were replaced with TO-92 through hole versions.

Here are Laurence Sarrazin and Tobias Berblinger reprogramming the sequencers, while Kathryn tries “playing” the lights.

The float runs on 15 sequencers, with 5 plexiglass panels having 3 sequencers and 3 cool neon “big boy” inverters per panel.

Here is the actual hardware I built for this year.

There’s no microcontroller. It just takes MIDI IN, goes through an opto-coupler, and then buffers the signal. Most of the space is a simple linear regulator to make 5 volts to send to the sequencers. Here’s a schematic:

 

An important point is the 4.7K resistors in the cable. The sequencers have AVR chips running at 3.3 volts, so these resistors prevent the 5 volt signal from damaging them.

The same signal goes to all 15 boards. Jumpers on the edge of the board configure which 8 notes each board will “play”.

The firmware only listens for MIDI channel #1. It is “velocity sensitive”, with the following code:

uint8_t midi2intensity(uint8_t velocity)
{
        if (velocity < 6) return 0;
        if (velocity < 12) return 1;
        if (velocity < 18) return 2;
        if (velocity < 24) return 3;
        if (velocity < 30) return 4;
        if (velocity < 36) return 5;
        if (velocity < 42) return 6;
        if (velocity < 48) return 7;
        return 8;
}

Intensity 8 corresponds to fully on. Lower numbers, from 1 to 7, output PWM-like drive to the triacs for dimming.

The idea behind these scalings is most of the MIDI velocity range will make the el wires fully illuminate. El wire isn’t terribly bright anyway. But if someday dimming effects are desired, that low section of the range can be used (without having to reprogram all 15 boards again).

Unfortunately, the Sparkfun sequencer lacks any information about the phase of the AC waveform to the el wire, so the pulses must be many cycles instead of switching individual cycles (you don’t want to do fractional-cycle dimming, as would be done on resistive or inductive loads). The lowest couple intensities sometimes flicker as a result.

Here is the source code which runs on those sequencer boards.

float_code_06.zip

 

This article was originally published in May 2012 (archive.org link) on the DorkbotPDX site.  Since then, the DorkbotPDX blog section has vanished.  I’m reposting it here with slight edits, to preserve the info.  Today Teensy 3.6 supports USB host MIDI (and many keyboards no longer have 5 pin DIN MIDI connectors, only USB), and LED strips are now far more popular than el wire, but perhaps this old info and code may still be helpful for someone?

 

Sturdy Pots on Breadboards

Often I make a quick demo involving pots to adjust parameters.  I needed a good way to put pots on solderless breadboards.

I had been doing this way:

These little thumbwheel pots work, but they’re not easy to turn, and trying to turn them puts quite a bit of stress on the loose breadboard connections.  They’re also too low to the surface, so people’s fingers get close to the wires and risk disconnecting them.

Socially, I’ve observed people tend to feel awkward touching these… maybe they don’t want to break my project?  Or maybe it’s just not clear if they’re supposed to be touched and adjusted?

With knobs on top of the pots, a last-minute project really looks like something you’re supposed to touch!

 

The ones in this video are actually the first version I made, with only 6 header pins.  Those worked, but they still weren’t as strong as I wanted.

My latest version adds another pair of pins.  It’s *really* strong and secure when plugged into a breadboard.

 

The PCB is so very simple.

They can be ordered from OSH Park, if you’d like to have some for your next breadboard-based demo.

The pot used on these photos is Digikey # PTV09A-4020U-B103-ND.  This is a very standard pinout for 6mm shaft pots, so many others are likely to work fine.

The colored knobs were ordered from a no-name Chinese merchant on Ebay.  Searching on Ebay for “knob 6mm shaft” will bring up *lots* of them.  These gray ones with colored tops were 10 piece for $1, with free shipping.  The ones I got didn’t actually fit the 6mm shaft until I ran a drill bit into the center, but it’s hard to complain when they’re so incredibly cheap.

Best of all, real knobs with bright colors and sturdy construction really invite people to touch and adjust and play with a breadboard constructed demo, in fun ways that just aren’t socially feasible with trim pots!

 

This article was originally published on the DorkbotPDX website, on August 14, 2015.  In late 2018, DorkbotPDX removed its blog section.  An archive of the original article is still available on the Internet Archive.  I am republishing this article here, so anyone wanting to make these sturdy pot boards can find the original info.

High Precision Sine Wave Synthesis Using Taylor Series

Normally sine waves are generated on microcontrollers using a table lookup.

Lookup tables are perfect when wavelength happens to be an exact multiple of the sample rate, because you never actually need to know the values in between the table’s stored points.

But if you want to generate waveforms at any frequency without changing your sample rate, you end up needing points on the waveform that are between two entries in the table.  Four approaches are possible.

  1. Use the prior point, even if the next point would have been better
  2. Use the prior or next point, whichever is closer
  3. Use both nearest points with linear interpolation
  4. Use 3 or more nearest points, with spline or other non-linear interpolation

With any of these, larger lookup tables give better accuracy.  Since sine waves have symmetry, some programmers choose to store only 1/4 of the waveform and add slight overhead to map the other 3 quadrants onto the smaller table.

The Teensy Audio Library uses approach #3 for normal sine wave synthesis.  The vast majority of sine wave examples in the Arduino ecosystem use approach #1.

If you want a sine wave with extremely low distortion, where 16 or 20 or even 24 bits are within +/- 1 from an ideal sine wave, you would need an extremely large table!

Ideally, you’d want to be able to very rapidly compute an accurate sine value for any 32 bit resolution phase angle, so your samples always line up to an ideal sine wave.

Sine can be computed using Taylor series approximation.  The formula is: (where x is the angle, in radians)

sin(x) = x – (x^3)/3! + (x^5)/5! – (x^7)/7! + (x^9)/9! – (x^11)/11! + ….

This series goes on forever, but each extra terms makes the approximation rapidly converge to the true value.  In doing quite a lot of testing, I discovered the C library function on Linux for sin() uses this approximation, to only the (x^7)/7! term.  I also found a few sites talking about going to the (x^9)/9! for “professional quality” audio.

One nice advantage of cutting off the Taylor series with on of the subtracted powers (3, 7, 11, etc) is the tiny remaining error will always be slightly less than the true ideal sine value.  This means the final result does not need be checked for greater than 1.00000 and rounded down to fit into the maximum value of an integer.

If you’re still reading by this point, you’re probably shaking your head, thinking this couldn’t possibly be practical in a microcontroller.  That’s a complex equation with floating point numbers, and huge values in x^11 and 11!, since 11 factorial happens to be 39916800.

However, this Taylor series equation can be computed very efficiently, by exploiting the Cortex-M4 DSP extension instructions and bit shift operations, where the phase angle from 0 up to 2π is mapped from 0x00000000 to 0xFFFFFFFF.

The code I’m sharing here implements this equation to the (x^11)/11! term using 32 bit integers, using only 12 multiply instructions, which execute in a single cycle on Cortex-M4.  The add & subtract take zero CPU time, since those multiply instructions also come in flavors that do a multiply-and-accumulate, either positive or negative accumulate.

The Cortex-M4 multiplies perform a 32×32 to 64 bit multiply, and then discard the low 32 bits, with proper round off.  That turns out to be exactly the right thing for managing the huge values of x raised to an increasing power, and the huge numbers of the factorials.  Since those divisions are by constants, it’s possible to multiply by the reciprocal to get the same effect.

So, here’s is the optimized code:

https://github.com/PaulStoffregen/Audio/blob/master/synth_sine.cpp#L75

// High accuracy 11th order Taylor Series Approximation
// input is 0 to 0xFFFFFFFF, representing 0 to 360 degree phase
// output is 32 bit signed integer, top 25 bits should be very good
static int32_t taylor(uint32_t ph)
{
        int32_t angle, sum, p1, p2, p3, p5, p7, p9, p11;

        if (ph >= 0xC0000000 || ph < 0x40000000) {
                angle = (int32_t)ph; // valid from -90 to +90 degrees
        } else {
                angle = (int32_t)(0x80000000u - ph);
        }
        p1 =  multiply_32x32_rshift32_rounded(angle << 1, 1686629713);
        p2 =  multiply_32x32_rshift32_rounded(p1, p1) << 3;
        p3 =  multiply_32x32_rshift32_rounded(p2, p1) << 3;
        sum = multiply_subtract_32x32_rshift32_rounded(p1 << 1, p3, 1431655765);
        p5 =  multiply_32x32_rshift32_rounded(p3, p2) << 1;
        sum = multiply_accumulate_32x32_rshift32_rounded(sum, p5, 286331153);
        p7 =  multiply_32x32_rshift32_rounded(p5, p2);
        sum = multiply_subtract_32x32_rshift32_rounded(sum, p7, 54539267);
        p9 =  multiply_32x32_rshift32_rounded(p7, p2);
        sum = multiply_accumulate_32x32_rshift32_rounded(sum, p9, 6059919);
        p11 = multiply_32x32_rshift32_rounded(p9, p2);
        sum = multiply_subtract_32x32_rshift32_rounded(sum, p11, 440721);
        return sum <<= 1;
}

On top of the 12 cycles for multiplies, there’s a few bit shifts, and a quick conditional test which subtracts from a constant.  That’s necessary because the Taylor series approximation applies only if the angle is between -pi/2 to +pi/2.  For the other half of the sine wave, that subtract maps back into the valid range, because the sine wave has symmetry.

This function takes a 32 bit angle, where 0 represents 0 degrees, and 0xFFFFFFFF is just before 360 degrees.  So the input is perfect for a DDS phase accumulator.  The output is a 32 bit signed integer, where 0x7FFFFFFF represents an amplitude of +1.0, and 0x80000001 represents -1.0.

This code will never return 0x80000000, so you don’t need to worry about that case.

I did quite a lot of testing while working out these constants and the bit shifts for correct numerical ranges.  I believe the top 25 bits are “perfect”.  Six of the low 7 bits are very close, but the approximation does diverge slightly as the angle approaches pi/2 magnitude.  The LSB is always zero, since the computation needs to have extra overhead range to accommodate values representing up to ~1.57 (pi/2) before the latter terms converge to the final accurate value.

For 8 bit AVR, this approach probably isn’t practical.  It probably isn’t practical on Cortex-M0+ either, since there’s no 32×32 multiply with 64 bit result.  Cortex-M3 does have such a multiply, but not in the convenient version that rounds off and discards the low 32 bits.  On Cortex-M4, this code runs very fast.  In fact, when executing at 100 MHz or faster, it might even rival the table lookup, since non-sequential flash accesses (for the table) usually involve a few wait states for a cache miss.  Then again, this code does have 6 integer constants, for the conversion to radians and the factorial coefficients… and depending on compiler flags and flash caching behavior, loading those 6 constants might be the slowest part of this algorithm?

I’m sure most people will still use table lookups.  Linear interpolation between the nearest 2 table entries is fast and gives a result good enough for most applications.  Often a large table is also works well enough, without interpolation.  But I wanted to take a moment to share this anyway, even if it is massively overkill for most applications.  Hope you find it interesting.

UPDATE: Josy Boelen mentioned alternate forms for Taylor series approximation which require fewer multiplies.  Whether these could also be optimized with the M4 DSP extension instructions (not keeping full 64 bit resolution at every step) could be a really interesting future project…

 

This article was originally published in January 2016 (archive.org link) on the DorkbotPDX site.  Since then, the DorkbotPDX blog section has vanished.  I’m reposting it here with slight edits and a couple waveform plots, to preserve the info, and also because Michael Field recently asked for an article about these sorts of numerical approximations (which are rarely given as highly optimized fixed-point source code).

 

 

Hand-Eye Supply’s 2011 Starlight Parade Float

Many years ago, I helped with the electronics+software for Hand-Eye Supply’s Starlight Parade float, designed by Laurence Sarrazin.

It won the Parade’s “Sweepstakes Award – Best Illumination”!!! Here’s more news coverage and Core77’s announcement, detailed announcement and Behind-The-Scenes build story (with time lapse video).

This article was originally published in 2011 (archive.org link) on the DorkbotPDX site.  Since then, the DorkbotPDX blog section has vanished.  I’m reposting it here, to preserve the info.  Even though LED strips are far more popular today than el wire, maybe this old info and code might still be useful?  What follows is the original text from June 2011, with as many links updated as possible.

The lighting wasn’t very bright, but there were 114 computer controlled circuits. It was really the only float in the whole parade where the lights “did something” (Robin’s description). Indeed they blinked and faded in lots of complex patterns.

The float was designed by Laurence Sarrazin of Hand-Eye Supply. The whole thing was her artistic vision!

Here’s an early blog post with many concept images. This is the one submitted to the Rose Festival.

The idea was animation, like this video she made.

Laurence talked with Steve who’s a Dorkbot regular, who put her in touch with Mykle. Of course, Mykle’s interested in all types of lighting, and he posted it to the mail list on April 22. We all met up for the first time on May 9th and agreed on a rough plan involving a number of the Sparkfun el wire controller boards. All the el wire and controllers arrived on Friday May 13, the day Hand-Eye held a big party to celebrate the launching of the project, or something like that.

I did the electronics and software design part from the 14th to the 19th, and dropped off 2 working controllers and picked up lots of parts that were ordered on the 16th and had just arrived.

Originally Mykle and I had planned to use a perl script (which Mykle would write) to convert an XML export of Laurence’s Adobe After Effects animation (eg, the one you see in that video on Vimeo).

Around that time, Laurence decided to switch to the Vixen DIY Christmas Lighting Software. Here’s a screenshot of what Vixen looks like:

Vixen comes with plugins to communicate with a number of controllers people have created, and one of them looked particularly promising…. the Renard protocol. Several controllers have been made with PIC chips to control ordinary incandescent lighting. None were available for el wire, but the protocol allowed plenty of channels and didn’t require super fast baud rates, and supported 255 brightness levels. So I decided to just program the Sparkfun controllers to accept Renard input.

The Sparkfun el wire controllers were very problematic, but they were pretty much the only off-the-shelf board available. If I had to do this all over again, I would NOT recommend them. I’d make my own.

Here is the firmware I wrote for the Sparkfun boards. It allows each board to be any 8 channels, between 1-8 to 113-120, by placing jumpers on the header on the left side of the board. The boards don’t come with this header… I added to to each of them. Here’s how the jumpers configured each board.

So, with 2 boards talking Renard protocol, on May 20th Laurence began a series of soldering parties. Here’s photos from the first soldering session, held at Hand-Eye Supply’s workshop.

(yup, that’s me soldering in this next photo… though I can’t recall what it was for, maybe a posed shot?)

Here’s a photo with a test (done a few days later) with just those first 2 boards. For about a week, only these first 2 boards were working while I modified all the others.

Mykle began work on a cable harness that would distribute data from a laptop running Vixen to all the el wire controller boards… 15 of them. Here’s a diagram of the harness design.

As you can see, the controllers are located in clusters. I mage a transmitter boards, using a Teensy 2.0 running the USB to Serial sketch, on a little hand-wired board with an opto coupler (who wants to hook a nice Mac laptop to a system of 15 high voltage el wire inverters?) and a 5 volt power supply, and buffer with poor-mans slew rate limiting (resistor-capacitor filter) to drive the long cable.

Somewhere shortly after the 20th, construction moved to ADX – which is a great space for building up a big project like this.

Here’s a photo of one of the early soldering parties at ADX.

Here’s a photo from May 29th, as the bamboo pieces were starting to be assembled, and the steel which would be welded into the entire frame of the float had just arrived…

The electronics were all delivered on May 23rd for a full system test. There was a last minute problem with the cable, so only 2 boards were able to receive communication on the 23rd. Here’s that test, where I’m checking to see if the Sparkfun boards are having more troubles.

Mykle made some changes to the cable, and on May 24 the entire electronics package was verified to be working. I believe this was the only time, except for only an hour before the parade, where all the el wire was actually hooked up!

Building a float is a lot of work!!! I wasn’t really involved in the construction much, until the weekend of the parade. Laurence had quite a crew of dedicated volunteers, many of them students from the art institute. They put in a lot of work building the whole thing.

Not only did they build a huge number of these flowing structures from bamboo, but the entire frame of the float was welded together from raw steel. Pretty amazing. I wasn’t involved in any of this part. These photos were taken by ADX.

I stopped by on Thursday, June 2nd (2 days before the parade), and June 3rd (the night before, while ADX was having a huge grand opening party). Robin & I met there, I dropped off some parts and we had dinner out. Robin being so understanding about projects like this was ok with me staying there after our dinner out and working on it pretty late.

Here we are right before going out to dinner, and Robin’s really hungry and waiting while we try to figure out how the electronics will attach!

I went by Saturday (the date of the parade) and helped from about noon until the parade. Most of the lights were on the float, but none wired to the controllers, which had just been mounted that morning! I spent much of the time getting Mykle’s cable connected, and one of the groups of controllers had to be remounted for the cable to reach. It’s amazing how many little things all need to be solved.

As things wrapped up at ADX late in the afternoon, we lit up the lights for the first time actually on the float, and it was indeed an awesome moment seeing it was indeed going to work, even if less than half had been wired in by that point.

Getting the float from ADX to the parade staging are was another adventure… one for some else to write…….. Here’s a photo of the last part I saw at ADX, as it was being wheeled out onto the street to be (somehow) attached to a truck.

I actually left as they were hooking it to a truck to go meet up with Robin in NW for dinner near the parade. The brought it across the river to the parade staging area while Robin and I had dinner.

We both helped, and in those last few hours and amazing number of wires were all attached…. Beer was consumed too. 🙂

Tobias had created a number of sequences in Vixen. Sadly, there hadn’t been any time to test them with the wires attached, and efforts to map out which wires were on which channels just weren’t feasible in the daylight. El wire just isn’t really bright. Still, it was pretty impressive, if much more randomly flashing than the animations Laurence had originally envisioned.

With everything in place, Robin and I left and walked a few blocks to the beginning of the parade and set up a couple camping chair Robin had packed. We had a pretty good view.

Just as the parade was starting and the first couple (of many) marching bands went by, my phone rang. The computer had crashed and the float wasn’t working. I ran back. It was a mac and Windows was running in a virtual machine, so at least the host OS was fine. Somehow Windows had crashed. Some fiddling, plugging in to the different ports and installing drivers fixed the problem.

I returned to Robin and as the parade went by, I was a little worried it wasn’t dark enough for the el wire. Luckily, Hand-Eye Supply was #82 in the parade, so they entered around 9:30 and it was quite a bit darker by them. It still wasn’t nearly as bright, but the lights did flash and fade in lots of patterns.

With so much coming together so quickly in just a few weeks, with all those wires connected within hours of the parade, I was pretty amazed it worked. Then today, Mykle emailed the KGW story that Hand-Eye Supply’s float won the 1st place award!! 🙂

 

 

 

RGB Lights for Mykle’s Lightbar

Addressable LEDs before it was cool…

In January 2011, Mykle Hansen put out a call for LED help for his Lightbar event.  I made this 3W LED board:

It’s incredibly bright.

Here it’s set to color pink (#FF20FF).

Mykle wrote more about the lights and using them at Lightbar. This blog entry is mostly about the technical details and design files. Read on for details…

This little project was inspired by Mykle’s Lightbar message on December 2. Well, probably intending to help prior years was a factor. Anyway, here’s that message:

Subject: [dorkbotpdx-blabber] LIGHTBAR cometh … LED help?

hi dorky people!

to any of you who remember LIGHTBAR from two years ago, or heard about it, i’d like to announce that LIGHTBAR 2011 is in the planning stages for this February.

LIGHTBAR is a Seasonal Affective Disorder (SAD) treatment center that appears intermittently in the month of February to bring inspiration, fresh air and wide spectrum light to the people of Portland.

This year I’m working on a Mobile LIGHTBAR system — a folding portable structure. But there’s some tricky parts I’m trying to overcome regarding the light itself.

For one: we’re going to be generator powered at best, so I’m investigating low-power lighting options. LEDs were not really wide-spectrum last time i checked, but maybe they’ve gotten better? Can anybody suggest types of LED lighting wider than the standard white and RGB varieties we’ve had bouncing around since 2005? I’m just not up on the latest LED fashions, I guess.

For two: I’m looking to rent or borrow a portable gas generator during the month of February. I’m asking everybody, yourselves included. I will treat it like a baby.

For three: My Mobile LIGHTBAR will have a folding skin, and I’d really like to integrate some kind of LED lighting system directly in the fabric, or else on some kind of net that easily hangs between the skin and the frame. this would be your standard controlling-a-bunch-of-LEDs project, but it has to be designed for durability, ease of repair, and fairly long runs of cable. If it was all RGB LEDs and they were independently addressable, that would be even better. Probably I’d be talking about something in the range of 100 – 200 LEDs, of 1 watt or less. (roughly!) Picture trying to spread those evenly across a 20′ diameter hemisphere, with the power & control system located somewhere on the edge.

I’ve thought about doing this with the BlinkM units, since they’re bus-addressable, but I feel like with this many units it might be cheaper to have something custom-fabbed. on the other hand, time is tight. i’d be thrilled if i could find system already designed to do exactly this.

and/or, does anybody in Dorkbot feel like taking this on as their own project? i think i could find some budget …

-m-

So, I started looking at some RGB LED specs. I pretty quickly found that the lower power LEDs, like the one on BlinkM, aren’t specified in Lumens (total light output), or if they are, the Lumens per Watt aren’t great.

After comparing lots of LEDs, I finally ended up with ASMT-MT00, which is in the 30-some Lumen/Watt range. It’s not cheap (about $10 to $15 in small qty), but it really works!

Here’s a close-up of the LED.

Today many more high power LEDs are available, some from Chinese sellers with questionable specs, but so cheap they’re hard to pass up!  Back in 2011, this seemed like the best option.

Mykle wanted to keep the cost low. In fact, he wanted to use cheaper LEDs… But this was my little weekend project-on-a-whim, and I wanted 100+ lumens! I also really wanted to make it run on 12 volts and have very efficient conversion and tolerate some voltage drop without changing the LED brightness, and I wanted RS485 communication so the signals can run a long distance (unlike BlinkM). This design does all that. In the end, it worked really well for Lightbar… so well that Mykle is building 18 more boards!

Pretty much on a whim, I ordered a few ASMT-MT00’s and other parts, and came up with a somewhat unconventional design.

IC manufacturers generally recommend using 3 of their LED drivers for RGB LEDs, one for each color. Of course, they love to sell 3 specialized chips, which aren’t cheap! Instead, I decided to try using only 1 special power supply chip, and the LM3407 from National Semiconductor looked like one of the most economical (cheapest) choices. And I was going to use only 1 instead of 3.

The basic idea was run all 3 LEDs in series. The ASMT-MT00 nicely provides each LED separately on 6 pins, instead of common anode or common cathode, which makes this possible.

The LM3407 can operate without any output capacitor. It is a constant current afterall. Normally a 22 uH inductor would be recommended. But I decided to increase it to 100 uH (the datasheet is light on details of stability in continuous vs discontinuous mode, but it seemed like continuous conduction buck mode would work). The LM3407 datasheet mentions being able to omit the output cap, with increased variance in output. Since I wasn’t going to have any output cap, I wanted the current to be better regulated, and upsizing the inductance is the way to do it.

The reason to omit the output capacitor is because I decided to change the color by diverting the current around each LED. Red is about 2 volts, and blue and green about about 3.5 volts. But when shorted by a PNP transistor, the voltage suddenly changes to about 0.5 volts. Better transistors would be less than 0.5, but I used cheap 2907’s.

Since the PNP transistors basically “float” at whatever voltage the power supply and drop on other LEDs or transistors happen to make, I used 3904 NPNs so a microcontroller can turn on and off their base current. When the processor drives 3.3 volts, about 2.6 volts is driven onto the 220 ohm resistor on the emitter, or about 12 mA in the 220 ohm resistor. That 12 mA comes mostly through the collector (which doesn’t care what it’s voltage happens to be when used in linear mode), which pulls the current from the floating PNP transistor base.

Yes, this is a pretty unusual transistor circuit… and I wasn’t completely sure if it’d work, but this whole thing was just a whim. I spend 2 days on it, the first one reading about the LEDs, LM3407 (and lots of other chips), and thinking about that circuit. The second day, I drew up the circuit board. I knew the LED gets hot, and so would the LM3407 and maybe the transistors too? I just drew some copper planes and thermal vias, and a big pad for a small heatsink (leftover from another old project). No prototype, no simulation, no real analysis… just a lot of guesswork and hunches, and at the end of the second day I sent off the files to Laen’s PCB Order (which is now OSH Park).

Here are the PCB files.

I never drew any schematic for the rest, but it’s just a ATTINY2313 chip to control everything. There’s 4 PWM signals, 3 connected to the transistors, and the 4th to the “DIM” control pin on the LM3407, so it can shut off when none of the LEDs need to be on. There’s also a RS485 interface chip and a few other necessary parts, but nothing really special.

Here is a full parts list:

qty  part number        part description                        sources
---  -----------        ----------------                        -------
1  ASMT-MT00-00001      RGB LED, 3W                             mouser, digikey
1  LM3407MYCT-ND        LED driver chip, 350 mA                 digikey
1  ADM3493ARZ-ND        RS485 chip, 3V                          digikey
1  556-ATTINY2313V10SU  ATTINY2313, SOIC-20 ("20SU" is ok)      mouser, digikey, avnet
1  296-26120-ND         LP2950 3.3V TO-92                       digikey
3                       MMBT3904, NPN transistor                digikey
3  771-PMST2907A115     PMST2907A, PNP transistor               digikey
1  B130-FDICT-ND        Diode, Schottky, B130, SMA              digikey
1  445-1208-1-ND        Inductor, 100 uH, 500 mA, 7mm           digikey
1  535-10211-1-ND       Crystal, 7.3728 MHz                     digikey
2                       Capacitor, 33pF, 603                    digikey
3                       Capacitor, 1uF, 16V, X7R, 603           digikey
1  490-5523-1-ND        Capacitor, 10uF, 25V, X5R, 805          digikey
1  311-.56SCT-ND        Resistor, 0.56, 1%, 805                 digikey (have 47 more)
2                       Resistor, 47K, 603                      digikey
3                       Resistor, 220, 603                      digikey
2                       Terminal block, 4 pin
1                       Header, 3x2, 0.1 inch (AVR prog)        (cut from 20x2 strip)
1  532-507302B00        Heatsink                                mouser
1                       Screw, 4-40, 1/4 inch
1                       Nut, 4-40
1                       Lock Washer, #4
1                       PCB                                     dorkbot

If anyone actually builds more boards (Mykle is building 18 more), here’s a parts placement diagram:

I pretty much set this thing aside and forgot about it, until the boards arrived a few weeks later. I set them aside for a few days, but the Dorkbot Monday meetup was the motivation I needed to get them actually working!

Then I spent one late night session Sunday night building and testing the hardware. Amazingly, the LM3407 chip worked great. I was worried the current regulation might respond too slowly when the output voltage suddenly changes by 3 or 6 or 8 volts! But it works great (at least without any output capacitor). It is designed by be PWM controlled by the DIM pin… but there weren’t any specs about how it’d respond to the ‘LED voltage” suddenly changing. I actually spent a couple hours with an oscilloscope and waveforms driving onto the transistors to make sure it really worked.

The other thing I tested and verified, is the switching power supply really does efficiently convert the power and adjust as the color changes. Even though the current is still “on”, when 2 of the lights are off, the voltage is only 0.5 volts (the cheap 2907 can’t get it any lower). Because power is voltage * current, the input current really does go down even though the output current stays the same, because the output voltage changed, and the switcher is pretty efficient. It really does work well that way. The switcher also does a great job of making exactly the same output, even if the input drops to 10 volts instead of 12.

About mid-morning Monday, with the Dorkbot meetup looming only hours away, but the hardware pretty well tested, I started working on the software side.

One confession I need to make is the ISP header was routed for the usual pinout with the header on the “top” side, but I soldered it to the “bottom” side (the side with the heatsink). Fortunately, I had a Teensy with ArduinoISP sitting on my desk, so it was pretty easy to just reverse the pinout to match. But if anyone else builds this little board and tries to use an off-the-shelf AVR ISP programmer, well, either solder the header to the LED side, or plan on wiring up a little adaptor to reverse the pinout.

In about an hour, I banged out this extremely simple code to run on the ATTINY2313 chip.

It listens for 8 character ASCII commands at 115200 baud. The input is hex, where the first byte is the board’s address, and the next 3 bytes are the RGB color. Any non-hex byte causes it to discard any data and begin listening for a new comment. Normally, sending a byte like “:” before a command, or pressing Enter after each command is a good idea. Here’s a few commands:

01FFFFFF Board #1, White
030000FF Board #3, Blue
02000000 Board #2, Off

Each board needs to have its address hard-coded. The makefile runs AVRDUDE automatically, so this isn’t very difficult.

Mykle has already added some new features to the code, like a broadcast address. I don’t have his latest code, but he’s planning to set up a CVS (or similar) server for the code. Hopefully he’ll post a reply below with a link.

The code could do a lot of things. The address bytes could be stored in EEPROM, instead of hard-coded. The protocol could be extended, or features like BlinkM could be added. Even DMX should, in theory, be possible.

I spent about 1 hour on the code. Much of that was making the PWM polarities correct.

With a few extra hours to spare before Dorkbot that Monday evening, I did some fiddling to make the lights work with Puredata. All 3 boards I made were working well that night.

I must confess, I’m not very experienced with Puredata. But quite a Dorkbot regulars are. Jason, Brian and others hacked on the Pd stuff and made the LEDs blink and fade. Here’s the Puredata Code, both my original attempts, and the end result of hacking on the code during 1 evening at Backspace.

The evening, Mykle took home the 3 boards, and a RS-485 converter I had (left over from other projects). They were used at Lightbar, and I made it out there one of the evenings. Good times.

Mykle is building 18 more lights, and plans to do fun things with the software.

I’m not planning to do much more with this, but I wanted to get this blog post written, so the info, and all the available design files and code would be posted publically. If you, dear reader, build these or use the ideas or info for another project, please post a comment below.

Enjoy!

 

This article was originally published on the DorkbotPDX website, on March 22, 2013.  In late 2018, DorkbotPDX removed its blog section.  An archive of the original article is still available on the Internet Archive.  I am republishing this article here, in the hope it may continue to be found.  But today, many awesome addressable LED products exist on the market, so this sort of project probably doesn’t make good economic sense compared to just buying a ready-made LED strip.

Arduino Pluggable Discovery

Arduino 1.8.9 has a new Pluggable Discovery feature, which began as a contribution from Teensy.  Ports can now be customized to support any protocol.

Already Omlzo is using Pluggable Discovery with CAN bus.

In this article, I’ll dive into the details needed to use Pluggable Discovery.  But first…

A Brief History

Since the first Arduino software in 2005, the main way to upload code to boards has been by serial ports.  In 2008, support for in-circuit programmer hardware was added, where you select a type of programmer  rather than a port.  In 2013, port detection and selection in the Ports menu was expanded to include network ports for Arduino Yun.  Around that time, Arduino also became highly configurable by recipes in platform.txt, based on a major contribution from Mark Sproul & Rick Anderson.   But until now, Arduino has supported detecting only 2 types of ports, either serial or network (using Yun’s specific protocol), with the only way to customize being dedicated programmer hardware.  Protocols other than serial & Yun’s network just weren’t supported for the Ports menu.

Teensy has used HID protocol, not Serial, for code uploading since its launch in 2008.  Using Teensy with Arduino was somewhat awkward.  When running a program implementing USB Serial, Teensy would appear in Arduino’s list of serial ports.  But with HID or other non-serial protocols, no port would be shown.  Teensyduino’s upload process could automatically detect Teensy in those modes, so uploading would “just work” even though the ports menu indicated no ports available.  When things went wrong, like this infamous Windows 7 driver bug, lack of reliable ports display made confusing situations hard to understand.

In early 2017, I started work to improve how Teensyduino integrates with Arduino.  A dedicated “teensy_ports” utility watches for Teensy’s USB devices to be added & removed.  Inside the Arduino IDE, I added a 3rd type of port to the DiscoveryManager class, using this utility’s info.  Finally, Teensy could be seen in the Ports menu even with running in a non-Serial mode.  You could choose exactly which board to use for upload, rather than hoping the automatic detection would find the right one.

In a June 2018 conversation with Massimo Banzi, Cristian Maglie and other Arduino developers, it was decided that I would contribute this code to Arduino.  A flexible JSON format would replace the original single-line text, so anyone could use it, and Arduino can adapt the format in the future.  After a lengthy process, where Cristian rewrote and greatly improved the JSON parsing, in March 2019 Arduino 1.8.9 was finally released with this new “Pluggable Discovery” feature.

JSON Data Format

The first step to using Pluggable Discovery is to write a “discoverer” utility which sends information to the Arduino IDE as your board is connected and disconnected.  Data is sent to Arduino on stdout, and Arduino may send you commands on stdin.

Here is a sample of the JSON data “teensy_ports” sends to Arduino 1.8.9 when running on Linux.

{
  "eventType": "add",
  "port": {
    "address": "/sys/devices/pci0000:00/0000:00:14.0/usb4/4-14/4-14.1/4-14.1.4",
    "protocol": "Teensy",
    "protocolLabel": "Teensy Ports",
    "boardName": "Teensy 3.6",
    "label": "/dev/hidraw5 Audio",
    "identificationPrefs": {
    },
    "prefs": {
      "vendorId": "16C0",
      "productId": "04D2",
      "serialNumber": "0"
    },
    "online": "true"
  }
}

Here is a quick attempt to document these fields.  Please understand these fields may change meaning, or others may be added by future Arduino releases.  Hopefully in the future Arduino will add official documentation for this JSON format.

  • eventType: Either “add” when a device is detected and Arduino should begin showing it in the Ports menu, or “remove” when disconnected and the Ports menu should no longer show it.  If information changes, or more information becomes available, multiple “add” messages may be sent to cause Arduino to update the Ports menu.  The eventType “error” is also supported.  See Discoverer Commands below for details.
  • port: A container for all of the information about the port.
  • address: A unique identifier for this port.  The address is not shows in the Ports menu, but does appear in the status bar on the bottom of the Arduino IDE windows when the port has been selected.  The address is the primary info you would give to your uploader utility.  See “Integrating With Your Uploader” below for details.
  • protocol: A unique (or at least distinctive) name for the communication protocol the port uses.  Currently Arduino 1.8.9 ignores this field, unless it is “serial” or “network”.  This name can be passed to your uploader utility.
  • protocolLabel: The name of your type of port, as shown in the title of a sub-section of the Ports menu.  Currently there is no way to adapt this field to different languages.  This info can also be passed to your uploader utility, though typically the “protocol” field would be used rather than this name meant for display to the user.
  • boardName: The name of the board.  This should probably match one of the names you define in boards.txt, though Arduino 1.8.9 does not currently enforce any requirements.
  • label: The human readable name for the port, to be shown as a selectable item in the Ports menu.
  • identificationPrefs: Arduino 1.8.9 does not make any use of this field.
  • prefs: This is meant to collect info about the port, such as the info shown by “Get Board Info”.  However, Arduino 1.8.9 does not make use of this field for non-serial ports.  Hopefully future versions will fix this.
  • online: While not used by Arduino 1.8.9 for non-serial ports, this should normally be “true” when eventType is “add” and “false” when eventType is “remove”.  With serial ports, the port’s online status can be momentarily false when Arduino is attempting to send a command to the board to automatically reboot into its uploading or bootloader mode.

When a port should be deleted, only the eventType and address fields are required.  Here is a sample of the JSON remove message teensy_ports transmits.

{
  "eventType": "remove",
  "port": {
    "address": "/sys/devices/pci0000:00/0000:00:14.0/usb4/4-14/4-14.1/4-14.1.4",
    "online": "false"
  }
}

Like all programs which print to stdout, buffering may exist between your output and Arduino’s reception.  Composing the entire JSON message in a buffer, then using a single write and flush to stdout is the most efficient way.  Arduino is using the Jackson library to parse your JSON messages, so sending piecemeal, with or without newlines or other optional white space should also work.

Discoverer Commands

The Arduino IDE will also send your discoverer commands on its stdin stream.  These are not JSON.  They are plain text commands, terminated by a single newline character.

  • START_SYNC – Begin running in sync mode, where your program transmits JSON messages automatically as the device change events occur.
  • START – Begin running in polled mode, where Arduino will send a “LIST” command at regular intervals.
  • LIST – In polled mode, this command is meant to prompt your program to scan for changes.
  • STOP – Stop running.

Future versions of Arduino may behave differently, so please understand the following behavior is specific to version 1.8.9.

When Arduino runs your discoverer, it will send a single START_SYNC command.  If you do not need polled mode, no response is needed or expected.  Your program simply transmits JSON messages as it detects ports, starting with “add” eventType messages all the ports currently available, and then more “add” or “remove” messages as available ports change.

If you require polling mode, you would transmit this JSON message.

{
  "eventType": "error",
  "message": "START_SYNC not supported"
}

Upon receiving this message, Arduino should transmit “START” and then send “LIST” at regular intervals.  If your discoverer is unable to detect hardware changes as they occur, you can design your code to wait for “LIST” and then check whether ports have changed.

With polling, typically you would need to design your discoverer to keep in memory a list of the ports it has previously transmitted to Arduino.  When you poll which ports are actually available, your discoverer is responsible for detecting when any port you have previously transmitted an “add” eventType is no longer present.  You must transmit the “remove” eventType, to cause the Arduino IDE to no longer offer that port to users in the Ports menu.

A list of previously detected ports can also help you avoid repeatedly sending the same info as your discoverer checks which ports currently exist.  But this is not required.  As long as the “address” field remains the same, Arduino Pluggable Discovery treats a redundant “add” eventType as a request to update the port’s info.  Sending the same info repeatedly is inefficient, but harmless.

Polling mode may not be working properly in Arduino 1.8.9.  Most testing was done with sync mode.

Arduino 1.8.9 transmits STOP only when the user closes the entire IDE, just before your program is terminated.  There is no guarantee your discoverer will continue running long enough to actually receive the STOP message.

Future Arduino software may send START_SYNC, START and STOP at different times, but with 1.8.9 the start messages are used only as the Arduino IDE starts up, and STOP is sent only when the user quits the software.

Running Your Discoverer

Like everything else customizable in modern Arduino, you create a recipe in your platform.txt file which tells Arduino to run you discoverer.  Here is a recipe for “teensy_ports”.

## Teensy Ports Discovery (Arduino 1.8.9)
discovery.teensy.pattern="{runtime.ide.path}/hardware/tools/teensy_ports" -J2

This recipe assumes the teensy_ports utility is installed in the hardware folder, inside the Arduino software.  Because the recipe starts with “discovery”, Arduino 1.8.9 detects it is a command for a pluggable discovery program.  It will be run as Arduino starts up.  Use of {runtime.ide.path} only works if your discover is copied to a locating inside Arduino’s folder.

The “-J2” is parameter given to “teensy_ports”, the same as if you had typed “./teensy_ports -J2” on the command line.  While unlikely to be needed, you can build almost any command line your discoverer might need.  In this case, the JSON format changed during development, so “-J2” tells teensy_ports with JSON dialect to output.

If your board is installed by Arduino’s Boards Manager, your discover is meant to be defined and installed as a tool and referenced with {runtime.tools.TOOLNAME.path}.  See this comment from Cristian for more detail.

Integrating With Your Uploader

Now that your discover can find your board’s custom port, and the user can select it in the Ports menu, you need a way to actually pass the detected info to your board’s uploader program.

Fortunately this part is easy.  The macro {serial.port} in your uploader recipe in platform.txt will be replaced by whatever text your discoverer provided in the JSON “address” field.

tools.yourtoolname.upload.pattern="{runtime.hardware.path}/upload_program_name" "{build.path}/{build.project_name}" "{serial.port}"

Yes, it’s still called “serial.port” in these substitution patterns, even though we can now (theoretically) extend the Arduino IDE any sort of protocol.

While your uploader probably only needs the unique address field and the pathname to find the code Arduino compiled, you can also pass some of the other JSON fields to your uploader.  Here is the recipe Teensy is currently using.

tools.teensyloader.upload.pattern="{cmd.path}/teensy_post_compile" "-file={build.project_name}" "-path={build.path}" "-tools={cmd.path}" "-board={build.board}" -reboot "-port={serial.port}" "-portlabel={serial.port.label}" "-portprotocol={serial.port.protocol}"

Hopefully Arduino will eventually document the mapping from JSON fields to recipe substitution names.  These were found by reading the Java source code and some experimentation.

Troubleshooting

What could possibly go wrong?!

Arduino 1.8.9 has a fair amount of debugging code built in to help you see how Arduino is running your discoverer, and what it’s receiving.  To enable the debug output, add this line to your preferences.txt file.

discovery.debug=true

If you’re not sure where your preferences.txt file is located, click File > Preferences and look at the info in the button part of the Preferences dialog.

Minor Issues In Arduino 1.8.9

Polling mode may not work.

The substitution macro {runtime.hardware.path} very often used in platform.txt recipes is not yet supported.  Teensyduino adds a patch to Arduino 1.8.9 to support this in discovery recipes.  If you prefer {runtime.hardware.path}, installing Teensyduino may be a short-term solution.  Hopefully this patch will be merged into future Arduino versions.

Other substitution issues may exist in Arduino 1.8.9.  Pluggable discovery is brand new.

Pluggable Discovery does not yet exist in Arduino’s Command Line Interface software.  Using Pluggable Discovery today means your board’s package can not work with the CLI.  Cristian started work on Pluggable Discovery for CLI months ago, but since January there appears to be no progress.  Hopefully as more people use Pluggable Discovery to support non-Serial protocols, we’ll see progress on bringing it to CLI as well.

Serial Monitor

Of course the other key Arduino IDE feature missing to truly support boards with any type of port is the serial monitor window.  And also the serial plotter.

Teensyduino currently adds several patches to the Arduino IDE to install a customized serial monitor.  It communicates, via stdin/stdout/stderr with a “teensy_serialmon” utility program.  Hopefully in the future, these patches can eventually be contributed to Arduino as as “Pluggable Serial Monitor” feature which complements Pluggable Discovery.

But at least for now, if you are interested in extending the Arduino IDE to work with boards using completely different communication protocols, hopefully the Pluggable Discovery contribution and this article can help.