Thursday 18 May 2017

Lighting your garden with LED lights and the sun: a DIY project, part 2.

Some time ago I wrote a short article on a small circuit I made to power on and off my garden lights using only a handful of components and some patience. Since then, however, I’ve dug deeper and found out some other good solutions to the problem.

A quick recap of the problem: At dusk and dawn I’d like my garden lights (powered by 12V DC batteries) to switch themselves on and off without me doing anything: a first step towards total automation ;)

Image 2

My first try at accomplishing this task was using a simple BJT with a voltage divider specifically design to allow a certain bias current when it gets dark. See here for more information on this first raw trial.

The circuit mentioned above works fine. It’s pretty raw but it definitely does its job. A couple of problems however have emerged:

1) I’d like to regulate the electronic switch to turn on and off at different ambient light brightness

2) If the photoresistor is not far away enough from the lights, once it gets dark and the circuit turns the light on, the LED light shines upon the photoresistor making it think that it’s bright outside and therefore it turns the lights off, and then the cycle repeats in an endless loop that stops only in the morning.

Since the BJT is a current controlled switch, it can be a little bit trickier to  use when designing a circuit. Not to mention that when in saturation mode, it drops about 0.3V between emitter and collector, dissipating some more power. N-channel mosfets are voltage controlled switch. If you apply a certain voltage between the gate and the source of a N-channel mosfet, it starts conducting. But the best thing when designing for a N-mosfet in such simple circuits in my opinion, is that you can basically assume that the gate does not absorb any current. Given this information and the Vgs value, in order to decide when to turn on and off the switch you just need to set up a simple voltage divider..

This is the new circuit with a N-channel mosfet (don’t mind the exact model, it’s just for reference):

Image 1

As a bonus point, the N-channel mosfet will dissipate very little power when it’s fully on.

As far as the problem 1) is concerned, a small 0-10k potentiometer below the  photoresistor will surely do the job. I set it to 4k in the picture above. By regulating the potentiometer you change the behaviour of the voltage divider and, for instance, you can make sure that the lights switch on and off approximately within a given time window (or account for changes in ambient light during the year).

This is the behaviour of the gate voltage and of the drain-source voltage depending on the photoresistor value.

plot1

Problem 2) is a bit more difficult to solve. Of course, the best solution would be to somehow hide the photoresistor from the LED light, for instance by putting it on top of the garden light’s housing. However, if you cannot do this, you can try to add a bit of hysteresis to the circuit:

Image 3

Ignore V3 which is left open and will be used later to simulate the change in voltage due to the chaning sunlight.

As you can see, aside from switching the position of the potentiometer and the photoresistor, there are 2 major changes:

- A Schmitt trigger (U1) which takes an input at node A and drives the mosfet (a resistor might be needed here).

- A voltage divider by R3 and R4 and a buffer (U2)

The Schmitt trigger has been specifically designed to turn on the mosfet at about 2.5V and turn it off at 6V.

Image 4

Now, suppose that the sun goes down, the photoresistor becomes less conductive, V6 goes up and when it crosses 6V the comparator goes high (V7) driving the mosfet (drain voltage on V8) on which in turn switches on the LED light. The LED light now contributes to lowering the resistance of the photoresistor but if it is far away enough from the light, V6 does not go below 2.5V and the light stays on!!!

The voltage divider R3, R4 and the buffer is needed to shift the hysteresis cycle of the comparator.

The biggest advantages are that:

1) We probably have solved problem 2) stated above.

2) The mosfet (V4) now turns on and off much quicker due to the comparator (V7) action.

Image 5

This new more sophisticated circuit has some advantages and a draw back as well: power consumption of about 100mW (in the worst case). On the plus side, we might have solved problem 2). Is it worth it? I don’t know but it surely was fun to play with.

The first LTspice circuit can be found at this link, while here you find the CAD drawing done with Eagle.

The second LTspice circuit can be found at this other link, while its CAD drawing is here.

9 comments:

  1. A device is made by a attempt of or many conductors wound over a separate core that has the magnetic circuit. The wound conductors ar usually copper, it's remarked as windings. in degree passing single-phase device winding, a attempt of windings ar gift.toroidal winding machine

    ReplyDelete
  2. A program that's hold on at intervals winding machine is recalled any time by product vary. No would love of programming information and each one winding parameter ar shown on the show by pressing the image keys. Coil winding machine provides highest truth and long strength and it offers low space demand. fantastic powder focus has taking once some piece of goliath elements, as associate example, high ohmic resistance, low development and vortex current events.toroidal winding machine

    ReplyDelete
  3. The coil winders is assessed to stay with their speed levels and capability. From multi speeded machines to medium and small, extra-large and massive machines, these machines ar bailiwick a ramification perform. differing types of winding machines ar in market, like manual, automatic and semi-automatic winding machine. In manual winding machine the entire windings ar done by folks.toroidal winding machine

    ReplyDelete
  4. Good post...keep sharing it..
    Free Autocad blocks of multiples furniture it include toilet block,kitchen block,plant blocks,bed blocks,dining block, vehicles block, door block,etc

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. LED chandeliers

    ReplyDelete
  7. The article is very interesting. Thanks for sharing this article. I enjoyed reading your article.

    This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting.

    evs full form
    raw agent full form
    full form of tbh in instagram
    dbs bank full form
    https full form
    tft full form
    pco full form
    kra full form in hr
    tbh full form in instagram story
    epc full form

    ReplyDelete