You just returned from the grocery store, and suddenly it dawns on you that you’ve forgotten to buy a basic item like milk or toothpaste that has run out. Your only choice now is to live without it until you go shopping again or to turn around and go back to the store once more…

For a school assignment, I developed a prototype to address this issue once and for all.

The idea: A device you attach to or place near the garbage bin(s) that allows you to scan the item before throwing it in the trash. When it’s time to do groceries, it’s as simple as checking the automatically created grocery list on your phone to see which items have run out. As a bonus feature, I included a prompt on the screen that tells you in which of the recycling bins you have to dispose of the used product.

Requirements

In addition to using NI LabVIEW, there where some requirements that need to be fulfilled:

The program must contain/perform/use:
a. Calculations/comparisons/algorithms
b. Different datatypes (+ arguments to support the choice of the main datatypes used)
c. Several logic structures (e.g. loop structures, cases etc.)
d. Choose:
I. Data acquisition
(coupling to physical hardware, e.g. using a MyDAQ/Arduino etc.)
II. Data communication
(communication using a protocol like TCP, UDP, Serial etc.)
e. A (visually appealing) GUI with relevant controls/indicators
f. Self-build SubVI’s

These requirements shaped how I designed the device, as I wouldn’t have created it the same way otherwise. The most logical approach was to avoid using LabVIEW and instead create a standalone IoT device, rather than it being a peripheral of a software application.

Hardware

The hardware comprises an OLED I2C display, barcode scanner, IR transceiver, I2C keyboard module, and an Arduino Nano board. The Arduino Nano runs basic code to detect an object with the IR sensor, activates the barcode scanner, prints the barcode data to the screen, and sends it over serial via USB, to be further processed by LabVIEW. The keyboard is intended to enter new items into the database, but this function wasn’t implemented further, as it is meant as a proof of concept and the focus of the project was explore LabVIEW. New items can be submitted via the LabVIEW interface, however.

LabVIEW interface

LabVIEW is renowned for its versatility in graphical programming and data acquisition. It is widely recognized for its application in engineering, automation, and scientific research. What makes LabVIEW particularly appealing is its user-friendly graphical interface, which allows for easy design and implementation of complex systems. The visual programming language simplifies the development process, making it intuitive for users to create applications and interface with hardware. In the context of my project, LabVIEW provided a seamless integration platform for processing data received from the Arduino Nano, enabling efficient communication and further analysis of the collected information. Its user-friendly features made the development process enjoyable and accessible, contributing to the success of the project.

I started off with creating a Vi (LabVIEW’s version of a function) that can find a barcode in a list

This VI provides the core of the project, but a lot more work is needed to achieve the end result. If the barcode isn’t in the table, a new entry will need to be appended. This is where the next VI comes in handy. It checks if all the fields are filled in so the entry is complete.

If all the fields are filled in, the data needs to be added to the file. This is where the next VI will take over.

All the items on the grocery list will be added to a long array. To clean up the list, it gets sorted, and blank spaces are removed by the following Vi.

When the list is finalized, it needs to be published to the web. This is done via FTP to a website where the text file can be viewed. The last VI handles this.

Finally, all these functions are strung together by, admittedly, a mess of wires, resulting in the complete “code.”

Designing a quick GUI hides all the mess and delivers it in an understandable program: