Difference between revisions of "Project/LightingTheFacade"

From initLab
Jump to navigation Jump to search
(Project finished)
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:
** 2x30W on the street
** 2x30W on the street
** 2x10W on the internal entryway
** 2x10W on the internal entryway
* For each of these we have a small relay
* 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.
* All relays are controlled through a [http://www.ipnetcontrol.net/en/item-products-en/8r1t1a neomontana netcontrol] via SNMP.


Line 25: Line 25:
* 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
* 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.
* 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 ==
== Logic ==


* It's all implemented in an extremely hacky php/shell script, [https://vasil.ludost.net/pics/20160123script.png screenshot].
* 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
* It loops every 60 seconds or skips the sleep if it receives a message on an unix domain socket.
* Fetches the status of the lamps, the door, if it's light or dark outside
* 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 the lights are on:
** If it's day and the lamps aren't forced on, they're turned off;
** If it's day and the lamps aren't forced on, they're turned off;
Line 40: Line 48:
= photos =
= photos =


 
<gallery showfilename=true>
[[File:switchbox.jpg|thumb|center|switchbox.jpg]]
File:switchbox.jpg|switchbox.jpg
[[File:dvor.jpg|thumb|center|dvor.jpg]]
File:dvor.jpg|dvor.jpg
[[File:street1.jpg|thumb|center|street1.jpg]]
File:street1.jpg|street1.jpg
[[File:street2.jpg|thumb|center|street2.jpg]]
File:street2.jpg|street2.jpg
[[File:street3.jpg|thumb|center|street3.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