Photocell & Relay

Hi folks.

Just wondering if I actually need an Arduino in order to have a photocell do the switching. Can I hook up a photocell to some voltage, then directly to a relay to run the power side?

Cheers

If that's all you are doing an Arduino is way overkill.

I would think there are a 100 ways to do this, I'd use a comparator with feedback to give some hysterisis, followed by a transistor if it's a large relay.

With correct resistor choice maybe even just a transistor.

Having said that the Arduino (or any processor) can be programmed to stop the relay oscillating when the light level is on the threshhold, I'd put a stand alone ATtiny85 in there, it's only 8 pins and cheap as chips.


Rob

Hi there.

It's a small application to switch incoming solar to a battery system, then to open the batteries to a block of LED's during the dark time. Very very simple.

The solar panel goes through a voltage regulator to the 12V battery, which provides energy to a LED system that I haven't designed yet. The photocell acts as a switch to decide which circuit is closed.

Any input on that system? This is just a hobby for me.

Cheers

You dont need a relay or switch for the solar panel, just a diode too stop reverse current flow.

A shunt regulator made for solar panels will prevent overcharging, and most have reverse polarity diode already built in.

I think you're missing my goal. I'm not worried about the solar panel. I don't want the lights on during the day. There's no point in having lights on, draining a battery when it's sunny out.

Daytime: charge to battery only
Nighttime: battery switches on to power LEDs

The photocell I want to act as that switch. Not really sure how to do it.

Cheers

Tons of circuits on the www for automatic switching of lights. most use a relay, or use a 741 op amp as a comparator. One guy seems to have a decent design here

There's no need to switch "between" solar and light.

Assuming you have a proper regulator all the battery charging stuff is handled which just leaves the lights, so my earlier comments hold.

As Altairlabs said the reverse polarity diode should be in the panel and/or the regulator but it's probably worth checking it is.


Rob

There's no point in having lights on, draining a battery when it's sunny out.

What if there is a bright full moon out at night? :wink:

Lefty

Hey that's a great site. It's another language for me, but I will take a look.

I've been testing my controller and it seems I can pull load during the day as well. It's hooked up to a bad battery, so I'm not really seeing how it should properly behave.

I am getting 12 volts out of the load leads though, so it isn't shutting off during provided charge voltage.

If full moon, no need for lights. Hehe.

I think a fairly simple circuit should suffice - but without more specific information its not easy to choose a good solution. What sort of current for the LEDs? Do you want gradual or sudden turn on of the LEDs as it gets dark.

And how dark? Have you chosen a photocell yet? link to datasheet? If not have you looked for a chip that has this functionality?

A physical relay will give enough hysteresis so a simple solution might just be a resister + photoresistor voltage divider into a darlington driving a relay. Or without the relay a progressive turn on (but more heat sinking for the transistor?). Without knowing the properties of the particular photocell or the load its difficult to help more.

Most controlers dont "shut off" they charge to "full" and then hold that level.

Depending on your LED load and capacity of solar panel and battery you may be able to let LEDs run all the time. A small LED will use less power than a typical mechanical relay, so you'd be worse off by adding the wsitch. The link I sent uses a FET and should have very low energy waste, and has hysteresis built in.

Well that's just it. I want it to be as simple as possible.

I haven't designed the LED part yet, as I am doing that last. I don't know of anything commercial other than other solar lights, but I don't know what voltage they work at. I might just design something on my own. They are to light up my kitchen/dining area at night. I can only assume they'd work on the provided 12V system.

Sudden switching is just fine by me. Nothing fancy. Just light when the system asks for light. I have an analog photocell shipping in a couple of weeks, along with some assumed hardware I thought I would need.

Sorry MarkT, I have no clue what those are. I'm running out of high-school physics memory, and that was 3 biology degrees ago at least.

The photocell I ordered was this one:

Cheers

Most controlers dont "shut off" they charge to "full" and then hold that level.

Depending on your LED load and capacity of solar panel and battery you may be able to let LEDs run all the time. A small LED will use less power than a typical mechanical relay, so you'd be worse off by adding the wsitch. The link I sent uses a FET and should have very low energy waste, and has hysteresis built in.

That's what mine seems to do. I want to turn that off for 2 reasons:

  1. No need for lights on during the day. It's nice when they turn on (I have a solar unit now, but it's weak and small. I have a powered unit that switches on using a timer).

  2. I want to maximize the battery for other applications. I might be buying a motorcycle battery and run various items off it, given the charging cycle > load cycle.

That's what mine seems to do. I want to turn that off for 2 reasons:

We seem to keep conflating the charger and the load switch. I thought you didnt yet have the LEDs or switch? So your quote

That's what mine seems to do. I want to turn that off for 2 reasons:

is confusing, is it about your charger or your LED?

Just use Circuit: 12v Light/Dark Switch__ Circuit designed by David A. Johnson, P.E. for the LEDs and leave the charger alone.

There is no load switch.

I have a solar panel that goes into a solar charge controller.

  • and - terminals for solar
  • and - for the battery
  • and - for load (light)

If the solar panel is generating proper voltage, then the lights will be on. I don't want that, as it's a waste to have lights on during the day. Second, it's wasted amperage that could be charging the battery.

There is no load switch.

thats your problem.

Just use Circuit: 12v Light/Dark Switch__ Circuit designed by David A. Johnson, P.E. for the LEDs and leave the charger alone.

"What we've got here is...failure to communicate."

So you want me to install a switch so I turn it on/off twice a day? You'll have to explain.

By the way, they are sending me a new controller. This one is pooched.

BeerRich said:

The photocell I want to act as that switch. Not really sure how to do it.

AltairLabs said:

Just use Circuit: 12v Light/Dark Switch__ Circuit designed by David A. Johnson, P.E. for the LEDs and leave the charger alone.

AltairLabs gives up:
http://video.google.com/videoplay?docid=-8342445135331678445#

Do you speak English? Then read the thread. Yes, go to the very beginning. And if you have nothing useful to add, then stop being such a prick.

  • and - for load (light)

Either hook your on/off circuit to these or directly to the battery, it makes no difference except using the regulator load OP will protect the battery should it ever get too low.

For the cost of an ATtiny85 I'd bung one in and use it to control the LEDs OR even simpler use a comparator that can connect directly to the battery.

This is a simple application, the thread length is getting out of proportion :slight_smile:


Rob