I have tried to run it without solenoids.
That's is when it works right. The relay stays off for the stated time period.
It works with 1 solenoid.
When I plugged all 8 in, none of the relays stayed off for the required amount of time.
They go off for about a second and turn back on.
Your thoughts about the code being able to read the current values are correct.
When i start the serial monitor nothing is read. I will have to reposition or rewrite the code.
I have an updated version of the code where I am making sure the solenoids stay on and off for the amount of time that I need them to stay on and off.
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 8, en = 9, d4 = 4, d5 = 5, d6 = 6, d7 = 7;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
/****************************************************************************/
unsigned long TOn = 1800000; // delay time in milliseconds to turn relay on/off (60,000 ms = 1 minute), therefore relay is on for 30 minutes
unsigned long TOff = 900000; // relay is off for 15 minutes
void setup () {
lcd.begin(16, 2); // set up the LCD's number of columns and rows: 16 columns, 2 rows
lcd.setCursor(0, 0); // set printing position on lcd screen, currently that is column 0, row 0)
Serial.begin(9600);
lcd.print("On:");
lcd.print(TOn/60000);
lcd.print("m");
lcd.print(",");
lcd.print("Off:");
lcd.print(TOff/60000);
lcd.print("m");
DDRA = B11111111; // set PORTA (digital 22-29) to outputs
int maxnumber = 2; // set cycle count
for (int count = 0; count < maxnumber;) //Counter will stop counting after certain amount of cycles
{
lcd.setCursor(0, 1); //clears lcd before incrementing to next number
count++;
lcd.print("Cycle Count:");
lcd.print(count);
PORTA = B00000000;
delay(TOn); //delay between turning on each relay
PORTA = B11111111;
delay(TOff); //delay between turning off each relay
}
DDRA = B00000000;
}
void loop(void) {
}
@TomGeorge my circuit schematic is in the first post.
Here are actual pictures of the setup:
The circuit is a mess, I am going to update the wiring connections to put into a nice controls box.
One thing I did try to do is read current via a multimeter at the end of the white quick disconnect connectors (+/- terminals) while a solenoid was plugged into them. I was about to measure the amount of current going into the solenoid and I connected the leads into the 10A and common plugs of the fluke multimeter I had.
When I made contact with the quick disconnect connections the power supply almost shut down and there was a spark at the quick disconnect (that quick disconnect is now scorched black on the inside but it still works). Did I end up shorting it (they are +/- connections)? I don't get how I did?


