Things used in this project

Hardware components:
Photon new
Particle Photon
×1
Photo Box Frame
×1
11026 02
Jumper wires (generic)
×6
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
×1
Coffee Stirrer (Wood)
×2
Servo (generic)
×2
Plug socket patress box
×1
Black Card
×1
Hand tools and fabrication machines:
Box Cutter
Screwdriver

Schematics

Circuit Diagram
Pretty Obvious Stuff
2017 02 22 13 03 05 gseprlr8vs
Suite of IFTTT recipes
2017 02 22 13 04 15 wxiuvhjcig
IFTTT Recipe Example
This sends the number 53 to the particle... then the particle tells that servo to go to 53 degrees.
2017 02 22 13 04 38 ik4dpdy3ad

Code

Particle IDE CodeC/C++
Place the code in the Particle IDE
Servo timservo; 
Servo louservo;// create servo object to control a servo
                // a maximum of eight servo objects can be created

int timpos = 0;    // variable to store the servo position for timservo
int loupos = 0;    // variable to store the servo position for louservo
 
void setup()
{

//Setup the Servo to the function 
Particle.function("timservo", updatetimServo);
//Set pin D0 to be an output
pinMode(D0, OUTPUT);

//Setup the Servo to the function 
Particle.function("louservo", updatelouServo);
//Set pin D0 to be an output
pinMode(D1, OUTPUT);
//Take control over the LED on the board
RGB.control(true);
//Turn off the LED - we dont want it flashing behind the photo frame at night
//There may be a better way to do this like turning it off, I found it just as easy to set the colour to nothing
RGB.color(0, 0, 0);
}
 
void loop()
{
// We don't need to do anything here
 
}
 
//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 updatetimServo(String command)
{
    
//Attach the servo to D1
timservo.attach(D1);
//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 timpos = 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
timservo.write(timpos);
//Flash the LED on so we can see that a message has been recieved - just because we can
RGB.color(255, 0, 0);
//Remember to add the delay for 2 seconds, otherwise the LED will just flash for a period of time too small for us to see
delay(2000);
//Now set the LED back to off
RGB.color(0, 0, 0);
//detach the servo
timservo.detach();
//We return something to signify the end of the function - doesn't really matter what it is
return 1;
 

  }
  

  
//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 updatelouServo(String command)
{
    
//Attach the servo to D0
louservo.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 loupos = command.toInt();
//This tells the servo, attached to D1 to move to the position defined in the 'command' object that was passed when we triggered this function from IFTTT

delay(5000);

louservo.write(loupos);
//Flash the LED on so we can see that a message has been recieved - just because we can
RGB.color(0, 0, 255);
//Remember to add the delay for 2 seconds, otherwise the LED will just flash for a period of time too small for us to see
delay(2000);
//Now set the LED back to off
RGB.color(0, 0, 0);
//detach the servo
louservo.detach();
//We return something to signify the end of the function - doesn't really matter what it is
return 1;
 

  }
  

Credits

Thanks to CameronT.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

What's My I2C Address?
Easy
  • 77
  • 3

The story of how to make a clock through using a LCD 1602 or LCD 2004 over I2C.

MyHumidity Controlled by BME280 and Photon
Easy
  • 188
  • 4

Full instructions

Checks if humidity threshold is reached and informs the user by using Blynk/IFTTT-services with softAP integration.

Tweeting Particle Photon
Easy
  • 44
  • 1

Full instructions

Tweet your friends with only the press of a button!

MyLight-Clock with NeoPixel Ring 12 Controlled by Photon
Easy
  • 260
  • 2

Full instructions

Read the time at night? Without glasses? Impossible? Focus on 2 light points, which will tell you the hour and the minute.

BME280 measures and displays on OLED controlled by Photon
Easy
  • 341
  • 2

Protip

I share my first steps with the sensor BME280 (temp / humi / pressure / altitude) and an OLED 128 * 64 px

Map Your Particles!
Easy
  • 1,354
  • 20

Protip

Locate your Particle Photons, P1s and Electrons on a map without needing extra hardware. Use Ubidots or an offline map alternative

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login