ARDUINO LEONARDO AQUAPONICS

This sketch controls an Ebb and Flow Aquaponic system utilizing three relays and led lights for visualization of currant stage and upcoming stage. relay 1 water pump pin 2, relay 2 gravity feed solenoid valve pin 3 and relay 3 grow bed drain solenoid valve pin 4.
1-5 led's indicate stage complete pin's 5-9, led 6 is upcoming stage indicator pin 13.

stage 1 pump, stage 2 flood, stage 3 soak, stage 4 drain and stage 5 aerate.

Relays power to opto's are all tied together so each relay pin connected to the Arduino has to go low
before the relay will turn on. high means off, low means on, so in setup declare them high before loop otherwise all three relays will be on because the Arduino starts all output pins low. led indication is a different story, they are started low and go high to be on.