element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products & Partners
    Products & Partners
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
My Project Is Trash
  • Challenges & Projects
  • Design Challenges
  • My Project Is Trash
  • More
  • Cancel
My Project Is Trash
Forum Knock-Knock-Sortin' #8 - Building the bin
  • News
  • Forum
  • Projects
  • Enroll
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join My Project Is Trash to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 1 subscriber
  • Views 24 views
  • Users 0 members are here
  • cn0569
  • camdenboss
  • waste-classification
  • KnockKnockSort
  • my-project-is-trash
  • design-challenge
Related

Knock-Knock-Sortin' #8 - Building the bin

amgalbu
amgalbu 8 hours ago

In the last posts I talked about the IR sensor (#5), the dataset (#6) and the classifier (#7). In this post I started to move from the bench to the real thing.

In my proposal and in the first posts, the Nicla Vision was the brain of the bin. It read the accelerometer, the IR sensor and its own microphone, ran the classifier, moved the chute and drove the LEDs through an MCP23017 port expander. But then, I experienced some issues with the ADXL372. I spent several days on it, but its ID registers kept coming back as 0xA9, 0x18 and 0xF0 instead of 0xAD, 0x1D and 0xFA. The MCU side was fine: with MISO tied to 3.3 V it read 0xFF as it should. A pull-up on MISO and a 100 kHz clock gave the same wrong IDs, and the values changed when I touched the wires or added a second ground. I never found a fix that made it answer reliably, and the deadline doesn't wait for me.
So, the move was to place the Nicla below the plate, but this action had an important consequence: for sure, I can't run all those wires from the plate to box. The solution was to add another board (the Arduino Nano 33 BLE). In this way, I can split tasks as follow:

  1. Arduino Nano 33 BLE: the main controller. It reads the CN0569 IR sensor over I2C. When object is detected, it drives as digital output connected to the Nicla board to trigger acquisition
  2. Arduino Nicla Vision: runs the classifier. It sits in a small printed case under the gate plate, the trapdoor at the bottom of the chute. When triggered by Arduino Nano, it records the knock with its LSM6DSOX accelerometer and its microphone and runs the Edge Impulse model of post #7.
  3. Arduino Nicla sends the result of the classification back to the Arduino Nano through a unidirectional serial link (only transmission from Nicla to Nano is possible)
  4. Depending on the result received over the serial link, the Arduino Nano moves the NEMA motor through TMC5272 board, drives the servo to open the plate and sends a command on a serial link to Arduino Uno to animated LEDs
  5. Arduino Uno receives commands over the serial link and drives GPIOs accordingly

These are the boards and the links between them

image

The links between them are deliberately simple:

Link From --> To Pins Settings
DETECT (GPIO) Nano --> Nicla Nano D6 → 1 kΩ → Nicla D2 high while an item is expected
NICLA_TX (UART) Nicla --> Nano Nicla D1/TX → Nano D0/RX 19200 8N1, one line per item, e.g. GLASS 0.93
LED_LINK (UART) Nano --> Uno Nano D1/TX → Uno D2 9200 8N1, e.g. identified 2
I2C Nano <--> CN0569 A4 SDA, A5 SCL
SPI Nano <--> TMC5272-EVAL D13, D11, D12, D9
PWM Nano → gate servo D7 50 Hz, 1000 to 2000 µs

To recap, the sequence for one item is:

  1. The CN0569 sees something fall through the chute, and the Nano reads the break over I²C.
  2. The Nano raises DETECT and sends detected to the Uno, so the LEDs react.
  3. The Nicla takes the rising edge of DETECT as the start of its capture window, waits for the knock, classifies it, and sends one line back: the bin and the confidence.
  4. The Nano drops DETECT, sends identified <bin> to the Uno, turns the chute to the bin, opens and closes the gate, and goes back home.

Note that the Nano 33 BLE has only one hardware UART (Serial1 on D0/D1). So I use its RX for the Nicla and its TX for the Uno, at the same baud rate. The Uno link was already at 19200, so the Nicla link follows. USB is a separate port, so the debug prints on the PC don't disturb either of them.

The weak point is known: the LSM6DSOX stops at ±16 g, and a paper drop already reached 15.6 g on one axis. A can or a glass jar will clip it. If I get the first prototype running on time, I'll order new ADXL372 boards and go back to the original plan. The Nano pins it used (D3 and D10) are still free on purpose, so it can come back without rewiring anything else.

Why an Arduino Uno just for the LEDs?
The LED panel is 9 CamdenBoss IND514113 indicators. Each LED gets about 10 mA. The first version drove them from the Nicla through an MCP23017 expander and a ULN2803 on a piece of perfboard. With the new architecture the obvious candidate was the Nano, but the Nano 33 BLE has 3.3 V pins that are not 5 V tolerant, and it had already given most of its pins to the sensor, the driver and the servo.

The Uno solves both problems. Its ATmega328P pins give 5 V and can source 10 mA per LED without any driver: I just need to add a 300 Ω resisto. All 9 LEDs on is about 90 mA, well under the limits of the port groups. As a bonus, the Uno does all the animation timing: the Nano only says which animation to show and never waits for the LEDs.

There's one catch with mixing a 5 V board and a 3.3 V board. The link runs one way only, from Nano TX to Uno D2, and a 47 kΩ resistor from D2 to the Uno's 3.3 V pin keeps the line idle high without ever putting 5 V on the Nano. The ATmega328P reads a high from 3.0 V, so 3.3 V works with little margin.

Building the bin

The Hammond box contains all the electronics. I started to mount the Molex connectors: one connector gets the power, the other one connects to the Nical under the plate

imageimage image

The signals on the power connector are

  • + 12V (for the NEMA motor)
  • GND
  • + 5V

Currently, I choose to use a PC power supply, which has both 12V and 5V. Next iteration, I plan to power the bin with just 12V and place a step down converter to get the 5V

The signals to the Nicla board are

  • +5V
  • GND
  • DETECT
  • NICLA_TX

Cables passes just behind the bottom mount for the pole, which also hosts the mounting place for the servo

image  image

Then, I mounted the top mount, with the NEMA motor and the coupler for the pole

 image  image
Both the top and bottom mounts have 6804 bearings. I will also add a thrust bearing no to overload the NEMA motor shaft

Then, I installed the board for the TMC5272 and Arduino Nano. I added a sort of "bus bar" made with strip headers, in order to have several pins to connect 5V and GND

image

On the lid, I mounted the CN0569. The part where the CN0569 is mounted has room also for the Nicla board but, in this prototype, the Nicla board will be installed under the plate

image  image

Whats's next

Soon, I will complete the build and

  • Install the LEDs and the Arduino Uno board
  • Install the thrust bearing
  • Install the home switch
  • Mount the servo and the plate
  • Run the first smoke test on the prototype
  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube