Go Down

Topic: Need help programming a photocell/relay shield (Read 20016 times) previous topic - next topic

irishluck

You Riva are just awesome!

I uploaded it and its works. I covered the photocell and as soon as it loses light the LED turns on and the relay switches on. Stays for roughly 20 seconds and then turns off.

Riva

Don't PM me for help as I will ignore it.

irishluck

I really appreciate the help.

Ive got a little more work to do to get this project done.
Ill post pictures of the final project when im done with it.

What part of the code do I change again that would adjust the time if I want to?

Riva


What part of the code do I change again that would adjust the time if I want to?

Code: [Select]
#define relayDelay 20UL           // Relay delay time in seconds

To ensure the maths work properly keep the UL on the end of the number or you could change the line to
Code: [Select]
const unsigned long relayDelay = 20          // Relay delay time in seconds
to make it a bit simpler.
Don't PM me for help as I will ignore it.

irishluck

Awesome, thank you again.

Would anyone know how many amps the arduino board actually draws?
And would adding  a shield on top draw more amps?

Go Up