# How to use a photo cell to open and close a chicken coop door

#### marcovlusa

Joined May 12, 2021
25
Yes, I was getting to that, but its a big step for Marco I suspect... plus I doubt the coop has an internet connection!

With a bit of leeway and given the location which generally has (I'm led to believe) reasonably constant weather a simple light detector should work (its useless here in UK!)
Here you are, the relay user's manual. Hopefully, you can understand the kind of odd English translation.

#### Attachments

• 438.1 KB Views: 5

#### marcovlusa

Joined May 12, 2021
25
By the way, right now, I'm using the module number six of the relay to turn on and off the synchronous motor every 12 hours.

#### Irving

Joined Jan 30, 2016
3,190
Here you are, the relay user's manual. Hopefully, you can understand the kind of odd English translation.
No problem, perfectly clear...
Timing mode 12 to generate 1min of motor action on an incoming high-level (5v) pulse from the photocell.

But to be honest, by the time you've created the solution to generating a trigger pulse from the sunrise and (delayed) sunset edges of the photocell output you could do the whole thing fairly trivially with a $5 Arduino microcontroller (though I'd probably use something better), a 5v USB adapter and a relay module. Add a light-sensitive resistor and a couple of other parts and small display to see what's happening and your total cost is probably <$25 tops. And, sadly, the timer is redundant.

#### marcovlusa

Joined May 12, 2021
25

#### marcovlusa

Joined May 12, 2021
25
The Arduino is a small microcontroller that can be programmed to do almost anything. It is beloved (and hated LOL) by the Maker community as being a cheap way to get intelligence into a project. It can act as a timer, measure light levels (with an external sensor), control motors (via a relay), check switch inputs and drive a small display and much more. And run off a cheap 5v USB adapter.
A few minutes ago, I read an article about Arduino, but I'm not lectured on C language which supposedly Arduino uses. Nonetheless, I can make an effort and learn it. So, I'll be able to build the automatic chicken coop does. Moreover, I'll be able to teach people from those communities to use Arduino. Somehow, it will help them. Is there a place on the internet that at least I can learn the basics of Arduino programming?

#### Irving

Joined Jan 30, 2016
3,190
A few minutes ago, I read an article about Arduino, but I'm not lectured on C language which supposedly Arduino uses. Nonetheless, I can make an effort and learn it. So, I'll be able to build the automatic chicken coop does. Moreover, I'll be able to teach people from those communities to use Arduino. Somehow, it will help them. Is there a place on the internet that at least I can learn the basics of Arduino programming?
Wow, thats quite impressive.

How many motors are you going to be able to salvage\recycle? That seems like a limiting item, as your design is predicated on that specific motor or type of motor...

#### marcovlusa

Joined May 12, 2021
25
Please, forgive me for all the typos or odd words that are found in my postings. My phone changes the words as I type these messages.

#### Irving

Joined Jan 30, 2016
3,190
A few minutes ago, I read an article about Arduino, but I'm not lectured on C language which supposedly Arduino uses. Nonetheless, I can make an effort and learn it. So, I'll be able to build the automatic chicken coop does. Moreover, I'll be able to teach people from those communities to use Arduino. Somehow, it will help them. Is there a place on the internet that at least I can learn the basics of Arduino programming?
What programming languages do you know? Some of the other candidate microcontrollers can be programmed in Java, Python, C, C++ .

There are many YouTube tutorials, I wouldn't get too bogged down by that...

#### marcovlusa

Joined May 12, 2021
25

#### marcovlusa

Joined May 12, 2021
25
If you know Java then programming in C/C++ is very similar, it won't be a problem.
Ok, then I'll look for some basic lectures on the internet to start learning about C/C++ programming

#### Irving

Joined Jan 30, 2016
3,190
By the way, I tried to salvage also printer motors, but theur price US$20-$30each was too high compared with the synchronous which cost US\$5 each.
I'm liking the thought and effort that's gone into this so far...