guod
Well-Known Member
one of many solutions...
https://www.arduino.cc/en/Tutorial/SimpleRTCAlarm
https://www.arduino.cc/en/Tutorial/SimpleRTCAlarm
Ok The Poll Has Ended And The Masses Choose B. So You May Swap out Light Source As Long As You Inform The Competition And Its Replacement Is Also Led.Well Let's Hear From The Masses. What Yall Think
A) 1 Light Source From Start To Finish
B) Swap Out Light Sources As Long As It's Led
Ok Brother Their 2 Rules1 Is That Your Encloser Be 12x12x24. Go To Home Depot And Get Some StyrofoamMines not a tent or as small as that gorilla one. But I have an 18" X 20" X 30" veg space I made under my desk.
Sent from my iPhone using Tapatalk
Looks like we have 4 rules
1)I'm Always Right
2)You Have To Grow In A 12x12x24
3)You Have To Use Some Type of Led(Can Be Swapped Out With Another Type Of Led) And Except The Driver Fan And Filter Everything Else Has To Be Inside The Tent
4)If You think Op Is Wrong Refer To Rule #1
This is A Very Informal Contest. So Lets Make 4-20-2016 The Germ Date With A 14 Day Window For Late EntrantsCan we get a recap of all the rules and basic information? When do we start germinating seeds etc.
I still haven't received my light, if I'm lucky I'll have it this friday.
I'll need it, many parts still aren't here yet.... SOON! Probably will have to retrofit the cooling partway through.This is A Very Informal Contest. So Lets Make 4-20-2016 The Germ Date With A 14 Day Window For Late Entrants
I have a relay board that I use along with a raspberry pi for my custom timer. I just had a relay fail closed right after I added some addtional lights in the cab. I was running about 100W and added roughly 200W more. So a rough figure of 300W of lights/drivers caused it to fail (I'm not an electronics expert but I figure the power draw would likely factor into inrush). The model of relay is : songle srd-05vdc-sl-c. From the document you linked, I think it's a 'form c' and would therefore be rated at 120VAC 3A inductive load and a max allowable power force of 240W.@guod
Arduino offers dimming . It can also act as timer with RTC module
Assuming 120V 16A breaker B type
To solve inrush current problem can i use Arduino10 A relays to turn on 4xHLG240 driver in 1 second intervals when its 'Light On' time.
View attachment 3652679
I hear solid sate relays fail closed. so mechanical would be better.
I am not sure if these ebay and amazon once are mechanical or solid state
separating line and neutral help with inrush? In my current config, I only used a relay for line. That same configuration just failed (see my previous post)Looks like they can handle inrush. doesn't say how much
https://www.ghielectronics.com/downloads/man/20084141716341001RelayX1.pdf
View attachment 3652845
Separate relays for line and neutral for better isolation.
Looks like rtc class has only 1 alarm. So i can power on but need second alarm for off
will try TimeAlarms.h
.
/* Robin Mini Tent Program */
#include "DHT.h"
#include <DS3231.h>
#include <Wire.h>
#include <Time.h>
#include <TimeAlarms.h>
//Temperature sensor
#define DHTPIN 7 // DHT11 digital pin for Humidity and temprature
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE); // Initialize DHT sensor.
//Real Time Clock RTC
DS3231 Clock;
bool Century=false;
bool h12;
bool PM,LightsOnFlag;
//int second,minute,hour,date,month,year,temperature;
int temperature, temperature_old;
float h,t,f;
float h_old,t_old,f_old;
// the setup function runs once when you press reset or power the board
void setup() {
//Init Temperature sensor
dht.begin();
// initialize Pins
pinMode(6, OUTPUT); // not used
pinMode(3, OUTPUT); // control 12v fan ventilation
pinMode(5, OUTPUT); // control 1x 740nm Far Red overhead LDD 1000
//PWM 255=0.99A 2.21V, 192=0.76A 2.02V, 160=0.63A 1.91V, 128=0.51A 1.79V, 96=0.38A 1.68V, 64=0.26A 1.56V
pinMode(9, OUTPUT); // control 3000K 18V strip overhead LDD 600
//PWM 255=0.59A 36V, 192=0.44A 34.2V, 160=0.36A 33.2V, 128=0.29A 32.2V, 96=0.22A 31.2V, 64=0.14A 30.2V
pinMode(10, OUTPUT); // control 5000K 36V strip on side light LDD 700
//PWM 255=0.68A 35.3V, 192=0.51A 33.7V, 160=0.42A 32.9V, 128=0.34A 32V, 96=0.25A 31.1V, 64=0.16A 30.2V
pinMode(11, OUTPUT); // control 4x430nm 2x 660nm overhead LDD 700
//PWM 255=0.69A 16.35V, 192=0.52A 15.57V, 160=0.43A 15.13V, 128=0.35A 14.68V, 96=0.26A 14.20V, 64=0.17A 13.73V
// Start the I2C interface
Wire.begin();
//PWM Frequency
//Pins 5 and 6 are paired on timer0. base frequency for pins 5 and 6 is 62500 Hz.
//Pins 9 and 10 are paired on timer1. base frequency for pins 3, 9, 10, and 11 is 31250 Hz
//Pins 3 and 11 are paired on timer2. base frequency for pins 3, 9, 10, and 11 is 31250 Hz
//The divisors available on pins 5, 6, 9 and 10 are: 1, 8, 64, 256, and 1024.
//The divisors available on pins 3 and 11 are: 1, 8, 32, 64,128, 256, and 1024.
setPwmFrequency(6, 1); // not used
setPwmFrequency(3, 1);
setPwmFrequency(5, 64);
setPwmFrequency(9, 64);
setPwmFrequency(10, 64);
setPwmFrequency(11, 64);
// Start the serial interface
Serial.begin(9600);
Serial.println("Welcome");
ReadDS3231();
}
void setPwmFrequency(int pin, int divisor) {
byte mode;
if(pin == 5 || pin == 6 || pin == 9 || pin == 10) {
switch(divisor) {
case 1: mode = 0x01; break;
case 8: mode = 0x02; break;
case 64: mode = 0x03; break;
case 256: mode = 0x04; break;
case 1024: mode = 0x05; break;
default: return;
}
if(pin == 5 || pin == 6) {
TCCR0B = TCCR0B & 0b11111000 | mode;
} else {
TCCR1B = TCCR1B & 0b11111000 | mode;
}
} else if(pin == 3 || pin == 11) {
switch(divisor) {
case 1: mode = 0x01; break;
case 8: mode = 0x02; break;
case 32: mode = 0x03; break;
case 64: mode = 0x04; break;
case 128: mode = 0x05; break;
case 256: mode = 0x06; break;
case 1024: mode = 0x7; break;
default: return;
}
TCCR2B = TCCR2B & 0b11111000 | mode;
}
}
void ReadDS3231()
{
temperature=Clock.getTemperature();
setTime(Clock.getHour(h12, PM),Clock.getMinute(),Clock.getSecond(),Clock.getDate(),Clock.getMonth(Century),Clock.getYear());
}
void ReadDHT()
{
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
h = dht.readHumidity();
// Read temperature as Celsius (the default)
t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
}
void printstuff()
{
// Display if any parameters changed
if (h_old!=h ||t_old!=t || f_old!=f ||temperature_old!=temperature) {
h_old=h;
t_old=t;
f_old=f;
temperature_old=temperature;
Serial.print('\n');
Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.println(" *F\t");
Serial.print(year());
Serial.print('-');
Serial.print(month());
Serial.print('-');
Serial.print(day());
Serial.print(' ');
Serial.print(hour());
Serial.print(':');
Serial.print(minute());
Serial.print(':');
Serial.print(second());
Serial.print(" Control Box Temperature=");
Serial.print(temperature);
Serial.print(" ");
Serial.print('\n');
}
}
void MorningAlarm(){
LightsOnFlag=true;
analogWrite(9,96);
analogWrite(10,200);
analogWrite(11,96);
}
void EveningAlarm(){
LightsOnFlag=false;
analogWrite(9,0);
analogWrite(10,0);
analogWrite(11,0);
}
void FarRedAlarmON(){
analogWrite(5,160);
}
void FarRedAlarmOFF(){
analogWrite(5,0);
}
void loop() {
ReadDHT();
temperature=Clock.getTemperature();
analogWrite(3,64);
// Wait a few seconds between measurements.
delay(10000);
// create the alarms
// Alarm.alarmRepeat(19,18,0, MorningAlarm); // not working
if (((hour()*60)+minute())>=600 && ((hour()*60)+minute())<=1350) {MorningAlarm();}
if (((hour()*60)+minute())>=1346 && ((hour()*60)+minute())<=1357) {FarRedAlarmON();}
if (((hour()*60)+minute())>=1350) {EveningAlarm();}
if (((hour()*60)+minute())>=1357) {FarRedAlarmOFF();}
printstuff();
if (minute()>4) {
/* if ((t > 27 && LightsOnFlag==true) || (t > 22 && LightsOnFlag==false)) {*/
if (t > 27 && LightsOnFlag==true) {
Serial.print("Fan on. Lights ON Ttent > 27 or Lights OFF Ttent > 22");
Serial.print('\n');
analogWrite(3,255);
delay(30000);
}
/* if ((t < 26 && LightsOnFlag==true) || (t < 22 && LightsOnFlag==false)){
digitalWrite(6, LOW);
}*/
if (temperature > 31) {
Serial.print("Fan on. Tbox > 31");
Serial.print('\n');
analogWrite(3,255);
delay(30000);
}
/* if (temperature < 26){
digitalWrite(6, LOW);
}*/
if (h > 70) {
analogWrite(3,255);
delay(30000); }
}
else {
analogWrite(3,255);
};
}
@The DawgMy light arrived today, I could easily fit another one in the tent. Temperatures are basically the same inside and outside of the tent. I'm just worried the single COB doesn't put out enough light it's not very bright in the tent. I was going to put the driver outside the tent, but the freaking light has about 10cm of wire between the fixture and the driver?! You basically have to keep the driver next to the light if you don't have parts to extend the cable with.
ps. Could I use the plant in my picture as my competition entry? I know she's not a fresh clone, but I just feel like it would be perfect for the tent, I'd transplant her into a bigger container of course.
If it fails that quickly for 300W then it might not last long with 100W either.I'll be researching other relays - for now I'll reduce the load and move to a spare/unused relay to get back up and running.
ya, i know it's possible. I just ordered a pair of ssr 40a relays that will hopefully fix things. It makes me wonder what is inside of some of the cheap digital timers I have laying around. Could they be much better than the Songle? I may have to tear one down and see what's inside.If it fails that quickly for 300W then it might not last long with 100W either.