The Hardware Evolution: From SBC to MCUMost early prototypes rely on a Single-Board Computer (SBC) like a Raspberry Pi. That’s fine for a demo. But for production, you have to think about cost-per-unit and long-term availability. A Pi is a consumer product; it gets discontinued, and it’s overkill for controlling motors and reading sensors.

For a production smart vending machine, we usually move to a dual-processor architecture. We use a primary application processor (often an ESP32-S3 or an i.MX RT series) to handle the UI, payment integration, and cloud connectivity via MQTT. Then, we use a secondary MCU—like a simple STM32 or an nRF52—to handle the real-time control of the motors and sensors. This separation is critical. If the Linux side crashes or the Wi-Fi stack hangs, the secondary MCU ensures the machine doesn't start dispensing products randomly. It’s a safety and reliability feature that you simply cannot ignore.

Power Management and Battery Life

If your machine is plugged into the wall, power is a non-issue. But many of our clients want "micro-markets" or pop-up vending solutions that run on battery or solar. This changes everything.

We recently optimized a system that used a 12V linear actuator for dispensing. In the prototype, it worked fine. In production, we realized the inrush current was causing brownouts on the main logic board. We had to redesign the power delivery network (PDN) to include a supercapacitor bank to handle the spike, and we moved the motor control to a dedicated MOSFET driver.

For wireless connectivity, we rely heavily on BLE for local diagnostics and Wi-Fi for telemetry. But we don't leave the radio on all the time. We use a wake-on-timer approach on the ESP32, where the device sleeps for 5 seconds, wakes up, checks for commands via MQTT, and then goes back to sleep. This extends battery life from days to months.

The Mechanical Side: 3D Design and PCB Layout

Software is only half the battle. Mechanical engineering is where most prototypes fail. Off-the-shelf dispenser coils are designed for specific product dimensions. If your product is a slightly odd shape, the coil will jam.

We handle this in-house using Fusion 360 for 3D design. We iterate on the auger (the spiral coil) geometry to match the exact product packaging. We also have to design for serviceability. If a motor jams, how does the operator get the product out without breaking the machine? We design the chute and the motor mounts to allow for a "manual release" mechanism.

Our PCB design process is done in KiCad. We pay specific attention to the routing of the high-current motor traces away from the sensitive analog sensor lines. We also design the enclosure for thermal flow. A vending machine in Arizona in July gets hot. If the internal temperature exceeds 60°C, the lithium battery or the LCD screen will fail. We add passive ventilation and, in some cases, a thermostatically controlled fan that only kicks on when needed.

Firmware: The Zephyr RTOS Advantage

We build most of our production firmware on Zephyr RTOS. Why? Because it’s modular and secure. We can write a driver for the motor controller once and reuse it across different projects. It also gives us over-the-air (OTA) update capabilities out of the box.

This is crucial. Once your custom built vending machine is deployed, you will find bugs. You might need to adjust the torque curve on a motor or tweak the payment protocol. With Zephyr and a robust bootloader, we can push a firmware update over Wi-Fi without needing a technician to physically open the machine. We design the firmware to log diagnostic data—motor current, temperature, and error codes—to an SD card or flash memory. This data is transmitted to the cloud for analysis, allowing us to predict failures before they happen.

Certifications and Compliance

This is the part that surprises many hardware startups. You can’t just ship a device with a Wi-Fi radio and a power supply. You need FCC...

Read more »