1

I need to switch an outside light on during the hours of darkness for a horse that has trouble seeing. In a field in the middle of nowhere.

So, currently I have the Raspberry Pi, I have put it together and downloaded the software. I have yet to connect to the internet. I've seen somewhere you can power them separately, so I won't need a mains connection. What software would be best for this, and are there any other external bits I need to buy?

One other thing, do you think it would be possible to get a Pi to instruct a phone to send a picture, by email or SMS remotely, as this would be useful when I'm not there.

I used to build computers but software was always another league.

Greenonline
  • 2,740
  • 4
  • 23
  • 36
  • 2
    Wouldn't a timer switch be simpler and more reliable? – joan Jul 03 '18 at 11:59
  • Timers need to be adjusted depending on season. A simple COTS CdS based switch is simple, usually rugged and not that expensive. (COTS Common Off the Shelf. CdS cadmium-sulfide or light resistor.) – st2000 Jul 03 '18 at 13:10

2 Answers2

1

Why do you need a RPi for that simple purpose? It's like putting a nail in a wall using microscope.

Get a simple relay switch, light sensor and maybe a couple of other parts and make a simple "if it's dark, turn on the light" schematics, you may find plenty of these on the net, if you search. Will cost less than $5.

lenik
  • 11,541
  • 1
  • 30
  • 37
  • This isn't an answer to the question. It is an answer not doing that. – Ingo Jul 03 '18 at 20:05
  • @Ingo i have a bunch of IR-activated lights in and around my home. Guess, how many RPi were used for that? Yeah, exactly zero. – lenik Jul 04 '18 at 11:23
  • I agree with you that it is overkill to use a raspi for switching outside lights. But answering to do other things doesn't match the policies of this site ;-) – Ingo Jul 04 '18 at 11:59
  • @Ingo i tell the people how the things supposed to be done. sometimes they just don't know about the better/easier/simpler/cheaper approach. – lenik Jul 04 '18 at 13:47
0

If you have power for the light, you can use that power for to supply a power supply for the Pi. I say this because the Raspberry Pi isn't really suited for low-power operations.

There are two ways that I see a Pi doing this. One is to use a photoelectic cell (a light detector) connected such that it has a binary output that signals if there is enough sunlight. When the signal goes high (or low, depending on how you wire it) you turn on the light.

The other way is to turn it on and off by using the time of day. You'd want to approximate when sundown/sunup is to do this. I would make two arrays (sunup and sundown) with each element being one week of the year. You can lookup the times with an almanac or on the internet.

Rather than using a cell phone, I'd use a cellular hat for the Pi which does much the same thing. I'd only connect sparingly if I had to run this on batteries.

I have one question: why aren't you solving this in an easier way?

  • You could keep the light on all the time. The parts will cost more than the electricity for a year, probably.
  • They make timers for lights that would do this.
  • They make light detectors that will turn lights on and off.

Also, for lower power usage, I'd suggest a microcontroller such as an Ardino.

NomadMaker
  • 1,560
  • 9
  • 10