Introduction: Wake Up Clock
What time is it? It’s wake up time! 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.
This tutorial was originally published on Intel Communities here.
Step 1: Needed Components and Tools
- Intel® Galileo Gen 2
- Intel® Galileo Gen 2 power supply
- Arduino Protoshield
- 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 Jumper wires
- Colored wire
- Pin header
- 1 8 mm magnet
- Stiff wire (that is attracted to magnets)
- Wood glue
- Hot glue sticks
- 4 mm MDF components - lasercut according to drawing
- Plexiglas components - lasercut according to drawing
- Nuts and bolts
Step 2: Sort the Lasercut Pieces for Easier Construction.
Sort all the pieces according to the image
Step 3: Solder the Electronics
Use the schematic to solder the electronic components together.
Step 4: 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.
Step 5: Attach the Intel® Galileo Gen 2 Board
Use parts B4 as spacers for the board.
Step 6: Connect the Intel® Galileo Gen 2 Board
- Connect two jumper wires to the two pin headers
- 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
Step 7: Connect the LED
- Attach the LED to the back plate
- Place the LED into Part B2
- Screw onto Part A8
Step 8: Connect the Potentiometer
- Insert the potentiometer
- Place the potentiometer into Part A9 making sure to align the tab properly
- Secure with the bolt provided
Step 9: Assemble the Whole Case Pt1
- 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
Step 10: Assemble the Whole Case Pt2
- 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
Step 11: Assemble the Whole Case Pt3
- 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
Step 12: Upload the Sketch
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
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.
Step 13: (Optional) Use 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
- 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 (previous step), and upload to Intel® Galileo Gen 2. It should be working now!