jmcnelly

Thoughts on Running a Farmers’ Market Stand

Thoughts on Running a Farmers’ Market Stand

I’ve always enjoyed cooking, especially Asian food (lots of influence from my mom’s side of the family in Wuhan) and slow-smoked barbecue (idk it’s tasty). One day in the summer of 2021, Caitlin (my Significant Other), Kenneth (my brother), and I stumbled into a strange cocktail of boredom and hubris and decided to start a farmers’ market stand specializing in hot food of the Asian-American fusion variety.

Chapter 1: Haha What If We Ran a Farmers’ Market Stand

In truth, we thought of the name first, Baobeque, and thought it was a fun enough name that it was worth thinking up a menu for a farmers’ market stand with that name, you know, as a joke. And cooking test recipes for it, you know, as a joke. And filing for the Fictitious Business Name. And registering for a resellers’ certificate and building a budget and starting a sales tax account with the CDTFA and getting a federal EIN and shopping around at commissary kitchens and writing a business plan and applying to farmers’ markets. For the joke. Haha so funny what if we actually ran a farmers’ market stand that would be so crazy we’re all engineers we have like no time.

An early food prototype: Char-Siu Pork Belly Burnt Ends on homemade bao.

Chapter 2: Why Won’t Anyone Let Us Run a Farmers’ Market Stand

On the outside, Farmers’ Market food stands look like a great idea for a business. They serve simple items, have low capital costs, and absolutely print money. For the cost of a tent and some minimal fees paid to the farmers’ market, you can have access to a vast number of potential customers who are willing to pay relatively high prices for unique and interesting food. So why aren’t there more of them?

It turns out that Farmers’ Markets are not just a collection of stands competing with each other on one street. The whole Farmers’ Market is carefully curated, competing with other Farmers’ markets in the area to attract the most customers, retain the best vendors, and secure the best venue. Farmers’ Markets are run by market managers who are in charge of admitting vendors to the market, collecting fees for the markets’ parent organization (usually one organization will run a number of different markets spread out throughout a large area across different days of the week, so that vendors and market staff can work multiple days a week). Because space in each farmers’ market is limited, market managers have to pick and choose which vendors are allowed a spot. In order to keep vendors happy (by avoiding too much competition in each product catrgory), and in order to provide market customers with a variety of choices, market managers usually limit hot food stands to one per specific food category (e.g. there can only be one hamburger stand). If the market is especially large, or there is extra demand for a certain category of food (e.g. artisan bread is super popular), market managers may allow a larger number of similar food vendors. If two vendors overlap but not entirely, market managers may artificially restrict the menus of the two vendors in order to resolve the conflict by reducing competition (e.g. if there’s a noodle vendor that also serves dumplings, they may not be allowed to sell dumplings if entering a market with a pre-established dumpling vendor).

All of this is to say, Farmers’ Markets aren’t just a collection of people who showed up with tents. Each vendor in the market is hand-picked to cater to the most likely tastes of the local clientelle, while providing mutual benefits and minimally destructive competition to other vendors in the market. Kind of like some kind of artificially constructed coral reef, if the corals are vendors and the fish are people who get up at the crack of dawn on a Sunday morning looking to purchase expensive produce from a tent outside a Starbucks.

Because of the large number of prospective vendors that want to join a farmers’ market, and the intense selection criteria created by market managers, many applications to join farmers’ markets are denied, and many more are placed on years-long waitlists to stand by in case another vendor drops out. After a number of fruitless applications, Baobeque seemed like it wasn’t going to get into any farmers’ market anytime soon. But, we were convinced that our concept was unique and provided an angle that wasn’t present in our local market, so we pressed on and began to (politely) badger the local market managers about our vendor application whenever we visited their market. After discussing our concept with them and staying engaged in for a few months, we managed to warm them up to the possibility of adding our tent concept to the market, and eventually they asked us for samples of our food (one of the final steps in the application process)! By some miracle, the market managers liked our food, and our application was green-lit and forwarded to upper management for final approval.

The sample box we provided to market managers. At this point the concept relied on a weird hybrid lunch / breakfast model, where we would serve breakfast like country fried potatoes and eggs until the meat was done smoking, at which point we would switch over to Asian/American fusion. Super weird and there turned out to not be enough time or equipment to pull off the mid-market menu switch. Seems like the food was all tasty enough, though!

Chapter 3: Oh No, We’re Running a Farmers’ Market Stand

Crap crap crap crap quick we gotta get everything ready!

With an approved application, we jumped into the process of acquiring equipment, figuring out branding, building our menu, booking time in a commissary kitchen, and iterating / practicing our recipes. We purchased a used cargo trailer for transporting equipment,

As a dry run for our first farmers’ market, we catered a college student event for free (they paid for the ingredients, and we cooked everything and served it), which was hugely helpful for pointing out many flaws in our process; our prep/setup/everything time was way too slow, our menu was too big, and our recipes weren’t scaling consistently. Fortunately, college students like free food, and didn’t complain–but we knew we would need to step things up before setting up shop at a farmers’ market with real paying customers.

Problems identified during dry run:

  • Low efficiency
    • We spent probably 20 hours preparing, catering, and cleaning for an event where we served ~70 people. Definitely not scalable, but a lot of time was wasted in figuring out how equipment worked, loading equipment into separate cars (instead of a single trailer), and generally being extremely slow about everything.
    • Our roles in the tent weren’t well rehearsed, and we kept tripping over each other and wasting a lot of time being blocked by each others’ tasks.
    • We were missing some key equipment for improving our efficiency. For instance, we were julienning onions by hand (badly), when we could be saving a bunch of time by using an inexpensive manual machine to do the same task.
  • Unscalable recipes
    • One of the main pain points of the catering event was homemade bao buns, which we were making from scratch and steaming ourselves. These buns took a tremendous amount of time to hand-craft for us (as culinary noobs), and worse, were easy to over-steam and had very little durability for hot-holding. If one of our bao buns was overcooked or hot-held for too long, it would end up looking like a wet version of Emperor Palpatine’s face, and would stick to every available surface inside the steamer. Not good.
    • We had a stir-fried eggplant dish that was 1) extremely slow to cook and 2) not that good. We needed to find a better way to cater to vegetarians.
  • Dumb mistakes
    • We made some small mistakes that added up to become large issues. Most of these were related to missing items that we all assumed someone else had remembered to pack for the event. For instance, we forgot to bring honey with us to add to the char-siu pork belly burnt ends glaze, which meant we weren’t glazing the pork belly burnt ends in a delicious sugar crust, but rather frying them in some kind of pink pork oil/water mixture. Still tasty, but not nearly as good as what we had prototyped.

Happy takeaways from dry run:

  • Our food was edible
    • People seemed to like what we were serving, and thought it was very unique (in a good way).
  • Operations had vast potential for efficiency improvements
    • Most of our issues were related to a few small bottlenecks, and a lot of our production capacity was being wasted. This was great news! If we could eliminate some of these bottlenecks and streamline other parts of our operations, it was obvious that we could greatly improve our overall eficiency.
  • This could work
    • Running a farmers’ market hot food stand is going to be a LOT of work.
    • Cooking for a large number of people on a tight schedule is fun, but in a stressful / kinda terrifying way.

Chapter 4: The Real Deal

Baobeque’s first farmers’ market appearance was in early October of 2021.

Core memories from The First Market:

  • We lucked out and happened to debut during the stormiest market of the year. It started dumping rain around an hour after the market opened, and not the light drizzle kind–the raining-horizontally kind.
  • As total noobs, we figured everyone weighs down their tent with sandbags at the market, since that seems like a tenty thing to do. It turns out that sandbags are heavy and usually not needed at all, so nobody had sandbags on their tent except for us. Due to the aforementioned wind situation, we watched from inside our tent as other tents were blown over our heads and down the street during the market. I distinctly remember seeing an Indian food tent being blown about 20ft above the street with a propane tank still attached. There wasn’t much food selling happening at this point as everyone was focused on holding things down, trying to keep stuff dry, and helping people dodge flying tents / pick up the mangled pieces.
  • Someone placed a cash tip into our open container of green onions, which was unfortunately located near the pickup window. Oops.
  • Our total take from the first market was around $600. Impressive for a super rainy day, but not nearly enough to break even. Still, a great start!
  • Some very kind friends stopped by to help us clean up after the market. Their help loading up our trailer in the pouring rain felt like a saving grace after a long day of prep / setup / cooking and getting soaked.

Sometime in our first few markets, a local student named Derek came and asked to film a food review. We were happy to say yes, and his well-produced video is still probably the best-documented video snippet we have of the customer experience. Of course, we were still getting our food ironed out, and a lot of the food presented in the video wasn’t yet our best work, but we were very happy to get a shoutout on the internet!

It was clear that we were bringing something unique to the farmers’ market, and customers seemed to really enjoy the dishes we were making. After our initial market debut, we continued to improve our operations and menu. Some improvements that we made:

  • Added a stir-fried Tomato-Egg dish as a vegetarian option. Probably our personal favorite dish but never got very popular among customers, for some reason.
  • Wrote full checklists and written recipes for ingredient shopping, prep, setup, and teardown.
  • Bought a $700 dough sheeter from Italy for improving our consistency and efficiency in preparing our custom green onion pancakes.
  • Played around with some specials, including smoked beef back ribs.
  • Cut out little blocks from 2×4’s and added some adhesive-backed sandpaper to make levelling blocks for our tables (the street was quite sloped where our tent was set up, and everything kept sliding to the back of the tent).
  • Worked out a really efficient system for writing down orders (written shorthand), calling orders within the tent (verbal shorthand / keywords for acknowledging with a callback), and staging orders for minimum wait times (FIFO with early warnings for any potentially blocking shortages).
  • Caitlin got really good at estimating wait times from the backlog, and usually was able to provide every customer with a wait time estimate that was accurate within a few minutes. She would write the time that the order was taken at the top of every new ticket, and this would be used for estimating current wait times. If an order was taking longer than the estimated time, everyone in the tent would know about it, and an apology could be made to the waiting customer (usually with a free drink or something similar).
  • Kenneth became a bao assembling machine. Most weekends he would assemble 300+ bao for customer orders.

As we gained a following, and as the market began to get busier (due to the return from COVID and adding new vendors), we saw our sales steadily increase until we were in the range of $1400 to $1700 per market. This was enough to break even with ingredients, rent for the commissary kitchen, market fees, and salary (Caitlin and I were working for free). Seeing the same customers come back weekend after weekend was very rewarding, and assauged my fears that we wouldn’t be able to build a steady business.

Chapter 5: Can we make this a Real Business™?

Business was good, but running a farmers’ market stand on top of having full-time engineering jobs was beginning to take a toll. In addition to working 45+ hour weeks at our full-time jobs, we were working an additional 20-ish hours each every weekend to run the stand. The types of work were quite different, which could be refreshing, but the volume of work was getting to be exhausting.

The business was breaking even, but was not in a sustainable place. From the capital side, our numbers were barely working, since we were only operating one farmers’ market, so all of our fixed costs (commissary rent, equipment cost, business fees, etc) were only being amortized across a single day per week of business operation. From the labor side, our business had no redundancy and relied on all three of its employees working at 100% capacity at all times, since any single person calling out sick for even just a few hours of work on a weekend could shut down the whole operation. We were faced with a decision: ride the burnout train into the ground, or put in one more big huff of effort to try professionalizing and expanding the business to a point where it could survive without continued unsustainable effort from our side. As optimists, we chose the second path, and set about making a Real Business™.

For Baobeque to survive without our own continued effort, we realized that it would need to become a self-sustaining business with its own employees and management. We were already doing things above board (paying all relevant permits and sales tax, great documentation for our processes, etc), which was a great starting point. In order to hire Real Employees™ for our Real Business™, we needed to write up an employment contract and employee handbook, figure out a payroll system, pay for employee insurance (in case of injury on the job), and collect (withhold) income tax from employee wages. This turned out to be substantial effort, but with the help of some of the readily available digital tools for small businesses (Square is a lifesaver), the process was completed within a few weeks. So, we put up a “hiring” sign, set the hourly wage as high as we could possibly afford ($18/hr), and waited for someone to ask us about it!

Within a few weeks, we lucked out and were contacted by someone who was the become our first Real Employee™. He had a great attitude and were quick to learn the ropes. Our original intention was to have him come to the market and learn the process for a while, and then have Kenneth take some weekends off. However, hiring our employee corresponded with an increase in sales, and any slack that was left was taken up by new processes we had to introduce to be compliant with labor laws (e.g. minimizing overtime work, mandatory bathroom and meal breaks, etc). We hadn’t had to stick to these processes previously since the only people working in the booth before weren’t paid employees. Adding these provisions increased the cost of doing business, but were obviously necessary. We hadn’t realized how much we’d been burning the candle from both ends just to make things work! And at the end of the day, if a job needs to not allow bathroom breaks to be financially viable, that job is either vastly under-valued or probably isn’t worth doing in the first place.

In order to pay for our higher costs that resulted from converting to a Real Business™, we raised our prices to the highest level that we thought would be fair to our customers (we gave our regulars some discounts during the cost increase period to soften the blow). Due to a number of factors, our revenue increased slightly and reached a more-or-less sustainable threshold. We were cash-flow positive as a Real Business™, but only by a hair. And, we didn’t have enough revenue to pay supervisors or owners more than the base employee wages, which would make promotions difficult.

Some things influencing our profits during the Real Business™ transition:

  • (+ revenue ) We raised our prices. For instance, a 3-bao meal with a salad went from its original price of ~$10 when we first opened up to a final price of $18! We tried to keep some “deep value” items on our menu with large portions and low costs to keep hungry customers satisfied (we sold jam-packed containers of slow-smoked pulled pork fried rice for just $12, usually enough to feed two people).
  • (- revenue) A really tasty dim-sum tent opened next to our booth in the market, which reduced demand for our product slightly by helping fill out the Asian food niche (but also resulted in some excellent food trades where we got to go home with some delicious shu mai and har gow).
  • (- profit) Pork prices went way up, something like 30%.
  • (+ revenue) Farmers’ market foot traffic increased as summer approached.
  • (+revenue) We introduced a new vegetarian dish to replace our less-popular tomato egg. We began serving hot sesame noodles, a spin on the Wuhanese dish Re Gan Mian, but with slightly different ingredients. This dish was easy to make in volume and had great profit margins.

Having completed our Real Business™ transition, with two employees (Kenneth converted to a full time employee during the transition), two co-owners, and a fully insured and above-board business, we had a toehold on a sustainable business plan, but residual burnout was creeping back in. Caitlin and I wanted some time on the weekends back, and Kenneth was about to start a new full-time job. At work, I was getting promoted to a management position on top of my existing engineering responsibilities, and I knew that I would need to find a way to not do 20 hours of farmers’ market work every weekend (along with additional hours of miscellaneous tasks outside of work hours during the week) in order to maintain my sanity and put my best food forward at work. We would need to find a way for the business to operate without us involved in day-to-day operations if it was going to be sustainable long term.

Chapter 6: The Impossible Chicken Egg Problem

To make the business run truly hands-off, we would need to hire someone who could be an experienced supervisor, and train them to train more people. To pay for an experienced supervisor, we would need to join more farmers’ markets to increase our revenue, better amortize our operating costs, and increase our economies of scale. But, since we already had full time jobs and were operating at 100% capacity, we had no bandwidth to join additional markets, or even really start a hiring search for a supervisor or new employees in earnest. If we wanted to expand the business to a sustainable and scalable point, we would need to invest a substantial amount more resources, into the business in the short term both in capital and in our own time.

Caitlin and I are both very passionate about our jobs (we’re engineering nerds and getting paid to build stuff with technology is actually the best), and neither of us was down to leave our engineering career to work on the farmers’ market business. We spent some brief time searching for a buyer, but didn’t find any initial takers and weren’t willing to run the business indefinitely while searching for someone to hand it off to. Our employee expressed some interest in acquiring the business, and we were excited about the prospect of selling it to him (at a very good price), but ultimately he wasn’t able to secure the funding and support he would need to run it sustainably. In the end, we made the decision to close the business as gracefully as possible while taking care of our employees, friends, and customers as best we could.

Baobeque’s last day of operation was on June 12th, 2022. We notified our customers in the weeks leading up to our closure, and many of our regulars came by to place one last order (or many last orders). We also printed up recipe cards for our most popular dishes, and handed them out to anyone who wanted them, so that anyone who had grown to love the taste of our food could try replicating it themselves.

While closing the business, we gifted our employees a generous severance package, and began selling off our major pieces of equipment piece by piece. Many of the friends we had made at the farmers’ market and the commissary kitchen were more than happy to buy our used equipment, and we were happy to provide them great prices as a token of our friendship. On June 19th, 2022, the Baobeque crew enjoyed a wonderful Sunday morning of sleeping in for the first time in a long time.

Posted by jmcnelly, 0 comments
Halloween 2021: The TSA (Treat Security Administration)

Halloween 2021: The TSA (Treat Security Administration)

For Halloween of 2021, we decided to bring the horrors of modern air travel to unsuspecting trick-or-treaters in our neighborhood. Thus, the “Treat Security Administration” was born.

The TSA

The Treat Security Administration is tasked with inspecting all treat and costume items being brought or worn onto the premises of any nationally recognized TDF (Treat Distribution Facility). For the safety of all trick or treaters, arbitrary items such as excessive amounts of candy, pointy hats (sometimes), certain kinds of chocolate, and that one kid’s squirty blood face mask are subjected to additional screening and inevitable delays.

The TSA crew at Los Altos’s premier TDF served trick or treaters compassionately and efficiently on October 31st 2021 (the year’s busiest treat distribution day)! Thanks to their diligent treat inspections and trick-or-treater harrassment, not a single treat-related attack or incident was reported on site that night.

The Setup

Any good airport security line needs a good, loud, beepy metal detector. Ideally the kind with bright LED lights that change color when an item of interest passes through. My brother did an excellent job crafting a metal detector frame out of 2×4 framing lumber, and used bent coroplast sheeting to fill in the gaps and add a finished appearance. A healthy coat of metallic silver / gray spray paint completed the effect.

For the beeping and flashing sound effects, I threw together an electronics system based on an Arduino Nano, an audio amplifier module, and individually-addressable LED strip, and some speakers. When a hidden button was pressed, the Arduino would blast a pulsed square wave through the speakers and change the LED strip color from green to red, recreating the iconic “BEEBEEBEEBEEBEEBEEP” sound effect that is a fixture of The Other TSA’s many locations.

Some basic register manipulation was required to get the PWM frequencies just right on the Arduino side of things, but other than that the code and electronics were pretty uninteresting. The whole blob of electronics is powered from a LiPo battery via a DC-DC converter, and was laid out on a fiberglass backplane mounted in a waterproof box.

All of the electronics jammed into a waterproof box with a fiberglass backplane.
Somehow the best picture I have of the whole metal detector put together.

The Crew

The best darn crew (and cow, and passenger) a TDF could ask for.

My brother acquired some blue uniform shirts and some very cheap black ties, then custom made everyone little TSA ID badges. Latex gloves and some bus bins from our farmers’ market stand completed the ensemble.

We had enough people to run a check in desk, treat inspection, and the metal detector with multiple shifts. Roles were as follows:

  • Check-in Desk
    • Ask trick-or-treaters for ID and boarding pass (they have neither; act surprised about this, but in a bored way). Ask them if they’re trick-or-treating for business or for pleasure. Ask them how long they will be trick-or-treating for. Squint at them suspiciously. Examine an imaginary ID card with a little UV flashlight. Tell the blob of waiting kids to please remain behind the white line. Send a trick-or-treater to the inspection area, and call NEXT in an assertive yet unenthusiastic manner.
  • Treat Inspection Area
    • Make kids put their treat sack into a gray bus bin. Ask for X flavor of treats to be placed in the bin separately, if desired. Sneakily plant suspicious items into the treat sack, like a roll of scotch tape or some safety scissors, so you can pretend to find them later. Tell kids not to take off their shoes. Slide the bus bin along the table next to the metal detector and inspect its contents. Tell kids not to take off their shoes. Inspect any items kids remove while being harrassed by the metal detector operator. Tell kids not to take off their shoes.
  • Metal Detector
    • Stand near the treat inspectors holding the metal detector trigger button (attached to the metal detector with a long cable) behind your back. Trigger the metal detector when every Nth kid walks through, and declare the issue to be with an arbitrary part of their costume. Trigger the metal detector consistently if that part of the costume passes through it again. Wait until the kid takes off that part of their costume and passes it through the inspection area, then let them pass through the detector without triggering (or trigger it again, and say sorry, it must actually be a different item–this was especially fun with older trick-or-treaters).

The Event

Running a TSA checkpoint for trick-or-treaters yielded a record ratio of trick-or-treater engagement and costume participant enjoyment to costume setup effort. Parents thoroughly enjoyed the joke, children were initially confused but completely auto-piloted through the situation with little need for guidance or additional explanation (most of them had been through airport security lines many times before), and laughs were had all around.

I found that if I triggered the metal detector while a kid walked through, and declared it was being triggered by some specific item on their costume (say, a hat), most kids would immediately comply by taking off the hat, putting it in an inspection bin, and walking through again. A few kids were initially skeptical of the setup and called out the metal detector as being “fake”, but if I triggered the metal detector again when they walked back through it on their way to try again, they were instantly 100% convinced it was totally real, and something in their hat was totally triggering this crazy hat detector to beep at them. Some kids would even take off the specific offending clothing item and wave it through the detector individually, and I would dutifully trigger the detector in sync with their test.

One of the most entertaining strategies of the night was telling one kid in line that X costume item was triggering the detector, but telling the kid immediately behind them in line (dressed identically) that X costume item was totally fine and it was definitely Y item that was triggering the detector. We had a number of witches, wizards, and draculas trying to figure out why their friend’s plastic hat/cape/wand was setting off the detector but theirs was not.

It was a continual chore to stop kids from taking off their shoes before going through the security line. Airport reflexes were deeply ingrained, even though many kids hadn’t been on a plane for the duration of the COVID-19 pandemic.

Project Files

Source Code

Posted by jmcnelly, 0 comments
Arduino Radar Speed Sign

Arduino Radar Speed Sign

Electronics Kit Now Available!

Update 2023-09-05: I finally got around to redesigning the electronics for this kit, and got some PCBs made for an improved 7-segment display as well as a new control board based on a Pi Pico! I also rewrote the firmware in MicroPython to make it easier to play around with. The full kit is available at my webstore, pantsforbirds.com, but of course the updated design and code files are still open source and available on the github repository.

Use coupon code SPEEDSIGN50 for $50 off kits in the first batch! This is mostly an incentive for dealing with any hiccups we’ll encounter while ironing out the order process, and will be removed when the first batch is sold out.

Project Writeup

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!

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!

Links

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, 16 comments
Idiot Bird

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

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.

Beep.

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!

Self-checkout stand with the crew (friends inside the boxes lit up their faces for the photo: normally the reflective coating on the plastic windows would hide the box operators from view).

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

Ok!

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
Birdcam

Birdcam

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

Code

Posted by jmcnelly, 0 comments
3D Printer Enclosure Fan Controller

3D Printer Enclosure Fan Controller

Overview

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.

Code

Parts List

Pictures

Electronics
Main menu
Config screen 1
Config screen 2
Controller and fan

Posted by jmcnelly, 0 comments

LED Trumpet

Overview

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.

Code

Parts List

Posted by jmcnelly, 0 comments
Fire Alarm Pull Light Switch Cover

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