Things used in this project

Hardware components:
Photon new
Particle Photon
×1
Kemet c320c104k5r5ta image
Capacitor 100 nF
×3
Panasonic eca2am101
Capacitor 100 µF
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×3
1N4001 Diode
×1
Fairchild 1n5819
1N5819 – 1A Schottky Barrier Rectifier
×1
Resistor 1 ohm - RSF100JB-1R0
×2
Resistor 20K ohm 5% 0.25W(1/4W)
×1
Capacitor 220pF 100V 5%
×1
Panasonic eca 1hm221
Capacitor 220 µF
×1
Inductor 220 uH
×1
Resistor 30.1K ohm .40W 1%
×2
Thyristor Triac .6A 600V TO92
×8
Texas Instruments MC33063
×1
MC74HC595AN
×1
Terminal Block 5 mm Vert 2POS
×1
Terminal Block 5 mm Vert 3POS
×2
Terminal Block 5 mm Vert 8POS
×1
PTC Resettable Fuse 0.75A (hold)
×1
Resistor 330 ohm 16-pin DIP Thick Film
×1
Stardust Sprinkler circuit board
×1
Software apps and online services:
Gawd2jnp51w1h1ccsulo
IFTTT Amazon Alexa service

Schematics

Sprinkler Stardust
PCB for WICED Stardust or Photon to control 12VAC Valves

Code

Menorah Control codeArduino
This is the code flashed on the Particle . You can control either individual LEDs or use it to set the day in which all LED equal or less than the number specified with be lit
// -----------------------------------
// Controlling LEDs over the Internet
// -----------------------------------

// name the pins
int led1 = D0;
int led2 = D1;
int led3 = D2;
int led4 = D3;
int led5 = D4;
int led6 = D5;
int led7 = D6;
int led8 = D7;

// This routine runs only once upon reset
void setup()
{
   //Register one Particle function here
   Particle.function("led", ledControl);

   //Register two Particle function here
   Particle.function("menorah", SetDay);


   // Configure the pins to be outputs
   pinMode(led1, OUTPUT);
   pinMode(led2, OUTPUT);
   pinMode(led3, OUTPUT);
   pinMode(led4, OUTPUT);
   pinMode(led5, OUTPUT);
   pinMode(led6, OUTPUT);
   pinMode(led7, OUTPUT);
   pinMode(led8, OUTPUT);

   // Initialize   the LEDs to be OFF
   digitalWrite(led1, LOW);
   digitalWrite(led2, LOW);
   digitalWrite(led3, LOW);
   digitalWrite(led4, LOW);
   digitalWrite(led5, LOW);
   digitalWrite(led6, LOW);
   digitalWrite(led7, LOW);
   digitalWrite(led8, LOW);


   }



// This routine loops forever 
void loop()
{
   delay(100);
   // Nothing to do here
}


// This function gets called whenever there is a matching API request
// the command string format is l<led number>,<state>
// for example: l1,HIGH or l1,LOW
//              l2,HIGH or l2,LOW

int ledControl(String command)
{
   int state = 0;
   //find out the pin number and convert the ascii to integer
   int pinNumber = command.charAt(1) - '0';
   //Sanity check to see if the pin numbers are within limits
   if (pinNumber < 0 || pinNumber > 7) return -1;

   // find out the state of the led
   if(command.substring(3,7) == "HIGH") state = 1;
   else if(command.substring(3,6) == "LOW") state = 0;
   else return -1;

   // write to the appropriate pin
   digitalWrite(pinNumber, state);
   return 1;
}

int SetDay(String command)
{
   
   int i=0;
   //find out the day number and convert the ascii to integer
   int dayNumber = command.charAt(0) - '0';
   //Sanity check to see if the pin numbers are within limits
   if (dayNumber < 0 || dayNumber > 8) return -1;
   
   if (dayNumber==0) {
   
   	for (i=0; i<8; i++){
   	digitalWrite(i, 0);
   		}
   	}
   
   else {
     	for (i=0; i<8; i++){
     	
   	digitalWrite(i, (i < dayNumber));
   		}
   	}


   return 1;
}

Credits

Art
Arthur Sobel
2 projects • 1 follower
General electronics
Contact

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

Add projectSign up / Login