Pages: [1]   Go Down
Author Topic: Consistent output with arduino  (Read 284 times)
0 Members and 1 Guest are viewing this topic.
Norway
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Fresh and learning..
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: