NS Lamp 2021

05-07-2021
Never go to the railway station for nothing again with this intelligent IoT lamp.

To avoid driving to the station by car (to go to work) I always look at this lamp just before departure. If the lamp lights up red, I have to look in the NS App to see what is going on. If it is green, everything is OK and my train will leave on time.

Inside the lamp is a D1 Mini that polls my website. My website runs a PHP script that connects to the NS server to retrieve the current situation at the station.

Both the PHP script and the script for the D1 Mini are on my Github.

The lamp is nice and big and is made after the industrial model of the first photo. See here for the 3D models (OpenScad) to print it yourself.

The Arduino script polls the PHP page every 4 minutes. And the PHP script only calls the NS API if it is daytime. This way I don't call the Api too often and hopefully I won't get any complaints from the NS (Dutch railroads).
date_default_timezone_set("Europe/Amsterdam");
$d = getdate();
$hours = $d['hours'];
if($Hour>18 || $Hour<5) {
// In the evening I don't need to know the status
// I therefore do not call the NS to limit API calls
Out();
}

Appliances

All my appliances are working installations.

If you want to replicate an appliance and you need help, feel free to contact me.

View 32 appliances
 
×
×