Difference between revisions of "Project/LightingTheFacade"

From initLab
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
''' Lights on the facade of the lab '''
''' Lights on the facade of the lab '''
= Status=


* Plan - to have all the lights on the outside controllable from software
* Plan - to have all the lights on the outside controllable from software
* [https://github.com/initLab/initLab/issues/20 github issue]
* [https://github.com/initLab/initLab/issues/20 github issue]
* Currently we have:
* The system is ready and operational
** The lights themselves, put and controllable with switches
 
** A relay controller with 8 relays, controllable over SNMP
= Implementation =
* What we need more:
 
** Small relays close to the switches, to control the lamps
* We installed LED lights on the facade
** Cabling from the switches to the relay controller
** 2x30W on the street
** Software to track/control everything
** 2x10W on the internal entryway
* For each of these we have a [http://erelement.com/power-supplies/relay-5v small relay]
* All relays are controlled through a [http://www.ipnetcontrol.net/en/item-products-en/8r1t1a neomontana netcontrol] via SNMP.
 
== Cabling ==
 
* For each relay, we have a pair going to it though the cabling of the house
* We push 5V on those pairs
* All relays go to the patch panel in the work room:
** Lecture room - pp 15
** Work room - pp 18
** Hackvarium - pp 7
* From that patch panel over pp 5 through cable WR2 they go to the rack in the coridor, to pp 2, and from it to the neomontana netcontrol
* On the netcontrol we use relays 5-7 to control this, and push 5V from a normal power supply.
 
== Day/night detection ==
 
* [http://www.risacher.org/sunwait/ patched sunwait]
* It's easily calculable when it's day/night based just on your position and the time of day.
* ... and I don't care if it's too cloudy outside.
 
== Logic ==
 
* It's all implemented in an extremely hacky php/shell script, [https://gist.github.com/krokodilerian/ccfff818f61a50662255 stripped code] and [https://vasil.ludost.net/blog/?p=3285 explanation in Bulgarian]
* It loops every 60 seconds or skips the sleep if it receives a message on an unix domain socket.
* The force trigger is /tmp/lamptrigger, if it exists, it means that the lights are forced on.
** The script only checks for that file, it never deletes it or anything else.
* Fetches the status of the lamps, the door, if it's light or dark outside.
* If the lights are on:
** If it's day and the lamps aren't forced on, they're turned off;
** If it's night, the door is locked and more than 15 minutes have passed since the locking, the lamps are turned off;
* If the lamps are off:
** If they're forced, they're turned on;
** If it's night and the door is unlocked (e.g. there are people in the lab), the lamps are turned on;
 
= photos =
 
<gallery showfilename=true>
File:switchbox.jpg|switchbox.jpg
File:dvor.jpg|dvor.jpg
File:street1.jpg|street1.jpg
File:street2.jpg|street2.jpg
File:street3.jpg|street3.jpg
</gallery>


[[Category:Project]]
[[Category:Project]]

Latest revision as of 19:08, 1 February 2016

Lights on the facade of the lab

Status

  • Plan - to have all the lights on the outside controllable from software
  • github issue
  • The system is ready and operational

Implementation

  • We installed LED lights on the facade
    • 2x30W on the street
    • 2x10W on the internal entryway
  • For each of these we have a small relay
  • All relays are controlled through a neomontana netcontrol via SNMP.

Cabling

  • For each relay, we have a pair going to it though the cabling of the house
  • We push 5V on those pairs
  • All relays go to the patch panel in the work room:
    • Lecture room - pp 15
    • Work room - pp 18
    • Hackvarium - pp 7
  • From that patch panel over pp 5 through cable WR2 they go to the rack in the coridor, to pp 2, and from it to the neomontana netcontrol
  • On the netcontrol we use relays 5-7 to control this, and push 5V from a normal power supply.

Day/night detection

  • patched sunwait
  • It's easily calculable when it's day/night based just on your position and the time of day.
  • ... and I don't care if it's too cloudy outside.

Logic

  • It's all implemented in an extremely hacky php/shell script, stripped code and explanation in Bulgarian
  • It loops every 60 seconds or skips the sleep if it receives a message on an unix domain socket.
  • The force trigger is /tmp/lamptrigger, if it exists, it means that the lights are forced on.
    • The script only checks for that file, it never deletes it or anything else.
  • Fetches the status of the lamps, the door, if it's light or dark outside.
  • If the lights are on:
    • If it's day and the lamps aren't forced on, they're turned off;
    • If it's night, the door is locked and more than 15 minutes have passed since the locking, the lamps are turned off;
  • If the lamps are off:
    • If they're forced, they're turned on;
    • If it's night and the door is unlocked (e.g. there are people in the lab), the lamps are turned on;

photos