Hayfeeder: use electronic locks on timer

Hello,
I'm a newbie here. I've seen some projects with arduino from my kid at school and this got me interested...
I've got a litle project witch is to complicated for him. (but want to do it with him.)

Could anybody give me some tips? (remember the newbie part :slight_smile: )

I want to make an automatic hay feeder, 4 compartments that should open on specific times.

1st at 10h
2nd at 13h
3rd at 17h
... etc

basically that's it, if someone likes to help me all the way, ideally what i want:

LCD screen with time, and possibility to use this screen and buttons to set the time and the timer which will activate the relays and so also the locks. (so that I don't need computer only for the first upload)

I'dd like to use 220V AC current.

Attached all the things I think I need (correct me if I'm wrong)

Arduino ofcourse (uno ok? ) (1pc)
transfo from 220ac to 12v 8.5A DC (if I'm not mistaken ok for arduino / locks?) (2pc one for arduino and one for the 4 locks together? )
relays (4 pc )
ds 3231 (4pc - 1 per relais? )
4 locks
LCD screen (1pc)

If someone could explain or draw a plan on how to connect

maybe some pointers codewise? (I'm gooing to have to guide my son (12years))

As described the project doesn't sound very complex. An Uno would suit fine. You only need one RTC. Use logic level MOSFETS to control the locks. That avoids the mechanical relays that require current to hold closed and are more prone to failure. Relays need transistor drivers anyway, why add complexity? The LCD could be a simple 2 line character LCD like a 1602 (2 line 16 characters per line). Depends on how much data that you want to display. Those displays can be 4 bit parallel or I2C interface. I would use the 220ac to 12v 8.5A DC for the lock power supply and a 5V cell phone charger for the Arduino. Since you are switching inductive loads that isolates the Arduino from the potentially noisy lock supply.

Break you learning about the project down into small parts - for example how to control a relay, how to get things to happen at a particular time, how to display "hello world" on the LCD screen etc. When you can do all the parts separately then you can start integrating them into a single project.

Have a look at Planning and Implementing a Program

If you want things to happen in sync with clock time you will probably need a Real Time Clock (RTC) module as an Arduino is not an accurate time keeper over longer periods.

The PIghixx website has lots of diagrams about connecting things to Arduinos

...R

thanks, "the logic level MOSFETS", is a peace of code right? not a component? so I don't need relays... interesting , saves me a lot of wiring :slight_smile:
the lcd screen is not the best option?

so arduino to screen
arduino to timer
timer to 4 locks right?

"the logic level MOSFETS", is a peace of code right? not a component?

No. they are components. Logic level MOSFETs are switching transistors that can be switched by an Arduino output. They replace the relays.

the lcd screen is not the best option?

There are literally dozens of different displays. The ones that I mentioned are, probably, the simplest to use. The best display is the one that displays the data in a manner that you want. Best is up to you.

screen to arduino
timer to arduino
arduino to 4 locks

The Arduino reads the RTC and when it is time (from the RTC data) the Arduino signals the MOSFETs to energize the locks.

Ok i see, but here i have to work also with resistors? ยต4 mosfet switches? one for each lock ?

I already have a lcd screen from my son (see attachment in first post. )

"the project doesn't sound very complex" it is to me , and ceeps getting more complex with every answer :slight_smile:

seabert:
"the project doesn't sound very complex" it is to me , and ceeps getting more complex with every answer :slight_smile:

Reply #2 was intended to be be an antidote :slight_smile:

...R

Robin, Antidote isn't helping :slight_smile:

just don't have the time to start from scratch :slight_smile: (even though I have to)
I want to support/help my son (and make sure he makes the right decisions... )
It has to be ok the first attempt... 12 year-olds don't have the persistence I'dd like them to have :slight_smile:

seabert:
It has to be ok the first attempt...

I have never been a professional programmer but I have a bit more experience than you. My stuff NEVER works at the first attempt. Maybe at the 20th if I am lucky.

To my mind setting as a target "ok the first attempt" is a signpost to failure. It would be like tackling Mont Blanc for your first experience with climbing.

Experienced programmers develop things in small pieces, testing as they go. The programming style in my Planning and Implementing a Program
is intended to facilitate that.

...R

PS ... be sure to create space for your 12 year old to be better at this than you are

seabert:
It has to be ok the first attempt... 12 year-olds don't have the persistence I'dd like them to have :slight_smile:

In the handful of replies so far you've glimpsed some of the varied bits of knowledge needed and things to be attended to even for simple projects. Starting from where you are, *It has to be ok the first attempt... * is a recipe for frustration.

My two cents - before purchasing any components beyond the Arduino for this project, learn your way around the IDE and the first five sketches in IDE/file/examples/digital. In fact, using your parts list as a guide you could put together a working sketch using print statements to the serial monitor to simulate your lock outputs.

YMMV

Hello,
I'm back with a question...
I have my arduino, code and everything working, but it seems that my locks are not strong enough to open with the weight of the trapdoor and hay on it... (in video test without hay, that is realy the limit)
(for the test they open all at once, but normaly they will open one at a time on the timer)
Anybody good idea about opening mechanisme? (min 2kg of force)

  • Magnets to hold doors isn't realy an option because of the risk of heat (constant power to hold door shut and so heat -- > not good mix with hay)
  • push-pull solenoid didn't find a strong enough...
  • ...

Thx for your input

seabert:
Robin, Antidote isn't helping :slight_smile:

just don't have the time to start from scratch :slight_smile: (even though I have to)
I want to support/help my son (and make sure he makes the right decisions... )
It has to be ok the first attempt... 12 year-olds don't have the persistence I'dd like them to have :slight_smile:

In my 35 years of professional computer programming, I had ONE program that worked correctly the first time. And that was just a report printing program. Others have taken up to 18 months to get the bugs out. So don't expect your programs to be any different.

Paul

seabert:
Anybody good idea about opening mechanisme? (min 2kg of force)

Maybe a linear actuator operating through a lever/bell crank?

dougp:
Maybe a linear actuator operating through a lever/bell crank?

What do you mean with bell crank?

seabert:
What do you mean with bell crank?

Do you not have access to Google images..??

Not a good idea at your level of knowledge to be mucking around with mains voltages either.

seabert:
I have my arduino, code and everything working, but it seems that my locks are not strong enough to open with the weight of the trapdoor and hay on it... (in video test without hay, that is realy the limit)

Add some physical support that takes the weight of the trapdoor so it is not resting on the locks. Locks should be there to prevent a door being opened. They should not be carrying a load under normal circumstances (only when the thief tries to force the door open :slight_smile: )

...R

seabert:
Hello,
I'm back with a question...
I have my arduino, code and everything working, but it seems that my locks are not strong enough to open with the weight of the trapdoor and hay on it... (in video test without hay, that is realy the limit)
(for the test they open all at once, but normaly they will open one at a time on the timer)
Anybody good idea about opening mechanisme? (min 2kg of force)

  • Magnets to hold doors isn't realy an option because of the risk of heat (constant power to hold door shut and so heat -- > not good mix with hay)
  • push-pull solenoid didn't find a strong enough...
  • ...

Thx for your input

do you have links to that lock ?
what is the mechanism that drives it ?
a Simple DC motor with a screw would spin and have a rod extennd into the space and be the stop that holds the door up.
then you spin the motor, the scrrew retracts and the pin is withdrawn.
most of the answer lies in what you have and can get easily.