I always suddenly run out of food. It seemed that yesterday there was a strategic stock of beer, but today it is already gone. And, of course, when you discover that something is missing, you have neither a phone nor a notebook at hand. Not surprising, since it usually happens in the kitchen in the midst of cooking.
I decided to create an apparatus that would allow one touch of a button to note what was missing. The device transmits information about the missing products to the phone and responds if something has been purchased.
In this article I would like to tell you how I collected this thing, what difficulties I encountered and how I came out of the situation.
')
Demonstration of work
Reminder history
I'm not the first to come up with a shopping list on the wall. About the same thing was used at the beginning of the 20th century in America. The hostess noted that ended by inserting pegs into the holes in front of the product name. Assistants in the kitchen bought the necessary and took out the pegs. These reminders looked like this:
I realized that it was absolutely necessary for me to transfer this idea to the 21st century, and I set to work.
System architecture
The system consists of three components:
Board with buttons
Server processing requests
iOS application
When you press the button, the board sends a request to the server. The server saves the status and uses Apple Push Notifications to notify the application. The application requests a status from the server and sends updates about purchased products there. Every 5 minutes the board updates its status from the server.
Board with buttons
The basis of the system is the STM32F051 microcontroller. I use it because of the ease of connection and operation.
As a Wi-Fi module, I chose the RN-XV WiFly . This module is extremely easy to program and use: all you need is power, reset and UART connection.
The board has 35 buttons without latching (that is, the button lets current through only while you hold your finger). Each button contains a small LED.
I used the TL1265 buttons. Each button connects through a separate transistor. This was necessary in order not to exceed the maximum current strength of the shift registers:
Buttons (and their LEDs) are connected using shift registers. 74HC165A for reading the status of buttons:
Unfortunately, the free version of the Eagle CAD program imposes a limit on the size of one scheme. So I had to make several small schemes with buttons, the main control module and connect all this with wires:
On the other hand, the main layer looks like this:
Previously, I hunted schemes at home, but this time I decided to order from OSH Park . Schemes were made in 10 days. There are no complaints about the quality:
In the house there were a lot of old transistors and resistors installed in the through hole, almost all went to this project:
Server processing requests
Perhaps this was the easiest part. The server is written in PHP, uses MySQL for storing state and stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', ...) for sending Apple Push Notifications.
iOS application
Here, too, nothing complicated. Two screens, one with finished products, the other with a complete list:
Housing assembly
I really like the neat corps of amateur projects. The basis of the case for this project was the usual photo frame. Solid glass had to be replaced with custom-cut transparent plastic:
With the inscriptions the case was more complicated. I could not manage either to sign it neatly, or to carefully cut out the buttons for the buttons. As a result, I found, it seems to me, a very elegant solution. Using a laser cutter, I first made holes for the buttons. Then, at a lower power, cut the grooves for the letters. I filled the grooves using pen and white ink. Here is the work process:
So I got three layers:
Result
Here is what happened as a result:
Here is how it looks in the room:
I will be happy to answer any questions about this thing. It would also be great to serve opinions on what can be improved, what you should pay attention to.
In any case, now I am sure that with such a thing the strategic supply of beer in my fridge will not run out!