Go Down

Topic: Consistent output with arduino (Read 326 times) previous topic - next topic

MacEide

Hi guys!

I have a little project that i could use some help with. I am quite new to the arduino, and not that steady in the code, but im hoping on getting there!

The project im building is a litte controller that drives a relay output. The controller is connected to a photo-cell that has a two pin output. This output is shorted at various times depending on the movement in front of the photocell.
What i need is for the arduino to close the relay for the same period (say 0,5s) each time the photocell circut is closed. And maybe block a repeating signal from the photocell within 0,5s

Is this possible in some way?

Any help much appreciated!

PeterH


What i need is for the arduino to close the relay for the same period (say 0,5s) each time the photocell circut is closed. And maybe block a repeating signal from the photocell within 0,5s


Connect the sensor so that the photocell state can be read at an input pin.

Write a sketch that reads the input pin state each time loop() is called. If the state has changed from 'open' to 'closed' then close the relay, wait for half a second, open the relay, wait another half second.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy