Blog 4 - HuskyLens Development - Davin Barron
Sprint Review & Team Alignment
We kick off our development cycles with bi-weekly meetings every Tuesday. These sessions ensure that every team member is fully onboard with the current state of the project.
A major highlight was sharing our individual Bin Bot pitches. It was a chance to step back from the technical how and highlight the why of this project, in other words, what is the purpose of this project and what we hope it'll achieve.
My main takeaway from the feedback was a reminder to just be yourself when giving a presentation, there’s no need to force a monotone professional voice or be over-excited. Authenticity carries the message best.
Planning
During the last sprint, we got together as a team to discuss how we could best divide up the workload among us. I teamed up with Matteo to work jointly on the rubbish detection and leaderboard.
Since these were two separate tasks we agreed to split this work together. I volunteered for the rubbish detection, while Matteo agreed to lead the leaderboard system and Google Classroom integration.Development
HuskyLens
For the rubbish detection, we used the HuskyLens, an AI machine vision sensor equipped with functions like face and object recognition.
My initial plan was to scan barcodes to identify specific products. However, I discovered a technical limitation: the HuskyLens 1 model we are using does not have a dedicated barcode module. Even with such a module, we would still have to manually tag and map every barcode to a value, as it cannot natively retrieve product prices or details from an external database.
Because of this, I decided the next best thing was to use the Object Classification function. I trained the lens to identify four distinct categories:
- ID 1: Plastic Bottles ("P")
- ID 2: Aluminum Cans ("C")
- ID 3: Cardboard ("CB")
- ID 4: General Waste ("G")
Micro:Bit Logic and Classification Training
First I needed to add the HuskyLens extension to my Micro:Bit make code environment.
This can be done by going to the add extension button and searching for HuskyLens in the search bar.
On start we need to initialise the HuskyLens to use the Object Classification function and a radio group that can be used to talk to the master Micro:bit that has the cloud board:
The Object Classification uses IDs. Each object we classify will be assigned to that ID.
To train the item, there is a button on the right hand side of the HuskyLens. By default it lasts 5 seconds when it's pressed but you can train the item for longer if you hold it down.
While the button was held down, I ensured that each item was well inside the box and tried to capture the items from different angles so that it could learn it's shape and texture.
I made sure that the environment I was training in was well lit and used a variety of bottles and cans too.
When an item is identified, the Micro:bit displays a shorthand letter on the LED matrix (like "P" for Plastic)
It will then send a unique value which I associate with each item (1–4) over the radio to the Master board.
While I was using it, I noticed that the HuskyLens would continuously identify an item which could possibly cause some issues down the line. Because of that I integrated a manual trigger into the Micro:bit code. The scan only executes when Button A is pressed.
This ensures the bin only processes data when a user is intentionally recycling, preventing "ghost" scans:
Node-RED and Google Sheets
We chose Google Sheets as a place to store our data due to its accessibility and ease of integration with Google Classroom. The idea is to use Google Sheets to hold the leaderboard rankings but it can also be used to track the amount of waste the Bin Bot collects.
While developing this part of the pipeline, I didn't have physical access to the Master Micro:bit or the cloud board, as Igor was busy upgrading it to include new topics dedicated to the Bin Bot on the Beebotte server.
To keep the project moving, I decided to ingest test data into Node-RED. By sending manual MQTT messages that mimicked the Micro:bit's output (IDs 1–4), I could verify that the entire cloud-to-sheet bridge worked perfectly before the hardware was even finished.
Setup
Google Sheet
Creating a Google Sheet is pretty straight forward. It's as simple as starting with a blank spreadsheet, choosing a pre-built table and editing it to our hearts desire!
Yes, seriously, it was that easy! 😀
Node-RED part 1
To allow Node-RED to write to a google spreadsheet, I needed to download the extension from the palette manager:
A Google Sheet node becomes available, however you'll notice that there is an option for credentials.
It's not an issue if we wanted a completely open spreadsheet that anyone can edit but if we wanted something more secure then we need to address this challenge.
To do this, we needed to create a dedicated service account using Google Cloud. This can get a little hairy so bear with me as I walkthrough how this is done. You might want to grab a coffee! ☕
Google Cloud
1. Setup a new Google Cloud Project:
2. Enable the Google Sheets API:
3. Go to the API service and then go to the credentials option and create a new credential.
Here we can see the service account option, from there we can fill in the details:
4. Then, I created a private key using the service account that I made and exported it as JSON.
From the IAM page, I went down to service accounts and selected the bin bot service account I made to make the key.
This key is the credentials that we will use in the Google Sheets node on Node-RED.
5. Then all we need to do is to share the Google Sheet with the service account and give editor permissions.
Without this step, the system stays locked.
And that's it! Congratulations on making through all of that I know it was a lot to take in!
Give yourself a pat on the back 😎
However we are not done yet, we need to get the rest of Node-RED setup.
Node-RED part 2
I built a flow that acts as the translator for the Bin Bot.
I'm reusing the ingest node that I created from the Node-RED sprint to test this out.
Have a look at my Node-RED blog for the details 😉
I updated the ingestion node to send a numerical payload. You may have noticed the number 1003, this represents the ID 3 which we created earlier in the HuskyLens section plus the 1000 absolute value fix on the master Micro:bit code.
Again have a look at my MQTT blog for more details on that.
This could change with the upgrade Igor is working on so stay tuned for further developments!
This flow simulates the master Micro:bit receiving the HuskyLens data from the slave Micro:bit and sending it to the Beebotte server.
The MQTT In node detects if new data comes into the topic and sends it to a function node that creates a message with the same data as the columns on our Google spreadsheet which we setup earlier.
It converts the raw ID (e.g., 1001) into a readable string (e.g., "Plastic"), get's the timestamp and makes the payload with the timestamp, wastetype and ID.
This is then sent to the Google Sheets node and a debug node.
To finish the Google Sheets node that we started.
For creds we use the JSON key that we created earlier. I opened the JSON file and copied in the text into the field in Node-RED.
For the method we want to append the data into a new row on the spread sheet.
The spreadsheet ID can be found in the spreadsheet URL after /d
It'll be something like:
https://docs.google.com/spreadsheets/d/Spreadsheet ID/
The cells are the columns we want to fill in.
It can be found on the drop down like so:
Then we need the sheet name.
The sheet name can be found at the bottom:
That's the flow finished and we are ready to deploy and test it out.
After running the flow, the data will appear in the debug:
And should also be added to the spreadsheet:
Looker Studio
As I was working on the Google Sheets integration, I thought it would be a great idea to be able to visually see that data in the form of charts and graphs. that's when I came across Looker Studio.
Looker Studio is a free data visualisation tool made by Google. It enables users to create informative, interactive dashboards that are easy to interpret, share, and customize using data that can come from many different sources. Because it belongs to the Google ecosystem, it treats our spreadsheet as a live data source, updating our charts automatically as new rubbish is scanned.
Setup
Creating a dashboard is just as easy as it is when making a Google Sheet.
I started with a blank report and connected my Bin Bot data spread sheet.
That's it! From there we can then start creating our lovely charts and graphs.
Looker immediately recognizes the columns—Timestamp, Waste Type, and ID—allowing us to filter and aggregate the data.
Dashboard
I focused on clear, actionable visuals to encourage recycling:
Pie Charts: To show the overall distribution of materials (e.g., 40% Plastic, 30% Cans).
Time Series: To monitor recycling habits throughout the school day.
This can be extended by Matteo to help in developing the leaderboard.
Google Classroom Integration
The ultimate goal of this setup is gamification.
We can add this live Looker dashboard directly into a Google Classroom page. This allows students and teachers to check their progress in real-time, turning a daily chore into a visible, competitive effort toward sustainability.
Architecture

To tie everything together, I’ve put together a simple architecture diagram that summarises the how the data goes from the HuskyLens to Google Classroom.
The process follows a logical path from the physical world to the cloud:
The Slave Micro:bit uses the HuskyLens to classify the rubbish.
Data is sent via Radio to the Master Micro:bit.
The Master Micro:bit publishes the ID to a Beebotte MQTT topic.
Node-RED listens for that data, translates it into words, and appends it to a Google Sheet.
Looker Studio displays that sheet as a live, interactive dashboard.
Technical Limitations
While I am really happy with the progress made this sprint, I identified some clear technical limitations that are important to document for future development.
The biggest hurdle was my initial plan to use barcodes. I discovered that the HuskyLens 1 we are using does not include a dedicated barcode module. However, even if it did, the system wouldn't be automatically detect and read the barcodes anyway We would still have to manually tag and map every barcode ourselves because the device cannot natively retrieve external product information or prices.
Next Steps
After discussing with the group as to how we can take this project.
We identified that the biggest blocker was the ability to read in barcodes since that was the biggest feature of this project to be able to read in that information and link it back to real products where we can put a value on not just the waste but also the money saved.
We discussed as a group a way to work around this and found that an AI camera from KOI can read in barcodes the way we expect it to. I also mentioned that we can also make use of our own phones to read in barcodes.
Using a smartphone would allow us to leverage more powerful processing and existing barcode-scanning apps, similar to the approach seen on the CARDBOARD ROBOTS YouTube channel. This can be a suitable backup plan if the AI camera from KOI doesn't work out.
Comments
Post a Comment