WeMakeIoT

Experimenting with Cylon JS: Industrial Timer with light alarm

Our IoT team is on a constant experiment trial involving new frameworks and technologies in IoT. The capability of Cylon JS to program Raspberry Pi is what we experimented. Recently we had the opportunity to create a Sunrise alarm clock prototype using Cylon JS, Node JS and Java swing. The idea was to make a smart sunrise alarm clock which slowly illuminates light from dim to bright before an alarm is triggered. Our body will be exposed to natural light response even before waking up thus giving an energized start for the day. The clock will have a graphical touch screen UI through a Raspberry Pi screen 7″ Touch.

Technologies Used:

 

Hardware Used:

  • Raspberry Pi
  • LEDs (Blue, White, Yellow)

Development Procedure

The first part of the procedure was to complete the installation of Node JS and Cylon JS properly, Cylon JS in particular require many configurations to be done. We made a desktop application for setting user location using java swing. The user location set by the user is saved in an xml file. For getting sunrise time and temperature we used an open Sunrise-Sunset API. We made a time scheduler for checking sunrise time and temperature by using node time schedule npm.

Inside our main program we checked our current time with sunrise time. If the time difference is less than 40 it will start the LED glowing to minimum brightness (we used pulse width modulation for controlling the same) and the color of the LED is selected according to the current location temperature. At sunrise, brightness of led will be at the maximum and finally the alarm buzzer will start and continue for one minute.