Close

Detecting when the hopper is almost empty

A project log for Vending Machine for Birds

Simple, inexpensive bird feeder that dispenses peanuts in exchange for dropping stuff in a hole. A vending machine for clever birds.

stephen-chaseyStephen Chasey 06/20/2023 at 13:170 Comments

After making the "daytimer" bit to disable timed dispense at night, I worked on a few ideas to determine if the peanut hopper is getting empty. There are a lot of ways to do this, but since I'm using phototransistors elsewhere I used one to make a sensor that goes under the top baffle inside the hopper.

An IR led on a 1K resistor is aimed at the phototransistor. When the peanut level gets very low the phototransistor will see the IR LED and provide some current to the base of an NPN transistor This lights up an indicator LED and shares the signal with the monitoring header (low signal = low peanuts).

On phototransistors, I tried a few and found that you need one with a photocurrent of at least a few mA. I am using the SFH313FA-2/3 which has a typical photocurrent of 9mA. I am using SFH303FA-2/3 everywhere. A SFH300FA, for instance, has a photocurrent on about 1 mA, is effectively less sensitive and doesn't work as well.

I wanted to avoid putting anything in the hopper with the peanuts, but could not think of a simple solution that could be done from outside. This approach works well enough, is mostly protected since the PCBs are mounted on the underside of the baffle (with the IR LED and PT poking up through 5mm holes) and should not get in the way of dispensing.

Additionally I replaced the LDR in my earlier daytimer design with another phototransistor. Again because I'm already using them elsewhere and because LDRs contain cadmium and may not be available to everyone. I was able to just swap out the LDR for the PT and it worked right away, though I had to adjust the potentiometer to calibrate it a bit.

I don't think there is much more to add for this iteration, so now I need to check, check and check again before sending RevB to PCBWay for fabrication.

Discussions