Automatic lighting for workshop, newbie project need help

Hi guys;

Have been looking at Arduino stuff for a while, but have not bought nor built nothing yet. That is why I have a few questions, of which some might be very basic. I have basic soldering and electronic skills, plus fabrication skills. Programming is new to me, all I have done is a few HTML websites many years ago ( I wrote the code in Notepad by hand..)

This is what I have: a workshop area that will have about 40 fluorescent fixtures 2x58 watts each. Further, there is a small room for metal fabrication machinery with 6 fixtures, a storage/warehouse area with 10 fixtures and a separate car wash area with 8 fixtures.

This is what I want to do: the workshop area is the one that will be in use most of the time. Lighting power is 4.2kW, so I would love to automatically shut some of the lights off, as daylight level increases. The fixtures could be wired in certain groups, so the ones closest to windows would go out first. As daylight increases more groups could be shut off. Vice versa, when it gets darker in the afternoons, the process should reverse. I think there should be a significant delay in the evaluation of the daylight sensor, if there is a cloud passing the sun it shouldn't cause light swithing, same applies to passing cars with headlights illuminating my windows. Of course, depending on where the daylight reading sensor is.

It would also be nice to have a few different lighting modes, say the above is "automated on". A amnual on would be nice, as also just a slight illumination for closed hours, say maybe 2 or 3 fixtures switched on. Or a few LED lights that are not part of the working hours lighting.

I have an alarm system which has a few programmable relay outputs, one of these could be a input signal for the lighting control Arduino, to either shut everything off when the alarm is triggered, maybe to turn on nighttime mode when alarm is armed etc.

The fabrication room, storage area and wash area could be easily fixed with conventional motion sensors, but if there is an Arduino present, I like to think why not fix everything with that while you're at it.

If the shop fixtures are wired in say 6 separate groups, plus I have these 3 other areas, what Arduino board should I go with? Or is it easier to build on a basic one using several relay boards? I think I will have the Arduino to control a set of relays, because it is easy to put a few switches in the system in case the Arduino fails (how reliable are they?)

Any ideas how to get started with a keypad for light control, maybe with a LCD display?

Thanks very much in advance. Any help and/or comments appreciated.

before getting into any programming or the such, how would the arduino control the lights?

you mentioned that you want different zones to turn off separately depending on the amount of light from outside. is the shop lighting currently wired in a manner that would allow this? by that i mean, does a single switch turn all of the lights on at once?

also, where are the switches/controls for the lights currently located? are they all centrally located or spread out throughout the area?

the infrastructure within our shop needs to support this functionality and the number of zones/switches will determine the number of relays needing control

getting the infrastructure within your area may require hiring an electrician to re-wire tour lighting fixtures.

now to answer your questions:

you mentioned

If the shop fixtures are wired in say 6 separate groups, plus I have these 3 other areas, what Arduino board should I go with?

this would require 9x relays, which would require 9x digital I/O pins

Any ideas how to get started with a keypad for light control, maybe with a LCD display?

a basic keypad utilizes one digital I/O per row and per column. so a 4x4 keypad would require 8x digital I/O to operate. there are other keypads which do not operate such as this, and there are circuits which can be used to reduce the number of I/O but let's keep this simple for now.

more details here:
http://playground.arduino.cc/Main/KeypadTutorial

depending on the LCD display you wish to use (graphic vs character only) you will need between 4x and 10x digital I/O lines. i would recommend using an I2C display

more detail here
http://forum.arduino.cc/index.php?topic=348108.0

you mentioned 6 zones plus three others which would require 9x sensors of some kind. i assume they would be photocells which would be wired into the analog inputs, so you need 9x ADC inputs

this means in total you would need 9x + 8x I/O for the relays and keypad. the I2C bus for the display has dedicated I/O lines and multiple devices can run on the bus allowing you to still have a real time clock for instance.

this results in 17x digital I/O, an available I2C bus connection, and 9x ADC inputs.

a MEGA has the following connections

It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports)

where an uno has

It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs

based on this i would go with a MEGA and look at the links supplied to get you started on the keypad and LCD

Hi

Wow, that reply came in much faster than I expected, on some boards too complicated topics tend to get unnoticed.. so thanks for that so far!!

First of all, the 3 smaller areas would just be extra luxury to be Arduino controlled, but if that makes things complicated to have several different "issues" on a single board in a single code/program, I can live with having them conventionally wired with IR sensors.

[How do you usually do, say you have climate control, interior and exterior lighting, other house automation. Is it better to split everything to separate boards to handle, or manage everything with just one?]

The situation with my premises are that they are still under construction. Just ordered a set of lamp fixtures today. That gives me the freedom to wire them whatever way I want to. My idea was to "calibrate" the artificial lighting, I just need to make a temporary arrangement so I can switch each fixture on/off separately. Doing that, I just have to test what can be switched of or what needs to be switched on to maintain acceptable lux levels inside the shop at certain daylight conditions. I have the time to do that, and I also have a luxmeter. In that way, I should be able to figure out sensible groups of fixtures. I think that the end result will be something like having about 50% of the fixtures on one relay, and the rest of the fixtures split up evenly on the 5 other relays. That is only because I think that during a sunny day, there still are spots and corners so far fron any window, that it will need all the artificial lighting available. Turning off just a few fixtures at a time should make it as uncomfortable as possible, not giving away too much of the light at once.

Imagine, all this would be solved if I was ready to give away a few thousand euro, if I bought dimmable fixtures and a industrial lightning control system. Would just need to set a lux level =)
How true and good that would be, I don't know. Would probably need a bag of lux sensors..

About the keypad: an easy way to save some I/O if you don't have plenty, is to copy what for example VW group uses in their driver door window switch. Even if it has 4 switches, of which the rear ones are close-off-open, the front ones have the same functions plus a comfort function that the window will open/close all the way with a little extra push/pull on the switch, ie they have 5 positions each. All this is wired to the control unit with just 2 wires. Every switch position has a resistor in series, they have just programmed the ECU to recognize all possible resistance values the driver may ask for, even if multiple switches are operated simultaneously. With a rotating 5-position switch this should be possible with Arduino as well I guess? Of course, it's not as fancy as an LCD keypad..

Few further questions:

-the "you need a Arduino Mega" probably means a Mega 2560 r3? Or am I better off somehow with the next gen Arduino Due (this will replace the Mega, if I got it right?

-should I buy a starter kit or another kit to get started, will the programming need lots of training, or will my code be simple? Basically, as far as I can think of it, it just needs to switch off a relay if it sees a certain daylight level is reached and maintained for a set time, switch another relay off when even more daylight is available etc

-what relays are recommended? Option A is to find relays that can handle 230V AC @ 16A, option B is the Arduino controls relays, that will control another set of relays that switch the operating current

-any accessories I will need, that I should buy with the board itself? Programming cable yes, but what else?

lehtinen75:
Few further questions:

-the "you need a Arduino Mega" probably means a Mega 2560 r3? Or am I better off somehow with the next gen Arduino Due (this will replace the Mega, if I got it right?

-should I buy a starter kit or another kit to get started, will the programming need lots of training, or will my code be simple? Basically, as far as I can think of it, it just needs to switch off a relay if it sees a certain daylight level is reached and maintained for a set time, switch another relay off when even more daylight is available etc

-what relays are recommended? Option A is to find relays that can handle 230V AC @ 16A, option B is the Arduino controls relays, that will control another set of relays that switch the operating current

-any accessories I will need, that I should buy with the board itself? Programming cable yes, but what else?

i was referring to the MEGA r3. if you want a graphic LCD display which requires more processing power, go with the DUE.

i have built a system which uses relays to control power items
http://forum.arduino.cc/index.php?topic=140740.0

for the relays, i used these
http://www.amazon.com/gp/product/B0057OC5WK/ref=oh_details_o09_s00_i00?ie=UTF8&psc=1

you can also see which power supplies i have used etc. as they are listed on my project thread.

when it comes to coding, start small.

create one project where you learn how to use just the keypad
create another program where you learn how to use just the display
create another program that controls the relays
create another which processes your photo sensors
create another which uses a RTC to tell you the date and time

once you have all the smaller pieces, you can begin to combine them into one project.

Cool. Thanks for the info. Didn't look at your projects yet since I don't have anything to play around with, but since I now know what to begin with I ordered the following:

Basic kit with some components to get started with,
http://www.miniinthebox.com/basic-kit-02-mega-2560-r3_p3247349.html?utm_campaign=cartcross

8-relay module shield

830 breadboard to experiment on

Female to male wires

Male to male wires

Now just need to wait.. 8)

Will receive my stuff tomorrow, just paid for the import taxes... First time ever Arduino playtime next weekend!!

lehtinen75:
Will receive my stuff tomorrow, just paid for the import taxes... First time ever Arduino playtime next weekend!!

have fun, and remember to start small and to work in building blocks and then assemble them together into one larger project.