Newbie to electronics and am looking for help with a project I'm working on. I have a 12 v light detecting relay module which I'm using to drive a 12v motor in h bridge relay figuration, taking the + signal from the n.c or n.o contacts of the light sensor relay to drive the motor in one direction or the other until reaching a switch cutting the power to the motor driver.here are my issues.

  1. Power consumption.. As the relay of the light sensor is activated the whole time during daylight hours the battery(12v 2.3ah)is not lasting very long.

  2. The light sensor keeps flicking from on and off at the switching point.is there a way of latching the relay(or by using other components)once the trigger point is reached then resetting once the light sensor deactivated

Can I some how use the signal which switches the light sensor transistor, to operate an ic or some other arrangement of components to achieve the function I require-being

To drive a 12v motor (using a 12v 2.3ah battery)forwards and backwards which open/closes a door with relation to if it's light or dark?

As i said i am very new to electronics so have no idea where to even start looking for the info to solve my problem so any help would be much appreciated

  • \$\begingroup\$ In simple words can you explain what you want to happen functionally - don't mention relays or light sensors. take a step back and give us your real end-user needs. \$\endgroup\$ – Andy aka Oct 15 '13 at 11:10
  • \$\begingroup\$ I think he wants to open or close some kind of door during the day. \$\endgroup\$ – 1p2r3k4t Oct 15 '13 at 11:37
  • \$\begingroup\$ As 1p2r3k4t said I wish to open a chicken coup door at sunrise and sunset with a 12v dc motor. \$\endgroup\$ – user30432 Oct 15 '13 at 12:29
  • \$\begingroup\$ Sorry that is to open a sunrise and close at sunset \$\endgroup\$ – user30432 Oct 15 '13 at 12:39
  • \$\begingroup\$ @user30432 can you share your schematic or wiring details of light operated relay \$\endgroup\$ – yogece Oct 15 '13 at 15:16

If you dont want to use arduino.look at the rough sketchenter image description here if you wish to make this then i would post the exact schematic.

Alarm clock would make an alarm at a preset time.the alarm would trigger a IC555 then that would clock the CD4017 one of the first output of CD4017 would go high and that is given to a diode and the another diode is connected through a limit switch if the door touch the forward limit switch the the motor must be stopped (diodes are wired as AND gate during normal operation the output of gate is 1)

  • \$\begingroup\$ This looks good. But what would cause the door to close at night time? \$\endgroup\$ – user30432 Oct 15 '13 at 17:58
  • \$\begingroup\$ @user30432 for example if you set alarm for 6'O clock then the clock would give alarm @6.00AM(Morning) and @6.00PM(Evening) am i right? \$\endgroup\$ – yogece Oct 15 '13 at 18:13
  • \$\begingroup\$ Yes your right I was thinking of a 24 hour clock. Would I also be able to replace the alarm clock with the light sensor but incorporating some sort of latching feature to stop it flicking from one state to the other at the activation point \$\endgroup\$ – user30432 Oct 15 '13 at 18:23
  • \$\begingroup\$ would I be right in think that a Schmitt tigger maybe what I require, \$\endgroup\$ – user30432 Oct 15 '13 at 18:39
  • \$\begingroup\$ as @JIm Dearden mentioned the problems caused by the LDR when cloud passes.still if you want to use LDR then you can do it with some latching type. why cannot you use time based solution is there any specific reason for that? \$\endgroup\$ – yogece Oct 15 '13 at 18:45

here is the full schematic.it uses IC555 & CD4017.if you get problem in driving relay transistor do some modifications.put a fly back diode across the relays.enter image description here

  • \$\begingroup\$ while you construct this circuit if you face any problem feel free to post here \$\endgroup\$ – yogece Oct 15 '13 at 20:12
  • \$\begingroup\$ I can not thankyou enough for all your help.i will be tring it on a bread board tomorrow. Thanks again \$\endgroup\$ – user30432 Oct 15 '13 at 20:15
  • \$\begingroup\$ dont forget to share the results \$\endgroup\$ – yogece Oct 15 '13 at 20:17
  • \$\begingroup\$ Hi there have a couple of questions do I need to connect pin3 of cd 4017 to anywhere, and what sort of switches would I need to use for the limit switch. \$\endgroup\$ – user30432 Oct 25 '13 at 18:36
  • \$\begingroup\$ pin 3 is no connection just leave it;you can even use normal push to on button instead of limit switch \$\endgroup\$ – yogece Oct 26 '13 at 13:16

Perhaps a change in design direction might produce a better solution. So here is a proposal.

enter image description here

As you need your monitoring electronics to be as low power as possible so think about using a small micro controller (one of the 8 pin varieties). With only 5 input/output lines you could use it to sense the light level, the door being opened or closed ( a couple of microswitches) and control the motor to open and close the door (your H bridge/relay circuit). (you might also want something to raise an alarm if it fails to work) If you don't want to build your own there are many ready built low cost micro controller boards available such as the arduino.

Relying just on the sun to illuminate the day/night cycle will never produce reliable results - e.g the presence of storm clouds, a chicken blocking the view (or worse!). So how about having something that is also aware of the actual time of day (a 'counting' program) as well as monitoring the light level (input), sensing the door positions (inputs) and controlling the motor (output). If you know the time and the day of the year you can estimate sunrise and sunset. Then you can set a window of time to check light levels (if required) and open and close the door as needed. Great resolution in time is not needed so counting up in 15 min periods would be fine - I'm certain the chickens will not possess Omega watches.

  • \$\begingroup\$ You have the option for timer at the last line of your answer "I'm certain the chickens will not possess Omega watches." we could use low cost alarm clocks(set alarm at 6'O clock and the buzzer output should be connected with the microcontrollers input pin) if he opt arduino even i could help him to complete his task \$\endgroup\$ – yogece Oct 15 '13 at 17:05
  • \$\begingroup\$ What sort of micro controller would be suitable for the above operations, The arduino was suggested but do I have to write program's to use this \$\endgroup\$ – user30432 Oct 15 '13 at 17:12
  • \$\begingroup\$ @user30432 something like a PIC12F629 (about 95 cents) - 8 pin, 6 I/O lines (GP03 is an input only), internal oscillator (4Mhz), 2 -5.5V operating voltage etc. Simple to build onto a piece of veroboard and yes you will have to program it but its a skill worth learning and there are lots of folk on here that would help you. \$\endgroup\$ – JIm Dearden Oct 16 '13 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.