What time is it? It’s wake up time! This week, we’ll explore the Intel® Galileo Gen 2 board’s real time clock (RTC).
The RTC, once set up, will run even if the board is turned off so long as it gets power from the attached battery. While this is a relatively simple function of the board, it has its obvious uses - scheduling, timing, or calculating intervals.
We will be making a “wake up clock” which will turn on and illuminate the room slowly, simulating a morning sunrise. Hopefully, it will make waking up on Mondays a bit easier.
Here is a video of the completed project.
Here is a list of items you’ll need to make this project:
Intel® Galileo Gen 2 power supply
LED power supply
1 High power white LED(3v 700mA)
1 1000 μF Capacitor
1 2.1 mm DC jack-to-screw terminal adaptor
1 10k potentiometer
1 1.8Ohm 2w resistor
1 LM317t voltage regulator
2 10kOhm resistor
1 2n7000 transistor
1 Coin battery holder
1 8 mm magnet
Stiff wire (that is attracted to magnets)
Hot glue sticks
4 mm MDF components - lasercut according to drawing
Plexiglas components - lasercut according to drawing
Nuts and bolts
Assembling the Wake Up Clock and electronics:
Sort the lasercut pieces for easier construction.
Solder the electronics.
Use the schematic to solder the electronic components together.
Solder the magnetic switch
Cut two 20 cm lengths of stiff wire and solder them to the protoshield assembly as indicated in the drawings above.
Attach the Intel® Galileo Gen 2 board.
Use parts B4 as spacers for the board.
Connect the jumper wires.
Connect two jumper wires to the two pin headers as shown in the photo.
Connect the protoshield to the Intel® Galileo Gen 2 board.
Connect the power to the RTC.
Connect the two jumper wires from the Intel® Galileo Gen 2 board to the protoshield assembly.
Insert the coin battery.
Attach the LED to the back plate.
Place the LED into Part B2.
Screw onto Part A8.
Insert the potentiometer.
Place the potentiometer into Part A9 making sure to align the tab properly.
Secure with the bolt provided.
Assemble the Wake Up Clock.
Attach Part A5 to Part A9.
Attach Part A8 and Part A9 to Part A6.
Attach Part A3 to Part A6.
Insert Part A4 to Part A6.
Place Part A7 onto assembly.
Place Part A1 onto assembly.
Connect the terminal adaptor.
Insert the positive and negative leads into the adaptor.
Insert the 1000 μF capacitor and tighten screws to secure.
Place the alarm dial onto the face of the clock.
Insert the potentiometer through the hole on Part A9. Make sure to line up the stabilizing tab on the potentiometer to the small hole provided.
Screw on the locking nut.
Slip Part B1 onto the potentiometer knob.
Install the magnetic switch.
Push the wires through the holes at the bottom of Part A9.
Cut off excess wire.
Bend the wires back through the hole.
Attach Part B3 to Part A4 where indicated.
Glue the magnet into the hole.
Make sure that both wires touch the magnet.
Note: It helps if the wires can slide loosely in and out so that both will make contact with the magnet.
Place the dial and Plexiglass cover.
Slide Part B1 on the potentiometer.
Glue the Part C1 onto Part A9.
Attach the power cables and USB to program the board.
Detach the USB and close the clock.
Attach Part A2 to the assembly.
Programming Intel® Galileo Gen 2
Make sure you have the Arduino IDE from Intel® properly installed.
If you haven’t done that yet, go through the “Getting Started with Intel® Galileo Gen 2" guide
Upload the Arduino sketch.
Download RunAlarm and SetTime sketch from the attachment and place it in the sketchbook folder.
Open the SetTime sketch, configure the current time for your Intel® Galileo Gen 2 by modifying the line dateCmd+="'20150120 07:14:40'";
Upload the sketch. It’ll configure your clock accordingly.
Then upload the RunAlarm sketch. The alarm clock would be up and running after this point
Using the web interface
Alternatively, you can use a web interface to set the time and alarm! We made a web server with node.js, so you can check the time/alarm setting in your Galileo, as well as changing the settings whenever you want.
Set up the web interface
Make sure you have read our [tutorial 2], so you know how to connect the Galileo to a network, how to get the ip address of your Intel® Galileo Gen 2, how to ssh to the Intel® Galileo Gen 2 terminal, how to copy files to Intel® Galileo Gen 2.
Have your Intel® Galileo Gen 2 connect to the local network. You can use either wifi, ethernet direct or ethernet as mentioned in [tutorial 2].
Find the ip address of the Intel® Galileo Gen 2, corresponding to the method of connection.
Download Server.js from the attachment to your computer, and put the ip address found from last step to it. Look for the line “var IP='169.254.11.200';”
Transfer Server.js to the Intel® Galileo Gen 2. Use scp if you’re using Linux/mac, or pscp if you’re using windows. e.g. “scp /path/to/server.js root@[insert Intel® Galileo Gen 2 IP here]:/home/root/”
Start the server.
SSH to the Intel® Galileo Gen 2 terminal, type “node /home/root/server.js” to start the node.js server. You’ll see the message “Server running at http://[your Intel® Galileo Gen 2 IP here]:1337/” in the terminal when it’s ready.
Test the server.
Open a browser in your computer, type [your Intel® Galileo Gen 2 IP here]:1337 in the address bar to access the web interface.
Configure the time and alarm
You can see the current time in the web interface, as well as the alarm.
Type the time and alarm in the corresponding input box. Note that you need to type in both or it’ll fail.
You need to use a specific time format, as described in the interface. Put it as “HH:MM:SS”, if a number is smaller than 10, fill a 0 in front of it.
Press “Set” button when it’s done. The page will refresh and you can see the new settings
Upload the Arduino sketch.
Download RunAlarmWithWeb from the attachment, and upload to Intel® Galileo Gen 2. It should be working now!
Intel® Galileo Gen 2