Controlling a Lightbox: power and temperatures

Hello everyone,
I am a newbie in Arduino tech but, as shortly described in the Subject,
I would like to control a Lightbox (a small box to indoor growing of Chilli).

I need to manage different devices:

  • a couple of lights to keep a scheduled lightcycle (220V AC)
  • a couple of small fan (clip fan), they should turn on for 15 minutes every 15 minutes (220v AC)
  • if applicable, use it as a chrono-thermostat for a small heat cable. (220V AC)

Might an Arduino manage all these ojbects?
Thanks in advance for every reply

Arduino can do this easily, but you must use some 220V relays and be carefull as 220V is lethal.

You could use something like - http://arduino-direct.com/sunshop/index.php?l=product_detail&p=201 -

The code is something like this: (not complete and tested and may contain logical errors :wink:

#define LIGHTON       (6*60*60*1000L)  // 6 hours
#define LIGHTOFF      (18*60*60*1000L)  // 18 hours

unsigned long lastLight = 0;

int lightStatus = LOW;
int heatStatus = LOW;

void setup()
{
  Serial.begin(115200);
  Serial.println("start...");
}

void loop()
{
  unsigned long current = millis();

  if (current - lastLight > LIGHTON && lightStatus == LOW )
  {
     lastLight = current;
     lightStatus = HIGH
  }
  if (current - lastLight > LIGHTOFF && lightStatus == HIGH)
  {
     lastLight = current;
     lightStatus = LOW
  }
  Serial.print("Light: ");
  Serial.println(lightStatus);  // optional
  digitalWrite(LIGHTPIN, lightStatus);

  // here more or less similar code for fan 

  // thermometer 
  float temp = -25.0 + analogRead(A0) / 5;   // assuming an analog thermometer with a certain formula (depends on the sensor assuming Celcius
   
  if (temp < 20)  // assuming to keep the temp between 20 and 22 degrees
  {
    heatStatus = HIGH;
  }
  if (temp > 22) 
  {
    heatStatus = LOW;
  }
  digitalWrite(HEATPIN, heatStatus);
  Serial.print("Temp: ");  
  Serial.println(temp);
  Serial.print("Heat: ");
  Serial.println(heatStatus);  

   delay(1000);
}

You can control the FAN based upon time or temperature or both...
Additional you can add a water sensor and make automatic waterfeeding..

THis should get you started...

robtillaart:
THis should get you started...

Thank you very much for your reply.
Your suggestions will be useful to get started in this world: in fact , I just have a 'programmer perspective' and just a few knowledge about the electronic scenario.
I hope to fill the gap soon and getting experienced in both applications :slight_smile: