This project is an remix of my Coke Machine Can Level detector, (https://www.instructables.com/id/Coke-Machine-Can-Level-Detector/) with new sensors, and the addition of spoken sound!
After I made my first level detector, I added a piezo buzzer to give audible feedback for the visually impaired. It worked, but was kind of, meh… What did each particular sound mean? It needed explaining so wasn’t too practical as a solution. I left it and went off to do other things.
Recently, I made some Portal Turrets that used the DFPlayer Mini MP3 player (or MP3-TF-16P). That project worked out pretty well, and when getting a beverage out of my Coke machine one day, it dawned on me: I could use the DFPlayer chip with a speaker and finally get the solution I originally wanted to help the visually impaired! It would do what it originally did, but would now SPEAK the level in the machine as well!
I also wanted to use the VL53LOX sensors to change things up. I knew that they used the I2C bus, and they all used the same address, so it was an additional challenge to use 2 of them, along with the LCD screen on the same bus.
So now, this version provides the same graphical display when approaching the machine, but when you get a little closer, it will also tell you how many cans are left! I set it up this way with a relatively short speaking distance to avoid nuisance trips when I’m working around the machine.
In my mind, this is a cheap platform to provide audible information from various sensors. There is lots more room in the box and on the Nano for other sensory inputs. Now it’s just a matter of coming up with other applications!
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Printed Parts
The physical design of the box is pretty much the same as the previous design, but I had to move things around to include the DFPlayer chip and the 4cm speaker as used in the Turret project.
The components are printed in the same way as my previous build, with the red/white faceplate printed using the Prusa multi colour print website: (https://www.prusaprinters.org/color-print/). I still don't know if this gcode inclusion will work on other printers without the multi-colour add-ons, but I like the result!
The dimensions are the same as the previous build, which means that you could interchange the printed parts (faceplate and sensor holder) and use whatever sensor combinations you like: HC-SR04 or VL53LOX. The difference will come down to code!
The top and bottom shown here work together, so they are not interchangeable with the old design.
Step 2: Electronics
Here is a list of the inner parts on this build:
- Arduino Nano
- Kuman 0.96 Inch 4-pin Yellow Blue IIC OLED (SSD 1306 or similar).
- VL53LOX (qty: 2 for this version)
- generic 5.5mm x 2.1mm DC Socket Panel Mounting connector (see image)
- 4cm speaker, 4Ohm, 3Watt (part # CLT1026 or EK1794 on Amazon)
- DFPlayer Mini MP3 player (or MP3-TF-16P)
- A little bit of wiring
The 2.1 plug connector is optional, as the unit is wired such that it can be powered through the Nano.
Given the power draw for the speaker and other components, a good power supply is needed now as compared to the previous design.
Step 3: Wiring
Most connections are soldered together directly with wire. The areas that require multiple connections are the 5V power feeds and GND connections to sensors and devices from the Nano. The same applies for the I2C bus to the sensors and LCD screen. I soldered them together and used shrink-wrap to keep it somewhat tidy and to prevent shorts.
I like to pre-wire the individual components, then make the connections between them and to the Nano. In the end, I made some of the connections using plug in connectors, like to the LCD screen. It means I can replace them easily if they burn out, but since the display only comes on when someone is in front, it should be a long while.
Step 4: Mechanical Assembly
This device is designed to be assembled with no fasteners. The little nibs or pins on the top cover are delicate and may break off. I designed it this way so that you could drill them out and use 2mm or similar screws if desired. I only add the cover once I’m finally done and haven’t had to resort to screws (even though I’ve broken a few locating pins) as the locking hooks do their job.
The top cover with hooks is designed such that you squeeze the bottom sides where the hooks engage the bottom plate a little bit to disengage them and remove the cover. To make this easier, you could drill out the holes a little bit where the pins go in. That would make assembly/disassembly easier.
The nano and the DFPlayer will snap into location pretty easily. The power connector is pushed through and the nut locks it into place. The speaker just slips into the printed cradle. The VL53LOX is press fit into the cover and the separate sensor holder. Once they’re pressed in, they don’t move. (don't forget which way the sensor has to point, and don't forget to remove the little plastic film on the sensor before installing!) The same is true for the LCD screen, but it may need some finagling if the PCB dimensions from the supplier are a little different than the ones I use. (I’ve tried some which have slightly different dimensions.) I might add a version that will use 2 screws and a strap as I’ve done with my Master Turret Controller.
Step 5: Code
The code started out as from my first build, but then got changed around. I use the same libraries for the LCD screen, but needed to incorporate the VL53LOX and the DFPlayer libraries. I originally tried the Adafruit library for the VL53LOX sensors, but they consumed ALL of the memory on the Nano before I could finish my code! I had to abandon that library and go with something that consumed less memory. The resulting libraries used are much leaner and leave room for more sensors! A much better outcome.
I tried to break up and comment the code where it makes sense, so hopefully it should be pretty apparent as to what’s going on in there. As usual, this project took a bit of research to figure out how to make the libraries do what I wanted. When searching for answers, I find the search results are mostly the problems people are having and not examples of solutions to their problems. Hopefully you will find these examples useful. I've included some as comments in the code.
The sounds I use are attached as a zip file. They are just recordings of me saying "You have..." [number of cans] "remaining." The files are used the same way as my previous projects, with the files saved as 0001.mp3, 0002.mp3, etc. In this case 0001 is just a reading of the number "one" to correspond to the number read aloud.
I started looking for good quality sound files of someone reading from 1 through 30, but the goods ones I found were behind paywalls and such, so I just grabbed an old Mic, plugged it in and recorded myself counting. Then I cut up and saved them as mp3's using Audacity. Pretty straightforward to make a simple solution. The fun is in incorporating other recordings or sounds! Have fun here!
Step 6: Final Thoughts
This was a pretty quick redesign, since it came off the back of the Portal Turret project, and I kept much from the original design. While originally made to keep tabs on my beverage supply, I hope that this simple box can be used for other purposes where sensory information is needed, either displayed or spoken.
Let me know if you come up with other uses for this simple platform!
Participated in the