Arduino Radar Speed Sign

For Halloween 2020, I decided to build a replica of a radar speed sign using an Arduino and an HB100 doppler radar module. This writeup is gonna be a bit fuzzy, since as usual, I decided to document the project a tasteful 8+ months after it was complete. Have fun reading my semi-coherent image and schematic dump!

The completed sign. It currently resides on the wall of my lab, and has been converted from battery power to a DC power supply for use as a static decoration.

How the Radar Do

The project uses an HB100 doppler radar module and a pre-amplifier circuit in order to convert movement of objects in the HB100’s field of view into a square wave that gets fed into the Arduino Nano. Radar makes everything sound fancy, but in this case it’s no more complicated than what you would find in one of those supermarket automatic doors that triggers when some leaves blow by. The HB100 transmits a 10.525GHz carrier signal, which is reflected off of a moving target (in the case of this project, a person walking across a room at close range). The return signal from the moving target is doppler-shifted, and is thus a higher (or lower) frequency than the carrier, depending on whether the target is moving towards or away from the transmitter. By mixing the transmitted 10.525GHz signal with the reflected signal, the HB100 produces a signal that is the difference of the two frequencies. Fortunately, for objects moving at non-relativistic speeds, this difference frequency is usually very chewable for even the dumbest of microcontrollers, as it’s usually in the range of a few Hertz.

Diagram of the guts of an HB100 radar module. The outgoing signal is broadcast from the Tx Antenna, and is mixed with the reflected signal coming into the Rx antenna. The difference frequency that results is piped out the IF pin to an external pre-amp circuit.

In order to get the difference frequency into a format that can be processed by a microcontroller, the signal passes through a two-stage preamp circuit which amplifies it from a lil squiggle into a rail-to-rail square wave. The pre-amp circuit isn’t that interesting, and is ripped straight from the datasheet. There are some capacitors in parallel with the feedback path in order to generate some poles that roll off the frequency response around 72Hz, stopping the pre-amp circuit from amplifying high-frequency noise that is beyond the range of interest. Also note the chunky (4.7uF) AC coupling caps between stages. These coupling caps are yuge because they need to have a low impedance at the frequencies of interest (<100Hz). If we look at the 12k resistor used for the IF load, and assume that the HB100 IF circuit has a characteristic impedance in the range of 12kOhms, we can see that a 4.7uF capacitor provides an impedance lower than the characteristic impedance all the way down to around 2.8Hz. Neat!

IF Amplifier schematic, as suggested by the HB100 datasheet. Redrawn by yours truly because blue. Also for labels to make things a lil clearer.
I guess I was looking at the HB100 output before the preamp or something lol. Vpp is only like 8mV. Needs amplification!
Breadboarding the preamp circuit.

Once the preamp circuit was working, it was pretty simple to stick the output straight onto one of the Arduino Nano’s digital inputs. Input interrupts were used to time the pulses and estimate the frequency of the signal, which can be converted into velocity using the doppler radar equation.

Cardboard Testbed(TM).

Bigass 7 Segment Display

From the beginning, the real pizazz for this costume was always going to be the giant LED 7-segment display. I’d been wanting to make one for a long time, for no particular reason other than whee LEDs shiny, and more LEDs = more shiny. There have been plenty of 7-segment display implementations with all kinds of hardware, from the WS2812B chips controlling segments with individual addressing to cool multiplexing schemes. However, my favorite approach has always been the tried and true SPI shift register configuration. Using two SPI shift registers (the good ol’ 74HC595), each digit is controlled by a single shift register, with a single segment responding to a single bit output from each shift register. In the past, I’ve used the 8th bit output to control a decimal point, but that wasn’t necessary for this particular project.

In order to make things easy and reasonably professional-looking, I designed a custom modular PCB containing 8 high-power amber LEDs. These hexagonal PCBs could interlock to form a 7-segment display digit, and contained the necessary current-limiting resistors, and switching transistors for turning the digit on and off. Solder pads at the interlocking edges of each PCB were used to share +12V and GND to the entire digit from any single powered segment. Additional solder pads on the edge of each segment connect to the gate of the switching MOSFETs, allowing a low-current enable signal from the shift register to control the segment of high-power LEDs. I should have added a series resistor to this gate network to protect the MOSFETs from ESD…in my late-night haste to assemble the costume, I managed to zap through the oxide layer on several MOSFETs with ESD, killing them. That caused a good amount of debugging headache! If I were to sell these segments or something, I would probably change the drive MOSFET to an NPN BJT with a base resistor for added robustness.

These boards are neat! Look at how they interlock with solder pads to share power and retain their shape!
I placed a lot of LEDs.

Putting Things Together!


Github Repository

Here’s a list of some of the parts that I used, in case people are looking! These are Amazon affiliate links (gotta make some of them Bezos Bucks).

Posted by jmcnelly, 15 comments

Idiot Bird

This bird is so dumb that it laid an egg on one (1) stick. We built it a tupperware out of wood, so watch it have kids now I guess.

Posted by jmcnelly, 7 comments

Self Checkout Stand Halloween Costume

Testing out the costume with my lovely brother.

Why did you make this cursed rectangle?

It’s a pretty iconic vignette of 21st century living: you’re checking out of the grocery store, and the cashier lines are long. You glance down the row of checkout stands, and the unoccupied self-checkout kiosk beckons from across the store, willing you to try it out just one more time. You have second thoughts, but are quickly entranced by the circa 2003 3D animations and a strip of paper that billows from that secondary receipt printer whose sole purpose is to print expired coupons for discount plumbing services.

You scan your first item, and then your second item. All seems well, but then the dance begins.


Place item in the bagging area.

You gently place your dozen eggs in on the bagging tray.

Unexpected item in the bagging area. Please remove the item before continuing.

You remove the eggs.

Please place item in the bagging area.

Hesitantly, you place the eggs in the bagging tray.

Unexpected item in the bagging area. Please remove the item before continuing.

Two minutes and thirty seconds later, you notice the coupon hunter who was behind you in line at the cashier’s stand leaving the store with her two dozen gallons of milk that she got paid $5.23 to take home.

Unexpected item in the bagging area. Please remove the item before continuing.

Someone is trying to help you now. It looks like they maybe they work here.

Please remove the item before continuing.

You’re in the parking lot now. You have no eggs. They were terribly sorry, but there was simply nothing they could do. Helpfully, your car is filled with milk and you have five copies of the same coupon to AJ’s Plumbing n’ Animal Control Inc, valid till last February.

Ok, that wasn’t helpful at all. Fine. HOW did you make this cursed rectangle?

Oh, sure! Here’s the parts list:

  • 1x Epson TM-T88V USB Thermal Receipt Printer (used)
  • 1x Raspberry Pi 3B+
  • 1x 7in Touchscreen + 3D printed case
  • 1x USB Barcode Scanner
  • 1x Anker Soundcore Bluetooth Speaker
  • 1x 3-level LED Stack Light
  • 1x 80W DC-DC Converter (12V 3A)
  • 1x 15W DC-DC Converter (5V 3A)
  • 1x Automotive Fuse + Fuse Holder (this was actually a REALLY good idea, because of the next thing)
  • 1x 4S 4000mAh Lipo Battery
  • 1 sheet of Plexiglass from Home Depot
  • Some one-way mirror window film (also from Home Depot)
  • Buncha 3D printed parts*
  • Buncha Coroplast + 3/16in Aluminum Pop Rivets*

*Buncha refers to the metric Buncha (not to be confused with the standard Bumcha which was deprecated in 1993)

Look! Pictures!

We are weird nerds or something and we want to know more! Tell us!


First, the simple mechanical and electrical stuff.

The entire machine runs on a 3S 4000mAh battery from some quadcopter builds I did a while back. This battery feeds into a fuse (important, I debated putting this in at all and it totally saved the whole costume from catching fire when a circuit board came unglued and shorted out the main power distribution board), and then into a power distribution board and a 40W DC-DC converter. The DC-DC converter is used to power a 12V rail that runs the stack lights, the receipt printer, and a smaller 5V DC-DC converter that runs the Raspberry Pi and USB peripherals. The stack lights are switched using a low-side drive circuit I put together using some 2N7000 small-signal MOSFETs. I had to buy an extra power supply brick for the receipt printer just so that I could cut the plug off of it, since the fine folks at Epson like their strange proprietary DC jack shapes.

The Raspberry Pi is interfaced with the 7in touchscreen over HDMI and USB, and the Anker Soundcore speaker is powered by its internal battery, and is connected to the Raspberry Pi using an aux cord. Interestingly (annoyingly), the speaker is “smart” and will stop listening to the signal on the aux cord and shut down if no sound is being transmitted. When a sound byte is sent to the speaker after some silence, it takes some time to “wake up” and can often clip the first half-second or so of the sound byte. This is very annoying if the speaker is being used for sound effects or voice lines! I managed to get around this issue by continuously playing a looping track of very, very quiet white noise from the Raspberry Pi, just loudly enough that the speaker would always stay “awake”.

The costume consists of two boxes shaped from Coroplast: a “checkout stand” block and a “bagging area” block. The bagging area is a simple box with an LED illuminated “Self Checkout” sign on top, and some plastic bags with corresponding plastic bag hangers. Above the plastic bag hangers, there is a plexiglass window with one-way mirror tint allowing the wearer to see outside the costume. The checkout stand has the meat of the system inside it, with the Raspberry Pi, electronics, touchscreen, receipt printer, barcode scanner, speaker, and stack light attached to its inside, front, and top. There are two one-way mirror plexiglass panels on the self-checkout stand, allowing the wearer to see out the costume and the USB barcode scanner to read items that are swiped over it.

The checkout stand can be interacted with from the touchscreen or by scanning barcodes on the scanner. Additional controls are available to the wearer of the costume or a nearby operator via a wireless USB keyboard. Keys on the keyboard are bound to various voice lines and actions, allowing scans to be faked and costume actions / voice lines to be commanded.

Now for the software!

The system is hacked together around a Raspberry Pi, since I figured that was the easiest way to run a complex multithreaded state machine that would also deal with USB devices and audio files. Everything is written in Python, with different threads that take care of flashing the lights, running the USB scanner and printer, drawing the GUI on the screen, and running the checkout stand’s internal state machine that allows users to checkout and print their receipt.

The GUI is made in Pygame, allowing easy capture of user touchscreen events, playing of sound clips, and drawing of on-screen text and buttons. The blissful part of this project was making every part of the GUI aggressively terrible, just like the real thing. I swear that once when I was in Safeway, I had to have an attendant enter their passcode to unjam the uncooperative kiosk I was using, and the kiosk cheerfully stated every number of their passcode out loud, just like it was a quantity of produce or a price. I happily included this helpful feature, among others, in my own rendition of the self checkout nightmare.

The sound files for the text-to-speech were painstakingly recorded and clipped from an online text-to-speech website that I found which had a voice that was pretty similar to what I had heard in grocery stores. I typed out every necessary number and digit combination, as well as the primary voice lines (“unexpected item in bagging area”), recorded them on my browser, then spent hours cutting them down to size using Audacity. With a bit of tweaking, they turned out all right (or at least, as terrible as the real thing)!

There is a random number generator buried in the state machine, and every additional item that a user scans in to their cart carries a small chance of entering the terrible “unexpected item in bagging area” loop. This feature really seemed to be most enjoyed by the parents we encountered on Halloween night. There were some other easter eggs that we enjoyed using to startle and delight various children throughout the night as well…

And here’s the rest of it! Was a very fun costume to build and play around with on Halloween with friends. 12/10 would recommend. All of the code is fully open source, and if anyone else would ever like to build a similar abomination, I would be more than happy to assist with design files and advice.

Github repo with code, etc.

Posted by jmcnelly, 0 comments

PIC Beeper

After learning about the PIC12F752 in a mechatronics class, I was tempted to use the cheap microcontroller to play music. The device has 1024 Bytes of program memory, but only 64 Bytes of flash, making storing a song in data memory very difficult. Instead, I hacked together a code generation program in Python that would read MIDI files and output the notes as a C program, which could reside entirely in program memory.

Even while storing notes in program memory, each PIC could only hold around 40 notes. I took this as an opportunity to create a chainable series of boards, each of which could only play a set portion of the song. Each board has input pins for power and the master reset pin on the microcontroller, and has output pins for the same functions. Powering one board in the stack provides power to all of the boards, and the first board in the stack boots up and asserts a LOW on its master reset output, thus disabling the subsequent boards. Once the first board is done playing, it asserts a HI on master reset, allowing the next board in the chain to play. When the next board is done, it asserts a HI on its master reset output, and the chain continues to play.

Early prototypes of the PIC beeper board were made on a CNC in my dorm room using 1-sided FR4 copper-clad boards.

An original prototype milled out of single-sided copper clad FR4.

I later moved to commercially produced PCBs for the final product (2-sided boards). In order to reduce the form factor of the board, I switched to a QFN package for the 12F752 and added a custom POGO programming header to interface with the PiCKit programmer. At some point in this process I also realized that the CR2032 battery didn’t have enough current to power some of the louder / lower resistance beepers I wanted to use, so I switched to a design with two AA batteries powering all of the beepers in a stack.

Closeup of the new board with its compact programming header.
A prototype board being programmed, with a Genuine Bodge (TM) visible on the left.

I purchased the final boards as a small panel with v-scoring, and used a solder paste stencil and my Controleo3 reflow oven for assembly. I used water wash solder paste, and covered the buzzers with Kapton tape to protect them during the water wash / ultrasonic cleaning process.

Once the boards were fully assembled, I fired up my code generator and programmed them in sequence with their corresponding portions of the song.

The assembled chain of beepers worked as intended! Some of the notes are a little bit scratchy or weirdly loud, but I think that’s attributed to them being close to the resonant frequency of the beeper or the PCB. The notes are synthesized by varying the period of a 50% duty cycle square wave, so there are lots of higher frequency harmonics, but it works in a pinch!

Posted by jmcnelly, 0 comments


Live stream
I decided to build a bird feeder with a live-streaming camera for my significant other’s birthday. It seems to work pretty well! The system is based on a Raspberry Pi Zero W running the Motion firmware, with an image mask and motion trigger set to activate when birds land on the feeder. Every night, a shell script runs the imagemagick utility to convert all images with the same minute time stamp into fun little combined gifs. This project is a work in progress–automatic image tweeting and imgur uploads should be coming soon! In the meantime, if anyone needs an absolutely massive number of tiny bird gifs, I’m happy to share!

Parts List


Posted by jmcnelly, 0 comments

3D Printer Enclosure Fan Controller


After building my 3D printer enclosure, I ran into the issue of my printer enclosure getting too warm. Temperatures during extended prints were climbing above 130 degrees Fahrenheit, which was causing my printer electronics to overheat, leading to extrusion issues and missed steps. I remedied this by propping the door open with a rag, but that removed the noise damping benefit of the enclosure. An overcomplicated but fun solution in the form of a PID fan controller was devised. This controller uses and Arduino nano to PWM control a logic-level N-channel MOSFET that feeds into a low-pass filter in order to control a 12V radial blower fan with a varying analog voltage. Bit-shifting in the Arduino Nano code takes advantage of the built-in timers in the Atmel Atmega 328p processor in order to generate PWM frequencies at 25kHz, which is outside the range of human hearing and thus less annoying. Initial attempts to control the fan using straight PWM without a low-pass filter proved to be unreliable, but the current setup with the low-pass filter has been running strong for over 6 months as of the writing of this post.


Parts List


Main menu
Config screen 1
Config screen 2
Controller and fan

Posted by jmcnelly, 0 comments

LED Trumpet


This is my second iteration of my LED trumpet.  The first iteration used an Arduino Nano, but I upgraded to a Teensy this time around for more processing power (gotta get all them FFT’s).  The system is powered by Lipo batteries (from my rc aircraft projects) feeding a Castle 10A SBEC that provides 5V to the Teensy and SK6812 individually addressable LEDs.  There’s an Adafruit microphone module buried inside the 3D printed electronics housing, allowing the LEDs to run an FFT pattern and volume-activated effects.  Three buttons on the side of the electronics housing allow the user to change modes (or play snake, in one of the modes), and a power switch allows the user to easily flick the system on or off with their thumb.  The top of the electronics housing has an LED voltmeter built in to allow the user to monitor the battery voltage of the trumpet.


Parts List

Posted by jmcnelly, 0 comments

Fire Alarm Pull Light Switch Cover

I got bored during finals and measured the fire alarm pull outside my dorm room.  Adding a slot to the back allowed me to fit it over my room’s existing light switches, and a dual-color print from PETG gave it a somewhat realistic look.  Shenanigans ensued.

Thingiverse Link

Posted by jmcnelly, 0 comments

Whacky Waving Flailing Inflatable Arm Tube Man!

Just finished building my Halloween costume for this year!  Two circular laundry hampers, 5 yards of green polyester, and a $10 sewing machine from Amazon make for a great time.


Posted by jmcnelly in Lol, Projects, 0 comments

Prusa i3 3D Printer Enclosure

This was a fun project from summer of 2017.  I built a Prusa i3 MK2S kit and decided it needed an enclosure, so I purchased some plywood and hacked one together.  There isn’t a square edge on it, but you can’t really tell from a distance!  I put together a lighting circuit and a print server with a raspberry pi on the side, so that I can print remotely from the LAN.

Posted by jmcnelly in Mechanical, Projects, 0 comments