Skip to main content
Version: FILS English

Coins Keeper

A coin-sorting-counting device that automatically identifies and sorts coins into designated compartments for their safely storing

info

Author: Vladyslav Kiselar
GitHub Project Link: GitHub

Description​

Coins Keeper is an automated coin-sorting device that identifies the denomination of each coin inserted and sorts them into designated compartments. When a coin is inserted, it passes through a coin selector module which determines the coin’s value. A stepper-motor-driven mechanism then rotates to align the correct storage box under the coin so that it falls into the appropriate bin. The digital display shows the current total balance in real time, and a buzzer provides an audible beep whenever a coin is accepted, giving immediate feedback to the user.

In addition to sorting, Coins Keeper includes a security feature to protect the collected coins. An NFC reader module allows an authorized user to unlock the coin compartment by scanning an NFC card or tag. This ensures that only authorized users can retrieve the coins.

Motivation​

The idea behind Coins Keeper came from a practical and relatable problem: managing and organizing loose change. Coins often accumulate in drawers, pockets, or jars without any clear order, making them inconvenient to use or store efficiently. I wanted to design a device that not only solved this everyday issue but also allowed me to apply embedded systems and automation in a tangible, functional way.

By building an automatic coin sorter with security features like NFC access, I’m integrating mechanical design, microcontroller programming, and real-time interaction β€” all essential skills in embedded development.

Choosing this project also allows for creative freedom in problem-solving β€” from designing a sorting mechanism to managing user feedback and storage access.

Architecture​

The system architecture is illustrated in the block diagram below. When a coin is inserted, it first passes through the coin selector module, which identifies the coin’s denomination. The module sends a signal to the Raspberry Pi Pico 2W microcontroller, which actuates a stepper motor (through a motor driver) to rotate the sorting mechanism and direct the coin into the correct storage box.

To ensure the coin doesn’t fall before the sorting platform is correctly positioned, a servo motor is used as a stopper. It holds the coin briefly after detection, then releases it once the correct bin is ready beneath. This ensures accurate sorting even with mechanical delays.

Once the coin is successfully deposited, the display is updated to show the current coin balance, and a buzzer sounds as confirmation.

For collecting the stored coins, the system integrates a locking mechanism. A metal latch is mechanically actuated by a servo motor. This acts as an electronically controlled lock. To unlock the compartment, the user must authenticate using an NFC module. If the scanned card/tag is authorized, the servo moves the latch to allow access.

Architecture Diagram
As of now, at the Week 5-11 May, DC jack module is being used to power the coin selector, while all other components are running on a battery supply. This setup is inefficient and not fully reliable, as the battery struggles to provide stable power for continuous operation of the system.

Looking ahead, a voltage regulator is planned to supply power to both the coin selector and all other modules from a single source. However, it remains an open question whether this setup will deliver sufficient current for stable and reliable operation of the entire system.

Log​

Week 5 - 11 May​

After receiving approval for the project, I gathered all the essential components and began working on the hardware setup. This included connecting the coin selector, servo motors, LCD, Raspberry Pi Pico 2W, and other peripherals, all mounted on a temporary prototype base.

At this stage, I assembled the core electronics on a breadboard for testing and integration. The prototype is currently built inside a simple cardboard mock-up, serving as a placeholder for component layout. This temporary enclosure helps visualize positioning and spacing. In the final version, LEGO bricks will be used to construct both the case and the coin compartments, with most components expected to be fixed using a hot glue gun.

Components in the test box

Currently, there are no dedicated sorted compartments for coins. These will also be constructed from LEGO once the main structure stabilizes and all measurements are confirmed.

As of this week, the coin selector is powered via a DC jack module, while all other components run off a 9V battery. This setup is proving inefficient and unstable β€” the battery cannot consistently provide the required current for reliable operation.

Test box look

Looking forward, the plan is to introduce a voltage regulator to supply both the coin selector and the remaining components from a single, centralized source. However, it's still unclear whether this configuration will be able to sustain the full system load under all conditions.

Week 12 - 18 May​

Week 19 - 25 May​

Hardware​

The control logic of Coins Keeper is implemented on Raspberry Pi Pico 2W boards. One Pico serves as the main controller, which manages all coin detection, sorting, and feedback components, while a second Pico is optionally used as a debugging probe during development. Coins are inserted into a commercial coin selector, powered via a 12V DC jack. Upon detection, a servo motor acts as a stopper to briefly hold the coin while a stepper motor rotates the sorting platform to align the correct compartment underneath. The coin is then released into the bin.

A 16x2 I2C LCD displays the current balance and system messages, while a passive buzzer and status LED provide audio and visual feedback. An NFC reader module is integrated for access control. When an authorized NFC card or tag is scanned, the system activates a servo-driven physical latch to unlock the compartment β€” securing the coins from unauthorized access.

Hardware

Most components are currently wired on a breadboard and mounted inside a cardboard test box to prototype layout and positioning. In the final version, the housing and compartments will be built from LEGO bricks, with parts fixed in place using a hot glue gun. Coin bins are yet to be implemented but will also be constructed from LEGO.

For now, the coin selector runs on 12V via a DC jack, while all other components are powered through a 5V breadboard power module connected to a 9V battery. A voltage regulator is planned to power the entire system from a single 12V input, though its ability to handle total current demand is still under evaluation.

Schematics​

KiCad Schematic
Not final version - not all components are connected yet.

Bill of Materials​

DeviceUsagePrice
2 x Raspberry Pi Pico 2WMicrocontroller (2 units: main + debugging)79.32 RON
Multi-coin selector module (626 model)Detects and identifies coins165 RON
Stepper motor (28BYJ-48 5VDC)Rotates mechanism to direct coins19.16 RON
2 x Servo motor SG90 180Β°For "keeping" coin mechanism / locker mechanism23.98 RON
16X2 LCD DisplayDisplays coin balance and status16.34 RON
Passive BuzzerAudio feedback for coin detection0.99 RON
NFC module (PN532)Secure access to stored coins33.19 RON
12V Universal Power Supply AdapterAdapter for powering coin selector15 RON
DC Socket ModuleSocket for adapter for powering the coin selector4.99 RON
Battery 9V (Duracell)Voltage supply for most components15.14 RON
9 V Battery Connector with DC JackPowering the breadboard using 9V battery1.49 RON
Low-Voltage Source ModuleFor future using 12V adapter as single voltage supply for all components (instead of battery)24.99 RON
Breadboard Power SupplyFor giving 3.3V/5V powering via battery4.69 RON
Wiring and misc.Jumper wires, breadboards, connectors-
Custom coin compartmentsStore sorted coins (LEGO)-

Software​

LibraryDescriptionUsage
embassy-rpHAL for Raspberry Pi PicoAccess to GPIO, I2C, PWM, and other peripherals
embassy-executorEmbedded async/await runtimeRuns non-blocking async tasks
embassy-timeTimekeeping and timersUsed for debounce logic, delays, and timed feedback
embassy-syncAsync-safe synchronizationFuture inter-task communication (channels, mutexes)
embassy-embedded-halHAL adapter for EmbassyBridges Embassy drivers with embedded-hal traits
embedded-halEmbedded Hardware Abstraction LayerUnified interfaces for drivers (SPI, I2C, GPIO, etc.)
hd44780-driverDriver for HD44780 LCD over I2CDisplays messages and coin balance
heaplessFixed-size collections for no_stdString construction and buffer-safe operations
fixedFixed-point arithmeticUsed for PWM servo pulse calculations
defmtLightweight logger for embedded systemsReal-time logging via RTT
panic-probeMinimal panic handler with defmt supportShows panic info in debug output
pn532NFC reader driverFor secure card/tag authentication
stepperStepper motor driverTo control the rotating sorting mechanism
embedded-hal-asyncAsync traits for embedded driversIf future peripherals need async SPI/I2C access
  1. How to use CH-926 Coin Acceptor
  2. Embedded Rust Book