Posted on

Brady’s Scrolling LED Sign

How It Began

About a year ago, my friend Brady Pamplin W5LH was teaching a class at the Dallas Makerspace. Brady teaches a variety of Arduino and microcontroller-related classes. See his web site for a list of what’s available. This class was about how to use NeoPixel LED strips with Arduino. NeoPixels are addressable RGB (red, green and blue) LED chips. Most importantly, it is not hard to chain them together. He liked an article he read by Josh Levine about how to make a “Times Square” style scrolling sign. Josh’s article suggested you could make one as large as you wanted for around $15 a foot. Brady built one of these signs, and I helped him make a few small improvements.

A First Prototype

Brady's prototype Scrolling LED Sign
Brady’s prototype Scrolling LED Sign. Click for video.

Brady then quickly built his own prototype to show off the idea to his students. The main problem was that he would give away the individual LED strips to students after the class. Consequently, the sign was often out of operation until he could make more strips. He posted a short video of the sign in operation on his web site, along with its Arduino sketch.

Dale Gets Involved

Brady’s sign worked splendidly and was a very attention-getting item, indeed. The only thing he wanted to add was the ability to display static (i.e., non-scrolling) text. I volunteered to look at the Arduino sketch and possibly add some functions to display the static text.

Once I looked at the original sketch from Josh’s web site, I was immediately impressed with two aspects of the design. First, the software does not use a memory-hungry frame buffer. Instead, it decodes the bit patterns of the individual letters and symbols on the fly. This allows very long messages to be stored in the flash memory of the Arduino and not be limited to the relatively small amount of static RAM. Second, the design pumps out seven bitstreams in parallel using highly-optimzed assembler code. Each bitstream goes to the individual LED strips via separate GPIO output pins. Thus the performance-constrained Arduino can crank out fairly high frame rates. More advanced microcontrollers use DMA (direct memory access) peripherals to do the same trick.

Tweaking the Code

I added a new function, showText(), that specified the text to display and the color to use. It simply calls an existing function, sendString(), once instead of repeatedly in a loop which was how Josh achieved the scrolling action. The cli() function* disables hardware interrupts for the timing-critical section of code used to update the NeoPixels. The sei() function* re-enables the hardware interrupts afterwards.

* actually they are macros for the AVR assembly instructions CLI (clear global interrupt enable bit) and SEI (set global interrupt enable bit).

void showText(const char* p, uint8_t red, uint8_t green, uint8_t blue) {
   cli();
   sendString(p, 0, red, green, blue);
   sei();
}

This function would let you display a non-scrolling message for one second (1,000 milliseconds) by calling it like this:

showText("Sample", 0x40, 0x00, 0x00); delay(1000); // red

The problem with this approach is that it used up precious static RAM; one byte for each character in the passed string. Then I cooked up another version of the same function. I did so using C++’s function overloading feature. This used either strings that were declared as const (constant) or specified using the FlashStringHelper modifier.

 void showText(const __FlashStringHelper* p, uint8_t red, uint8_t green, uint8_t blue) { 
cli();
PGM_P p1 = reinterpret_cast(p);
while (1) {
unsigned char c = pgm_read_byte(p1++);
if (c == 0) break;
sendChar(c, 0, red, green, blue);
}
sei();
}

You can have multiple versions of the same function, in this case showText(), as long as they take different parameters. As you can see, I had to add some trickery in the code to get it to take a string straight out of the flash memory. Here are some examples of how it can be used:

static char test[] = "-TEST-";
showText(test, 0x40, 0x00, 0x00); delay(1000); // red only
showText(F("RED---"), 0x40, 0x00, 0x00); delay(1000); // red

A More Robust Hardware Design

Brady built the sign with a cardboard (ahem, corrugated paperboard) substrate and various kinds of tape. It used an Arduino Nano (Brady’s choice for his Arduino classes) and a solderless breadboard. There were various wires going hither & thither. While this certainly worked and was spectacularly eye-catching, it was not road-worthy. It really needed to be, because by now Brady was taking the sign to other events.

I suggested to Brady a partial solution to the issue: a custom printed circuit board (PCB) to hold everything together. This would eliminate a large number of vulnerable electrical connections (in the form of breadboard jumpers) and make it a little easier to transport the sign to various events. The idea sort of sat there for a month or two. Brady would occasionally ask how it was coming, and I would typically say it would be ready “in three weeks”. Finally, on 2 October 2019, I added this project to my “official” list of Things to Do.

Gathering Customer Requirements

Brady and I got together on 8 October 2019 to discuss and finalize a definitive list of requirements for the project. Over some tacos, we set out the major check-list items for the project:

  1. Arduino Nano based system, socketed
  2. +5V 4A 2.1mm power supply
  3. Right-angle 3 pin female headers for LED strips
  4. Square pixel aspect ratio
  5. 2 non-dedicated potentiometers with knobs for adjustments
  6. 4 mounting holes
  7. Leave USB cable path clear
  8. LED connectors on right-hand side of PCB
  9. Check data bit order (lowest row is D0/TX)

Proof of Concept

A preliminary schematic and PCB layout in EAGLE 7.7.0 had already been made. Making sure the design met all the customer requirements, I uploaded the design to OSH Park and got this nice board rendering. This I showed to Brady and he said it looked like it would work.

Schematic Diagram

Here is the schematic diagram of the circuit. Click the image to download or view the diagram as a PDF.

Brady's Scrolling LED Sign schematic
Brady’s Scrolling LED Sign schematic

Customer Green Light

Brady's Scrolling LED Sign PCB assembled prototype
Brady’s Scrolling LED Sign PCB assembled prototype

Since everything looked good so far, on 16 October 2019 I ordered three prototype PCBs from my favorite short-run PCB fabricator, OSH Park. On 31 October 2019, the prototype boards arrived. I built one and gave it to Brady for testing. I didn’t have enough LED strips on hand to test it completely here in the lab.

On 21 November 2019, I received the remaining parts I needed to finish the second prototype PCB that I had promised Brady. The board was delivered on 26 November 2019.

A Sign of My Very Own

Animated GIF of glowy LED strip
Animated GIF of glowy LED strip

With my one remaining prototype PCB in hand, I decided to build my own Scrolling LED Sign. I ordered a reel of NeoPixel-compatible WS2812B LEDs (5 meters, 60 LEDs per meter, 300 LEDs total) from Amazon [product link]. This was on 28 January 2020. The very next day, my order arrived. Gotta love Amazon Prime for this kind of stuff*. It even came with a “tester” device that drives the whole strip in a variety of patterns.

Since the nice, round number 300 does not divide evenly by 7, I cut up the five meter strip into six strips of 43 LEDs with one strip left over with only 42 LEDs. To plug into the sockets on the driver board, I soldered three-pin headers to the input ends of the seven strips.

*I very rarely use Amazon Prime, mostly due to concerns about sustainability, but in some situations the ultra-mega-convenience wins over my love of the Earth and its future inhabitants.

Even More Testing

Animated GIF of Brady's prototype Scrolling LED Sign
Animated GIF of Brady’s Dale’s prototype Scrolling LED Sign

Laying out the loose strips on my work table, I was able to upload a slightly modified sketch and test the sign as a whole. I adjusted the number of PIXELS to 43, which was larger than Brady’s original sign.

Mounting to an Artisan Substrate

Attaching the adhesive-backed LED strips to a large panel of copper-clad PCB material I had in the lab, I was able to connect everything together. I could have scrubbed the copper to get rid of the fingerprints, etc., but I decided to leave it as it was and in fact invite oxidation, which should result in a dramatic and lovely patina in time. Since a solid sheet of copper is that very last thing you want to rest your circuits on, I put some famous blue tape under the driver board to insulate it a bit.

Dale's Scrolling LED Sign
Dale’s Scrolling LED Sign

In Summary

Transitioning your friends to “customers” doesn’t always go well, in my experience. This experience turned out to be one of the delightful exceptions. Brady seems to be quite happy with his new signs, and I know I am. He is planning on installing one of his signs at Tanner Electronics to advertise his classes across the street at the Dallas Makerspace.

Additionally, I have created a new Scrolling LED Sign kit and added it to my web store. It’s also available at Tanner’s and BG Micro. Right now, you still need to bring your own Arduino Nano, LED strips and regulated +5VDC power supply to complete the build. I am working on sourcing all the bits to be able to offer a “complete” kit for this kind of sign. I’ll let you know when that’s available.

Posted on

Dale’s Theme for 2020 is “Writing”

Pick a Theme

Instead of a “New Year’s Resolution”, CGP Grey suggests picking a broader “theme” for the year:

This year’s theme for me is “Writing”. If you asked me what I do for a living, I’d tell you with a straight face that I was a writer. Your reaction is almost always either a smile, a twinkle in your eye or, at minimum, a raised eyebrow. I know you’re deciding between Ernest Hemingway, J.K. Rowling, Isaac Asimov or Steven King, but then I stop you by saying, “No, no that kind of writer.” The twinkle fades. I then go on to explain that I am a technical writer, dealing in computers, electronics, robots and such. That’s usually the end of the conversation about what I do for a living.

But the last several years have seen no time for proper “writing”, per se. I’ve been much too busy teaching, designing and selling kits on my web site, travelling and taking naps to get any serious writing done. After taking some time to think about these things in more detail, I’ve decided to focus more on writing this year. To do this, I’ve set myself some measurable goals:

“Smart” Writing Goals for 2020

  • A minimum of one book a year for five years
  • A minimum of two magazine articles per year, also for the next five years
  • One major blog post (or mini-series), ~10,000 words, 3-4 posts, per month for twelve months
  • One minor blog post (3-5 paragraphs) per week for 52 weeks

Can you see what I’ve done? I’m accomplishing one of my goals (the last one in the list) right now by telling you this. The good thing about these goals is that they are specific, measurable, achievable, realistic and time-based (i.e., “smart” goals). At year end, I will be able to look back and see which of these goals were attainable. In any case, I get to write more, and that mostly means that I get to make time to write more, and those are both things that I enjoy doing.

Posted on Leave a comment

KI5SME, I’m a HAM

Chibi Dale is a serious writer

At the prompting of friend and inspiration Brady Pamplin W5LH, I sat for and passed both the Technician and General Class exams for amateur radio operator at HamCon last month. I now have limited privileges on limited frequencies. This has been something I have wanted to do since I was a Scout (they were called Boy Scouts in my time).

While I was originally issued a ‘systematic’ call sign of KI5FDS (kilo india five foxtrot delta sierra, aka “First Dale in Space”), I applied for and was granted a modification for what is known as a ‘vanity call sign’, which came in today. I can now get ‘Radio Operator’ license plates that say “KI5SME”, as well as participate in important disaster preparedness exercises such as Field Day.

A short dissection: The prefix “KI5” is the currently available code for new licensees in Region 5 (Arkansas, Louisiana, Mississippi, New Mexico, Oklahoma and Texas). The suffix “SME” could stand for “subject matter expert”, but it really stands for “someday, maybe Extra”, referring to the “Amateur Extra” class that is the next higher level after General. The official definitions are available at the FCC web site.

Posted on Leave a comment

Why the Yellow Banner? This is Why:

The more observant amongst you may have noted a striking, yellow banner emblazoned across the top of each and every one of the pages of this, your favorite web destination. What could be behind such a serious and dire notification? Rest assured, nothing was amiss. I simply wanted to let you know that I would not be able to ship your orders until Monday, because I had slipped the leash, jumped on a plane and jetted to Seattle to help celebrate my granddaughter Olivia’s third birthday. Now I am returned, everything is as it was, orders are shipping as scheduled and I hope you agree with me that it was totally worth it.

Grandpa Dale helps Olivia celebrate her third birthday
Grandpa Dale helps Olivia celebrate her third birthday. Photo by Elizabeth Wheat.
Posted on Leave a comment

New Product: 12 LED circle

12LEDcircle

Today I’m happy to announce a new addition to my blinky LED kit line-up, the aptly-named “12 LED circle“, or 12LEDcircle for short. It’s a small, round PCB with 12 bright blue LEDs around the edge. It comes with a pre-programmed microcontroller that lights up the LEDs in various mesmerizing patterns. You can see a demo of the various blinky modes on my YouTube channel.

The assembly instructions, schematic and source code are all available as well.

Kits are in stock and ready to ship today for $12.95.  Check them out in our store!

Posted on 1 Comment

I Wrote Another Book – Building Your Own Electronics Lab

Building Your Own Electronics Lab
Building Your Own Electronics Lab

I wrote another book.  This time it’s about building your own electronics lab, titled Building Your Own Electronics Lab.  It gives the reader a gentle introduction to electricity and electronics and how to safely learn and play with them.  Basic tools and components are discussed and some simple starter projects are presented.  The main idea that I tried to put forward is that the electronics hobby is fun.  It’s also fun to share with others.

The softcover edition is available in my store! You can also find paperback and e-book versions on Amazon.com, or find it at your favorite bookseller using the ISBN 978-1430243861.

Posted on 3 Comments

Lux Spectralis 2 Now Available

I’ve updated the popular Lux Spectralis kit! The new Lux Spectrlais 2 kit uses three separate LEDs for the red, green and blue color channels. The circuit still does exactly the same thing (blinks multi-colored LEDs).  This will make it much easier to modify for custom color combinations.  Check out the Lux Spectralis 2 Kit in the store!

The new PCB is a little bit smaller than the previous version.  It uses electroless nickel immersion gold (ENIG) plating on all the electrical contacts, which has its own advantages, electrically, but I did it because it’s more beautiful and contrasts well with the black solder mask.

Other improvements:

I simplified the whole thing and reduced the component count.  This will make it easier to assemble.  You can download your own copy of the assembly instructions.

The kits still comes with a 3xAAA battery holder with a built-in power switch.  The lighting modes are identical to the previous version.  The price remains the same.

Lux Spectralis 2

Posted on 6 Comments

I Wrote a Book – Arduino Internals

Over the summer, I wrote a book about Arduino internals, called Arduino Internals. It is being published November 16, 2011 by Apress. It has a lot of detailed information about Arduinos as well as Atmel AVRs. There are several projects in the book that illustrate some of the topics. It’s a paperback book that runs to just over 350 pages. There’s also an “ebook” available in several popular formats.

You can buy your very own copy from our store! It’s also available from Amazon. You can also go to your favorite book seller and buy a copy. Just use the ISBN number 978-1430238829. To buy the ebook, go to the book’s page on the Apress web site, apress.com.
This was a very exciting project for me. It’s my first book. I hope you enjoy it.