Datasheet

9
void loop() {
digitalWrite(ssrControlPin, HIGH); // set the SSR on
delay(5000); // wait for 5 second
digitalWrite(ssrControlPin, LOW); // set the SSR off
delay(5000); // wait for 5 second
After uploading the code, you can see the bulb will light 5s and then turn off for 5s, and so on.
7.2 With Raspberry Pi
1. You should have got a raspberry pi and a grovepi or grovepi+.
2. You should have completed configuring the development environment, otherwise follow here.
3. Connection. Plug the sensor to grovepi socket D4 by using a grove cable.
4. Navigate to the demos' directory:
cd yourpath/GrovePi/Software/Python/
To see the code
nano grove_solid_state_relay.py # "Ctrl+x" to exit #
import time
import grovepi
# Connect the Grove Solid State Relay to digital port D4
# CTR,NC,VCC,GND
relay = 4
grovepi.pinMode(relay,"OUTPUT")
while True:
try:
# switch on for 5 seconds
grovepi.digitalWrite(relay,1)
print "on"
time.sleep(5)
# switch off for 5 seconds
grovepi.digitalWrite(relay,0)
print "off"
time.sleep(5)