My house was built on old foundations and a basement, which was made by the previous owners of the property. I knew since the beginning that due to its size I will not be able to finish the whole house at once. 6 years after moving in the time has come to fix the attic... and to extend the system.
The beginning of all the planning is the list of needed functions. What do we want to do and what should respond to our actions? From that analysis once can derive the list of 'actors' and buttons. Here are the items I decided to control:
Before fixing the roadway to my house I have laid 1 UTP cable to the fence. 2 wires was used by the door lock, 4 by videophone, 2 are used to send impulses to gate motor. That's all. There is no wires left to connects sensors checking if the gate is left open. I has happened a few times that in the evening, after letting the guests out, the gate was left opened. Nothing happened, that's true, but it is leaves a space for improvement.
The camera is a potential source of information. It is looking at the gate and is always on. It must be possible to use it to recognized if the gate is open... ...but after checking all the libraries and software doing image recognition, I got stuck. Recognizing edges, registering changes... all too complicated. It was just not worth it. Finally I managed to build a much simplified solution based on GD PHP library and some simple calculations. Here is how it's done:
1. Every minute a script on RPi downloads a 640x480 image from the camera.
2. 4 samples 15x15px each are cut out from the fence and the gate as shown on the image below:
The time has come to integrate all the elements of control into one program. The new method of communication (more here), bootstrap facilitating fast building of responsive pages and a fancy opensource template were sufficient to provoke me to start another project. Here is the final effects and the details follow below.
One of the visitors has sent me a screenshot of his visualization. It was fully based on bitmaps imported to CoDeSys as visualization background. It was by far superior to all that I had done so far.
At the end of 2010 after playing a little with a bitmap editor I rebuild all main visualizations. The effects are to be found below (WARNING – large sizes of screenshots):
The visualizations are adjusted to my computer screen’s resolution. Obviously the space could be used better, probably you can see an amateur hand, but well – it is what it is. The most important success is that seeing the visualizations as they are my wife decided to try to use them ;)
Technically – the idea is not complicated. First in a graphic editor you need to create a background composed of elements that will not change as the program runs. To set a background in CoDeSys right-click on your visualization.
In the 2nd step you need to draw dynamic elements – standard rectangles and circles. All as in the usual visualization but with a much greater effect. If a more detailed explanation is needed, please let me know.