Trigger a mechanical switch on a daily schedule

Hey everyone,

First post here! (And this will also be my first project with an Arduino)

I'm hoping someone can help me with figuring out the hardware necessary for a little project: I want to trigger a mechanical switch latch* twice a day at two specific times. I have an UNO R3.

I'm going to have a little box that holds my dogs food bowl. The box will be closed and latched (somehow) and will feature a couple piston arms that will push it open when the switch latch* is released.

So to keep it simple I just need to have the UNO attempt to trigger the switch latch* twice a day. I'm not concerned with the programming (I'm a programmer by profession). I can definitely learn and figure that out on my own. The issue is I'm no hardware expert! So I'm looking for some recommendations on a switch latch* that might work for this, and can interface well enough with the UNO.

Also any other hardware you think I might need or any thoughts and tips are greatly appreciated!

Thank you for your time!

by mechanical switch, do you mean a physical switch that turns on and off an electrical contact?

That is how i am interpreting it.

I am also assuming that you want a physical switch to press for manual control. I would suggest using a relay with the contacts in parallel with the mechanical switch. This will act as a logical OR, so either you can control the device OR the microcontroller can.

do you mean a physical switch that turns on and off an electrical contact?

I actually meant to say "latch" not switch.... Like I said: very much not a hardware expert! :stuck_out_tongue:

But that is actually a great point you bring up, that I would need a way to trigger the latch manually...

I would suggest using a relay with the contacts in parallel with the mechanical switch. This will act as a logical OR, so either you can control the device OR the microcontroller can.

So I would have a relay that accepts a signal from either the controller, or a trigger (button, switch, something) and passes it along to the latch either way? Correct?

So it would function like a sort of "Y"? Two options for input with the same resulting output?

Look for door lock actuators. You can get them designed for car doors or building doors. Depending on what you find you would have a different plan but I'd think you could have a spring-loaded lid that pops open when the Arduino pulls the latch bolt.

There must be a hundred pet feeder projects posted online. Pick one you like. Most of them will have terrible code and terrible security against a determined dog but there will be lots of useful ideas.

How precisely do you need to time the opening schedule? The Arduino's internal clock is not very accurate - it will drift off by minutes per day but it's perfect for simple tasks like "Do this 24 hours from now." For keeping aligned to wall-clock time over periods of days or years, you need an RTC module. "Real Time Clock"

Look for door lock actuators

Will do! Thanks! Anything I’d need to look out for specifically when picking one? Preferable voltage?

How precisely do you need to time the opening schedule?

I guess it would need to be pretty specific… maybe I’ll look at adding a timer to it. So I could just start a countdown if I’m going to be out at feeding time. I’ll look into RTC modules as well!

Thanks for the info!

I'm not 100% following...

You just need/want a way to dump the food in the dish (twice a day).. and close it after the 'dump'.. correct?

(Not completely following the trigger vs controller comment,, are you sayign you also want a manual way to 'trigger' the effect/behavior WITHOUT the arduino?)

In my mind.. this should be that hard.. (mechanical engineering aspect aside for the actual food holder stuff)..

Get a servo (once with enough torque to move the object/flap/latch/box..etc)... Get an RTC (real time clock module) Already got your Uno R3

(some other minor supporting components, like some voltage regulators for the servo..etc)

At a specific time of day (thanks to the RTC)... you move the servo to a specific position/angle.

This moves a 'latch' (bar, ruler, piece of plastic) from under the box... the food falls down into bowl.

Move the servo back.. which closes the box (maybe a latch is not optimal.. and a gear might be better served?)

Done.

That being said.. I think you are missing some key steps in the whole process..

going off of the above..

this feeds the dog once.

Now the 'box' is empty of food.

How does it get 'populated' again with food.. to drop at the next interval?

I would imagine with some time/thought.. you could make something mechanical that drops more food into the box on the 'close' step..

That stuff is not really Arduino related however.. and is really up to your ingenuity and the materials are you working with..

I believe the basics can be done with the above hardware:

Arduino Servo RTC

OscarWilde: I actually meant to say "latch" not switch.... Like I said: very much not a hardware expert! :stuck_out_tongue:

But that is actually a great point you bring up, that I would need a way to trigger the latch manually...

So I would have a relay that accepts a signal from either the controller, or a trigger (button, switch, something) and passes it along to the latch either way? Correct?

So it would function like a sort of "Y"? Two options for input with the same resulting output?

Ah, yeah I had a feeling you weren't talking about an electrical switch. You could use a servo to unlatch the door. Or you could use a pulley system with a dc motor or stepper motor. There are a lot of ways to go about moving a door.

As far as the relay in parallel, it would honestly be easier to just add a stand alone switch and wire it into a digital input pin and handle the rest in software. I only mentioned the relay because I misunderstood the question.

xl97: I'm not 100% following...

You just need/want a way to dump the food in the dish (twice a day).. and close it after the 'dump'.. correct?

Even simpler than that! I fill the bowl myself and then close the box. No filling necessary! Just imagine it like a spring-loaded "chest" where the Arduino controls the latch.

So if he eats at 5pm and I'm going out somewhere at 4pm and won't be back in time to feed him, then I just fill the bowl with food and shut the lid. Then at 5pm the Arduino triggers the latch and it springs open letting him eat!

But your advice seems like it would still apply anyway. Servo motor is triggered by the RTC and instead of sliding plastic to release more food, it just releases the latch. So Arduino, Servo, RTC, and a latch of some kind. Thanks xl97!

dustin02rsx: Ah, yeah I had a feeling you weren't talking about an electrical switch. You could use a servo to unlatch the door. Or you could use a pulley system with a dc motor or stepper motor. There are a lot of ways to go about moving a door.

As far as the relay in parallel, it would honestly be easier to just add a stand alone switch and wire it into a digital input pin and handle the rest in software. I only mentioned the relay because I misunderstood the question.

Okay, Servo motor seems like it might be the simplest method for me! Is this all just stuff I can grab off Amazon, or is there somewhere better you all tend to get your hardware?

Thanks for your help!

Sparkfun and Adafruit are great resources for the more "electronic" parts of the project, such as the RTC. While you can get exactly the same things off eBay and Amazon, those two sites are curated so the one RTC module they offer is actually a good one for your purposes.

Servos can be bought from hobby shops, including online ones such as Hobbyking.

Power supplies, if you don't know what you need should be bought from Sparkfun or Adafruit. Once you've got some idea of what you're looking at then eBay and Amazon become useful resources.

For general components like resistors and capacitors, start with a pack from Sparkfun or Adafruit. Their grab-bag or "kit" will have 99% of what you need. When you need a different value than what's in the kit or it's time to refill the one value you used all the time, I go to the big electronic warehouses: Mouser, Digikey, Element14, Newark... You can also get the same stuff off eBay (eg 1000 1k resistors for $1) but you can never depend on that seller to still be there 2 years from now when you want to buy the same thing again. Mouser and the other big ones will be there forever with identical reliable parts.

^ boom!

....and just like that! you're on your way! :)