Kyle Cook
Published © GPL3+

Single Person Weasley Clock

An old-timey looking "clock" that tracks one person's location. Based off of the Weasley's clock in Harry Potter. Good first timer circuit.

BeginnerFull instructions provided3 hours16
Single Person Weasley Clock

Things used in this project

Hardware components

Photon
Particle Photon
×1
EMax 12g ES08MD high Sensitive servo
Seeed EMax 12g ES08MD high Sensitive servo
×1
Phone Charger
To power the Particle Photon via a wall plug. (~5v/700-800mA is what I used)
×1
Shadow Box
This houses everything. A deep picture frame will do as well. Any art & craft supply store should have these. There are also many online. You will likely need to drill or cut a hole to run your power cable through the back. Also, the box should be about 1.25" deep or more.
×1
Jumper wires (generic)
Jumper wires (generic)
×3

Software apps and online services

IFTTT
You will make the Applets on your computer on IFTTT's website. Also download the app on your phone for the location services to work. Be sure to link your IFTTT account to your Particle account or nothing will happen!
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

Fritzing Circuit

Downloadable version.

Schematics

Circuit Diagram

Made with Fritzing. (Please note the Photon also needs to be plugged into a power supply).

Code

Weasley Clock Code

Arduino
Simply copy and paste into your Particle Web IDE. The code is ready to go!
Servo userservo; // Intorduces the board to the servo
                // Max allowed: 8

int userpos = 0;    // Variable which will be the servo position

 
void setup()
{

//Tether the Servo to the function 
Particle.function("userservo", updateuserServo);
//Set pin D0 to be the output
pinMode(D0, OUTPUT);


//Activate Photon LED
RGB.control(true);
//Turn off the LED - we don't want to see it through the clock - do this by setting RGB values to 0.
RGB.color(0, 0, 0);
}
 
void loop()
{
// Can leave this area blank - nothing to loop.
 
}
 
//This function is triggered by IFTTT - the 'command' word represents the object used to store the 'position' we send to the function.
//The 'position' we send represents where we want the servo to move to
int updateuserServo(String command)
{
    
//Attach the servo to D0
userservo.attach(D0);

//Convert string to integer, the code after this requires the 'command' object to be in a number format. IFTTT however passes the object as a 'string' even if it is a 'number'.
uint8_t userpos = command.toInt();

//This tells the servo, attached to D0 to move to the position defined in the 'command' object that was passed when we triggered this function from IFTTT
userservo.write(userpos);

//Flash the LED on so we can see that a signal has been recieved.
RGB.color(0, 0, 255);

//Adding delay makes the light visible for 2 seconds.
delay(2000);

//Now set the LED back to off
RGB.color(0, 0, 0);

//detach the servo
userservo.detach();

//We return something to signify the end of the function - doesn't really matter what it is
return 1;
 

  }

Credits

Kyle Cook

Kyle Cook

1 project • 0 followers
Thanks to Tim Tiernan.

Comments

Add projectSign up / Login