Control Appliances based on Daylight

This project implements a 'C' application that can calculate the sunrise, sunset, length of day etc based on the system clock and your coordinates on the face of the earth. It is based on some code released into the public domain by Paul Schlyter.


Click here to check out other projects.

Click to search the Acacia site
Click to search using Google

See the animation (2.2MB)

This project is more of a cosmological calculator than something that specifically targets the control of appliances using light levels, but it will, in conjuction with the X10 Project and a Perl script, provide all the tools you need to build this.

I must admit that my first idea was to use some sort of digital I/O to capture the output of a LDR (light dependent resistor) and use that single bit to determine when it was day or night. The problem is that you must set a balance point in this type of circuit where it indicates darkness or light, and the hysteresis of a schmidt trigger means there is a band where nothing happens in the transition. I then thought - hey - I can calculate the exact light level and use that figure. Hence this project.

The only issues with this project are that local mountain ranges and cloud cover will mean the actual light levels may vary from what the code calculates.

Here is a live run of this application (press refresh to run again)

Hardware

Software

Ideas

Visualisation

If you are interested in the visualisation portion of this project, the following provides a summary of how this was done. The image at the top of this page shows green vectors from a sample location (Canberra) to the sun at various sunrise, sunset and midday positions. It illustrates the meaning of the calculated times. Clicking on the image displays a 2.2MB fly-by animation.

Code

+ Make File
+ C++ Header File
+ Configuration File
+ C++ Source File

Click here to check out the list of other projects.

You may also like to click here to check out the list of Artificial Intelligence projects.

If you would like to get any further information on this or any of the other projects shown on this web site, please send an email to Acacia Lateral Technologies. or place a comment in our Guest Book

You might also like to submit your idea to our Free Ideas page for the benefit of other like-minded soles.