The Sun, version 2.0
C Python C++
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

SunV2: a sunrise when you want one

We've made a better version of the sun, one that rises on command, does not disappear like the Boston sun, and can be custom tailored to any night-shifted college student's schedule. It is essentially a light dimmer that talks to your computer, and it determines the best time to rise based on your Google Calendar. SunV2 slowly dims a light on as to emulate sunrise.



Quick start

  • Make sure you have the above hardware and have installed the above software
  • Connect the positive end of the LED to Pin P1.0 (LED1) and the negative end of the LED to GND
  • Make sure the IR LED is within a few feet and pointed at the IR reciever of the dimmer
  • Plug in the LaunchPad via USB
  • Flash the firmware: $ mspdebug rf2500 'prog Sun_firmware.txt'
  • Make the Sun executable: $ chmod u+x web/
  • Run the Sun regularly: $ crontab -e
    • Add the line: */5 * * * 1-5 python <PATH_TO_REPO>/web/ >> <PATH_TO_REPO>/log.log
  • Run the Sun script once, to authenticate your Google account: $ python web/
  • Make sure that the src/calendar.dat file is readable and writeable: $ chmod a+rw src/calendar.dat

Troubleshooting / Other features

  • To check the log for errors: $ tail -f <PATH_TO_REPO>/log.log
  • To manually remote control the dimmer: $ screen /dev/ttyACM0 9600
    • Use keys ASDW to control the dimmer
  • To run the demo web interface: $ python web/
    • Then, navigate to localhost and click buttons to control the dimmer
  • To just check your Google Calendar "sunrise" time without controlling any lights, just run: $ python web/

Flashing the Launchpad via Code Composer Studio 5 (development setup)

Windows 7 or Ubuntu 12.04

  • File > New > CCS Project
  • Family: MSP430, Variant: MSP430G2553, Empty Project
  • Right click on project > Properties
    • Build > Advanced Options > Language Options > Enable "Treat C files as C++ files"

Ubuntu (keeps CCS project and repository in sync)

  • Right click on project > Properties
    • Build > Steps > Apply Predefined Step > TI-TXT
  • $ cd <REPO_DIR>
  • Add code: $ ln -s src/ <PATH_TO_PROJECT>/src
  • Export binary: Project > Build All
  • Link binary to repo: $ ln <PATH_TO_PROJECT>/Debug/<PROJECT_NAME>.txt bin/Sun_firmware.txt
  • Load program via terminal: $ mspdebug rf2500 'prog bin/Sun_firmware.txt'

Windows 7 (will need to copy files back to repo)

  • Add code: src/
  • Load program: Run > Debug


Feature requests

  • Rain dance: to make the sun go away (snooze)