The Next Pi Project: Smart Pantry

The Next Pi Project: Smart Pantry

As new ideas come to me, I have to come up with new solutions. My latest problem to solve is how to know what is in our pantry when I can’t easily see what is all the way in the back. We used to have a slide out shelf in the pantry, but it used about half the space, made it difficult to know what was on the back side, and it was just a pain. So I tore that thing out. I replaced it with a simple wire shelf which made a lot more available space and just starting putting things in there. Its not in any order, cans are by cans and boxes by boxes, but that’s about it. So how do I manage things in there to make it easier to know what we all have and what we need to reorder?

In Comes the Raspberry Pi

I want to be able to know what is all in the pantry, know what we need to reorder and when we are getting low on something, and be able to order it when low. But how to do all that? Its simple really, especially since I have experience with web development.

I originally thought about getting a Pi Zero, a touchscreen monitor, and mounting it inside the door so we can just tap on an item when we take it out or add it to the pantry. It would be complicated to write a whole application from script, so the easiest option would be to make it a web page. This allows two things. First, I can use an old Android tablet I already have since it is a touchscreen, it has a web browser, and it has a battery so it doesn’t need to be plugged in all the time. Second, I don’t need the Pi to actually be in the cabinet which means I can put it in the electronics cabinet and have it connected to the network over ethernet instead of wifi.

Furthermore, by just having the Pi run as a web server, I can make a separate page for our laptops, so when we need to order something, I can go to that page on our local network and see what we all have in stock and just click on an item and have it linked directly to the preferred site to purchase it from and added to the cart. I can customize that page however I want, make it as easy as to use as I like, and then when things arrive, its a simple matter of adding them to the database through a few clicks on the tablet or on our laptops if we want.

With a Pi Zero, its only a $5 expenditure for the board. We have plenty of micro USB cords for power, so that’s easy. I would need a micro USB to USB adapter though, and then a USB to ethernet adapter to connect it to the network. I’d also need a microSD card, but those are about $10 for a 16GB card, which should be more than enough. Then I’d need a case (another $5-10), and a maybe a micro HDMI to HDMI cable which I could use later. Since it will be run headless and I already know how to turn on SSH without logging into it directly though, I can get by without that. So all together, it adds up to around $35. Not a lot, but I can do better.

Consolidating Pi’s

I don’t want to spend any more money than I have to, especially considering we don’t have a lot of money to spend anyway. I already had the idea to add a file server Pi to the network, so I had the epiphany that I can simply add a web server to that Pi and not have to buy anything extra. That other Pi is already going to be purchased soon, so adding a simple web server to it isn’t a big deal. Its not like that Pi will have outrageous demands on it since it will pretty much just be running r/clone to backup our files to OneDrive once a day or so and running a web server for just a few clients does not require much. Plus, since that Pi will have a hard drive attached anyway, it’ll have plenty of room for the database and images. Not that it’ll take up that much space, but putting it on the hard drive instead of the SD card will help.

Functions of the Pantry System

Now, what does this website all need?

First, we need a page for the tablet that will be hanging in the pantry. When we take items out to use, we tap on the screen what we are taking out and it gets subtracted from the database. Second, we have the laptop page for our computers. It will display a list of everything that we have in stock and common items that we don’t have in stock. If we want to purchase something, I can code in a link to a site that has the best prices since we usually order the same stuff from the same places.

Also, I’ll have to add the ability to add new items. We may occasionally order something we’ve never ordered before, so we need to be able to update the database to reflect that. We can also keep track of how many items we use a month or year or whatever and know our costs.

Finally, whenever I place an order, I can save the receipt as a PDF, upload it to the web server, and keep a record of what we have all bought. I might even be able to set it up to track prices and how much we’ve spent on certain items over time.

Issues with the Pantry System

The main problem I see with this system once it is set up is user error, or rather, lack of using it. If we take something out, we need to tell the system that to keep the database up to date. If we aren’t entering or removing items, it’ll never work. We will have to get in the habit of clicking on whatever we are using or adding to keep it accurate.

Other Features

This Pi is going to have other functions as well. Its going to keep its original purpose as a r/clone OneDrive backup, I don’t want to forget that. Its also going to work as a file server for items we want locally stored and not online. I might also add a download feature for large files to run in the background.

And that, is it. Now I need to figure out how to setup a web server, set up the database, set up r/clone, build the actual web pages, and make it all function together. Not too difficult since I’ve done web design before, but it’ll take some time to make it all work.

Written by 

Eric is a dedicated technophile and strives to make things in Sleipnir as innovative, simple to use, and convenient as possible. He has worked a variety of jobs, from construction and manufacturing to working as a civilian in a law enforcement agency. He is an avid tabletop gamer and builds websites in his spare time.

Related posts

One thought on “The Next Pi Project: Smart Pantry

  1. […] that doesn’t need to go to OneDrive, plus I’ll be adding a web server and a database for our Smart Pantry project. That database shouldn’t be very large though, its not like we are running a business here, we […]

Leave a Reply