# help with IR/LED indicator

#### goofrey

Joined Dec 2, 2015
3
I'm new to the world of build your own electronics so I hope this isn't a terrible question. A while back I built an automatic dog feeder with a simple timer and DC motor. The hopper is so large I only need to fill it every two months or so and the last two times I didn't realize it was low on food until it was empty. I want to make an indicator to show when it is getting low so my poor pup wont be without food for a day. Here is a diagram of my Idea and I was hoping I could get some thoughts on if it will work or perhaps a better way to do it. The basic concept is to have In IR LED in the top of the hopper and an IR phototransitor that would be uncovered when the food level got too low and change a status LED (green for food, red for empty).

#### Bernard

Joined Aug 7, 2008
5,788
It should work. Resistors connected to anodes of LEDs are not needed. Add some values & we'll recheck.
It might be difficult to clear off the IR transistor, might it be possible to mount sensors on sides, inside of ben?

#### goofrey

Joined Dec 2, 2015
3
It will be on a 12V power supply and I plan on having the IR transistor near the bottom on the inside of the bin and the indicator near the top with the IR LED showing on the inside and the indicator LED showing on the outside. I'm not sure what you mean by "clear off" the transistor. The transistors I plan to use are 2N2222. I have a difficult time knowing when, where and what resistors to use.

#### GopherT

Joined Nov 23, 2012
8,012
If life of a human or animal is involved, then you need a backup system as well. Add a calendar reminder to your phone to check at least once per week. It seems that the poor treatment of dogs gets you a bigger penalty that poor treatment of kids lately so you better cover your a with something more than a diy electronics project.

#### Dodgydave

Joined Jun 22, 2012
9,954
Use a 555 timer as a photo switch, use a 2 pin bicoloured led on pin 3, with the other side to centre of two 1k resistors across the supply.

#### AnalogKid

Joined Aug 1, 2013
9,257
I think he means clearing of the photo transistor so it can see the IR beam. If the bin is clear plastic, what about putting the emitter and sensor on opposite sides outside the bin, shooting through the food? Also, the circuit complexity can be reduced somewhat either by changing to PNP transistors or by using a common-anode dual LED (or individual LEDs).

ak

#### goofrey

Joined Dec 2, 2015
3
the bin is made of wood because i made it myself, after thinking about it for a while i am thinking i could put both the IR LED and the phototransistor about two thirds the way down the bin but on opposite sides so that the food would drop and uncover them. I plan on using a dual LED though I am unfamiliar with how a common anode LED would work, i thought you could only have a common cathode?

#### AnalogKid

Joined Aug 1, 2013
9,257
Dual LEDs come in both flavors. I prefer common anode because so many comparators have open collector outputs, perfect for pulling down a cathode. Duals also are available in 4-pin packages, where both ends of each diode are available independently, and in 2-pin packages where the LEDs are connected back to back.

ak