Home

Awesome

Reloading Powder Hopper Level Gauge and Alarm

This was inspired by a video by Farrow Tech: https://www.youtube.com/watch?v=m2Si6LQx2WA. The demonstration it is about two years old and I haven't seen anything else like it so I decided to make my own version.

Hardware

My version uses an ESP8266 NodeMCU, a ST7735S TFT display, a VL6180X time of flight sensor, a rotary encoder, and some various hardware.

Libraries and firware.bin

While Farrow Tech was able to make it without libraries, mine uses:

Adruino IDE esp8266 Board Version

As per the comment from dandekalb, you will get compile errors from the Arduino IDE if you have the board version set above 2.7.3. This has not been tested on VS Code with PlatformIO but it is safe to assume the same.

To change the board version in Arduino IDE:

<img src="/images/ArduinoBoardManager.png" width="700" />

To change the board version in PlatformIO (this has not been tested but should work):

In your platformi.ini replace

platform = espressif8266

with

platform = espressif8266@2.7.3

Importing Libraries

Because some of the libraries (mostly ArduinoMenu) are under active development, I have downloaded the versions that work currently (9/4/2019) as zip files for importing into Arduino IDE or PlatformIO. For Arduino there is a import a zip file to library menu option. For PlatformIO with VS Code extract the zip files to the include folder within the project folder.

firmware.bin

If you are running into problems and have all of the wiring done like described in PowderHopperGauge.ino, I also uploaded a firmware.bin file that can be uploaded with nodemcu-pyflasher without the need to import libraries or compile anything yourself. If you make changes to your wiring however, you will need to compile the program and the firmware.bin file will not work for you.

New for this version is the inclusion of the serial interface. If you are having issues with the click encoder rotations not registering but the clicks are working, you can use the serial interface to navigate the ArduinoMenu options.

Rotary Encoders

The most difficult troubleshooting seems to be with rotary encoders. I have tried four different kinds and have found success with two of them. There are two seperate issues that have come up: how the rotary encoder counts pulses and how the circuit uses pullups and capacitors.

Rotary Encoder Testing

From bristolwatch.com, a diagram of what the rotary encoder should do for each "click" (the dashed vertical lines are each a detent that the encoder stops in):

<img src="/images/Encoderth.jpg" width="550" />

I wrote a simple sketch to output the voltage of each pin the encoders are wired to. It is from some code by Random Nerd Tutorials and adjusted for rotary encoders. It needs an ESP32 and the encoder needs to have the CLK and DT pins on any of these red-highlighted pins:

<img src="/images/adc-pins-esp32-f.jpg" width="550" />

Once you upload and run it, the serial monitor will tell you the voltage of each of the two pins. As you rotate the encoder slowly, you can see what each one does. Ideally, they should both start high (4095 on ESP32) and as you rotate one will drop to low (0) followed by the second pin, then both will go to high one after the other in the same order as you finish the click. Rotating slowly the opposite direction should show the leading pin is now the trailing pin going low and high. The half step encoder shown above only does half of that each click and so it doesn't work reliably with the ClickEncoder library (menu selection will jump down and then back up with each click).

Building and Wiring

Use a breadboard and jumper wires to make sure everything is wired correctly and test the sketch.

<img src="/images/20190908_182504.jpg" width="550" />

When you are ready to install it in the enclosure, use jumpers between the VL6180X sensor and the ESP8266, desolder the pins on the TFT and Rotary Encoder and directly solder the jumper wires from the ESP8266 onto each. I used some hot glue to protect the connections and provide some strain reliefe on them.

<img src="/images/20190830_080819.jpg" width="550" /> <img src="/images/20190830_080829.jpg" width="550" />

Install the four 3mm nuts in the enclosure. Lower the assembly from the top and slide the TFT and ESP8266 into their slots and then install the VL6180X to the bottom cover. Optional If you are using the version with the buzzer, lower the buzzer and install it in the hole (it should be a tight press fit) as you slide the assembly in. I found some hot glue around the edges kept the sensor nice and level when securing it down to the base with screws.

<img src="/images/20190311_131357.jpg" width="550" />

Screw the bottom cover in place.

<img src="/images/20190311_144628 (1).jpg" width="550" />

Next install the screen's 2.5mm screws and nuts and the rotary encoder to the top cover. Last, install the top. The fit is tight so I suggest testing to make sure all the connections are still secure as you do each step.

<img src="/images/20190311_144654 (1).jpg" width="550" />

Adjusting to Your Needs

The STL is included for the Hornady Powder Hopper as well as the Dillon and the original design file is on Onshape if you want to make a copy and adjust the design for another brand of powder hopper: Onshape Design