Start by designing a system block diagram.
This block diagram contains all hardware components and their dependencies.
The physical and logical properties of the interfaces are identified, as well as the respective energy consumption.
In the next step start with sketch design using the hardware design given.
Basically I just need to work out a script for a 2 pin button to operate the relays for 30 seconds without being able to reset the script by pushing the button again in that 30 seconds.
Here's my attempt at a script:
int relay_1 = 4;
int relay_2 = 7;
int buttonState = 0;
const int buttonPin = 9;
void setup() {
Serial.begin(9600);
pinMode(relay_1, OUTPUT);
pinMode(relay_2, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState = HIGH)
// Push button, turn Relays on for 30 seconds:
digitalWrite(relay_1, HIGH);
digitalWrite(relay_2, HIGH);
Serial.println("relays ON");
delay(30000);
// turn Relays off:
digitalWrite(relay_1, LOW);
digitalWrite(relay_2, LOW);
Serial.println("relays OFF");
}