from machine import Pin
from time import sleep
relay = Pin(4,Pin.OUT)
while True:
#relay on (using low signal tp let the current flow)
relay.value(0)
sleep(1)
#relay off (using high signal to stop the current flow)
relay.value(1)
sleep(1)