Arduino Forum

Topics => Home Automation and Networked Objects => Topic started by: rbelshee on Apr 19, 2013, 04:15 am

Title: Automated LED for shop
Post by: rbelshee on Apr 19, 2013, 04:15 am
OK, I have been planning a lighting system for the shop I am building.  I do not have code or exact specs yet, I have searched the forums and have not seen anything similar (let me know if I missed it).

Essentially I want to use a Xbee Arduino setup with smartphone (or similar) control.  I will also have a few wall switches. 
The lights are going to be 50W 5000lm 6500K Integrated Square 1-LED White Light Module (32-34V) One per fixture
I will have a massive heat sink for each light.
Each LED light will be controlled individually or in pairs (depending on power supply options) It will use Xbee to communicate between lights.
I want to use a proximity sensor to sense where people are on the shop and adjust lighting (bright near the people dim in the rest)
I would also like to have a light sensor to make the system automatically compensate for ambient light (if dim more light, if there is tons of sunshine less light.

Issues I see are that I am dealing with high power LED's that require much more than the Arduino can control with the PWM.  How does one control a 50W LED with dimming, and how do you supply proper power for the LED?
Now there are going to be around 16 of these beasts in the shop, that is where the Xbee comes in, I hope they will all talk and figure it out amongst themselves and not need me to adjust the lighting.

Yes you guessed it I am a NOOB to Arduino.  I have been lurking in forums playing on Google and trying to figure all of this out myself.  I hope that one of you will find this project interesting and we can collaborate.  I have done lots of residential wiring, alarm systems in cars and houses, built computers, some circuits but when it comes to figuring out how to get these parts to play together I am a bit lost.  I do not want to burn the place down or end up spending $200 per light, so I hope there are some cheap easy ways to accomplish this.

Thank you in advance!
Title: Re: Automated LED for shop
Post by: Nick_Pyner on Apr 19, 2013, 04:25 am
You might find some joy in the Motors Mechanics and Power section. A 50w LED more or less equates with something heavy that moves.
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 19, 2013, 06:52 pm
Thank you for the reply, I have scoured that section and several other places and can not find a board that can control more than 25W.  Ideas or suggestions?
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 19, 2013, 07:12 pm
Also do I need one Arduino for each light or is thee a way to run 16 lights individually from one Arduino?  Seems like the biggest issue is the high power requirements.

Title: Re: Automated LED for shop
Post by: Erdin on Apr 19, 2013, 07:57 pm
You need an Arduino at every light.

Controlling leds with PWM can be done with a logic level power mosfet.
The problem is the power supply for the leds. They should be able to handle the PWM signal, and I don'w know if led drivers can do that.

I see this scenario: Everything seems to work so well that the lamps are mass produced and are selling good. When it is dark a person is in the shop, and the lights near him or her are on. That person uses a flashlight and switched it shortly on towards the lights above him or her. Those lights will dim, causing the lights further away in the shop to turn on. This starts a never ending wave of oscillation lights across the whole town.
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 19, 2013, 08:58 pm
Yes interior light sensing is more challenging.  I was hoping to be able to do something like the following

If presence detected in direct area light set to 35 lumens per SF (or adjustable)
If presence detected in another zone but not this zone dim to 20 lumens per SF
If no presence detected in all areas all lights off

I will have a few zonal areas like the main shop the paint booth, the shipping department and other areas.  So I will need to program say 5 zones with similar functionality but not interdependence.  In other words if no presence detected in the paint booth all lights off in the paint booth, regardless if all sensors detect people in all other zones.

I hope to be able to find light sensors that can detect specific light values and control the lighting dependent on that...  otherwise I will not be able to control lighting dynamically.  As you mentioned normal light sensors sold in hardware stores turn on or off lights at a dusk like setting so the lights turn on then the sensor sees the light bouncing off the walls and turn off the light, then the sensors see that there is no light and it turns on the light and so on.  I was at a store when a customer was arguing an employee about how the lights with a photocell should work inside because it works outside, it actually got heated bless the employee for his efforts but the customer just did not get that the light bounces around inside and outside it does not (laymen explanation).

So the big questions;
Which sensors give a specific value of light input to the Arduino board
How do you control a single 34V 1.6A led with dimming capabilities (or without for that matter)

How do you program this functionality.
Title: Re: Automated LED for shop
Post by: Erdin on Apr 19, 2013, 11:09 pm
If you want to compensate for ambient light, you are making an oscillator. Because the ambient light is also the light of the nearby lamp.

Take a look at the ABC guide, http://www.pighixxx.com/abc-arduino-basic-connections/
For example the mosfet on the bottom-left of "Card 3". Click on "Set 1 (Card 1,2,3)" to open the pdf.

This is a mosfet that can switch it, https://www.sparkfun.com/products/10213
Never mind that it is able to switch 30A. A mosfet of 30A is perfect to switch 1.6A.

There are so many light sensors.
You could connect an LDR and a resistor to an Arduino analog input (ABC guide, card 1, lower-right), 20 for 2 dollars on Ebay.
Or photodiode, 2 dollars on Ebay.
Or an expensive lux sensor.

For programming, start with the examples that come with the Arduino IDE.

How do you want to detect if a person is present ?
A PIR sensor only senses motion.
Perhaps ultrasonic ? But what if someone places a tall box under a lamp ?
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 19, 2013, 11:19 pm
Thank you for the link I will need to study that for a bit.

As you can tell I am trying to learn all of this so thank you very much for taking your time and hopefully in time I will get it all.

Honestly I still do not understand how to control the MOFSET from the Arduino and or how to wire it all up but given the correct layout I can solder like a mad man.  I have tried projects for years now and I am getting better.

I am thinking of using this https://www.sparkfun.com/products/9768 to sense the light it seems to have good control and variability.
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 20, 2013, 01:04 am
So the Arduino can control many outputs, why can I not use one board, control 16 lights, have 16 photo sensors and, some number of proximity sensors?

New construction so wiring is not a big deal.

Title: Re: Automated LED for shop
Post by: Erdin on Apr 20, 2013, 09:31 am
Sure, that is possible.
The wiring (and the costs to put them in place) could be more expensive than the Arduinos.
With long wires, the Arduino must have more protection against electrical spikes. Perhaps even optocouplers.

If you have a working module, you can make 16 of them. That is not hard.
An Arduino Pro Mini clone costs about 5 dollars on Ebay.
Making the modules to talk with each other, increases the complexity a lot.

On the other hand, having a single unit, will make it a lot easier to take all light sensors into account.
There is not need for the modules to talk with each other, since you have all the information in one Arduino.

I'm still curious, what kind of proximity sensors ?
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 21, 2013, 08:15 am
Sorry I thought I had the link for the PIR sensor
http://dx.com/p/ir-infrared-motion-detection-sensor-module-dc-5v-20v-139624

that is just one option.

I was seeing the Arduino boards for around $25 so that is one of the reasons I was looking to reduce the number of boards.  Realistically I am doing my own wiring and wire is not that expensive especially when you consider that the shop is only around 2,500 SF so even the farthest out light is only around 60 feet away (at most).  I already have tons of cat5e wire which should work for data, power conversion can be done at the light.

Yes I am scared at how I am going to get 16 Arduino boards talk and listen to each other.  I was thinking that was going to be the Xbee, but again I am adding cost.

After more research I am beginning to understand the use and need for the MOFSET to translate the power from the Arduino to my power supply
http://dx.com/p/1-6a-50w-power-constant-current-source-led-driver-85-265v-47304

But still need to verify NPN or PNP for these LED's
http://dx.com/p/50w-5000lm-6500k-integrated-square-1-led-white-light-module-32-34v-193299


Title: Re: Automated LED for shop
Post by: Erdin on Apr 21, 2013, 09:54 am
Are you going to put the mains voltage on a cat5 cable ? I would not recommend it.

If you choose the "Light to Frequency Converter - TSL235R", you have to measure the frequency. Perhaps there is a library for that. I don't know if the frequency signal will work with the cat5 cable.

For a mosfet, most of the time a N-channel mosfet is used.
But I don't know if the led driver is capable to be used with a PWM driven load.

For a 50W led, you need a big heatsink, perhaps even a fan.
The lower the temperature of the led, the longer it lasts.
I have a led like that, but only 10W. My heatsink turned out to be too small, so I had to lower it to 5W. I read that reducing the current to half of the maximum only lowers the light intensity by 20% or 30% or so, and the led will last longer. But I can't find it right now.

A PIR sensor detects motion. If someone stands still the lights will turn off.
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 22, 2013, 07:04 am
No only data on the Cat5 not Power.

I am thinking of the power supply at each light one Arduino board near the main entrance to the building and multiple sensors around the building. 

For the UI maybe a touch pad?  Smartphone?  ideas?

Yes you need a HUGE active heatsink meaning a cooling fan nad large block of aluminum/ copper for these led's
Title: Re: Automated LED for shop
Post by: arbutus on Apr 26, 2013, 05:19 pm
Um, well there are products that can help with that...

http://arduino.cc/forum/index.php/topic,160613.0.html

So the CATkit is a shield which distributes 18 data channels over CAT5 cable. Each signal can be used for a sensor, an actuator or another device such as an LCD display.  This would be very appropriate for your project with a PIR sensor and a relay board controlled by a remote Arduino for example.  Local power would be provided by AC or battery to the relay and lighting of course.

(usual disclaimer - I am associated with SmartGreenHouse.org)
Title: Re: Automated LED for shop
Post by: rbelshee on Apr 27, 2013, 05:10 am
Thank you for the heads up on that, it is an interesting option!
Title: Re: Automated LED for shop
Post by: rbelshee on May 07, 2013, 08:02 pm
Well I ordered the LED and Driver for one test.  I will get that going and then try to add functionality.
Title: Re: Automated LED for shop
Post by: Coding Badly on May 07, 2013, 11:44 pm
If no presence detected in all areas all lights off


You're happily working at your table saw.  Unfortunately the nearby motion sensor has been covered in saw dust.  The system does not detect any motion and turns off the lights.  Plop.  Your severed hand falls to the floor.

In a shop, a human brain needs to be responsible for turning off the lights.
Title: Re: Automated LED for shop
Post by: rbelshee on May 08, 2013, 03:39 am
Good point so table saws in the shop LOL

I see your point, what I do creates a ton of dust not sawdust but concrete dust the kind that destroys everything and gets everywhere. 

I was also thinking of some sort of RFID access and sensors...  BUT all that does add to the cost and complexity and in the end I may just have switches.  I still would like to be able to individually dim and control each light as opposed to all on one switch. 

The other reason I liked the presence sensing options is that I do not need to coat the switches with concrete each time I try to control something. 
Title: Re: Automated LED for shop
Post by: Erdin on May 08, 2013, 10:13 am
That makes sense.
Whatever it will turn out to be, you can control the lights from one central location.
If you make the lights with light sensors (I would choose ldr) and motion detectors, you can make the central unit as complex or as simple as you would like.

You could add a current clamp over the mains wire, to see if any electrical machine is on.
Adding a remote control would be nice.
And sending a detection alert to a sms or website, as a burglar alert.
Title: Re: Automated LED for shop
Post by: rbelshee on May 08, 2013, 09:22 pm
I guess I need to get a board and start playing.  Given the possible scenarios can you suggest which model to use?  Other thoughts on the CatKit?
Title: Re: Automated LED for shop
Post by: MacChard on May 11, 2013, 11:49 pm
Im using a CAt kit and kitten board to run high power LED lights in my greenhouses, The distance from the leonardo is about 25Metres. It really made setting up the system simple and it has been reliable. Im a fan- (it runs fans too on some of the other pins)

Title: Re: Automated LED for shop
Post by: JakeTheDog on May 16, 2013, 07:43 am

Other thoughts on the CatKit?


I got a CATkit and 3 kittens 3 weeks ago. Connecting everything was a breeze. The Arduino itself sits in my office with the CATkit shield attached. I'm running 30ft and 75ft CAT5 cables out to 2 kittens with sensors along a busy traffic lane in the warehouse to the loading doors.  These are connected to a kitten each with a 4 channel relay that hooks to a mains powered LED light bar. I suppose plugging  PIR sensors into kittens to control the the light relay would be the same idea. These are currently running on the digital pins monitoring traffic and the door activity - when a door is opened (contact switch) I sound a piezo buzzer and turn on the loading bay lights. The third kitten is running an LCD display showing the door open/closed status. This uses SPI over the analog pins.

The CATkit was pretty easy to put together and the pins were straightforward to work with. The other option I was considering to assemble the whole system was wireless, but the CATkit did the job for much cheaper and connectivity/distance/interference hasn't been an issue yet. I've got room on the kittens and plans to get creative and start adding automatic PIR light controllers for the rest of the warehouse. The intention behind this is to turn off the lights when they are not needed in the rest of the warehouse. Its been a neat project and I'm hooked on the arduino now! Looks like I need to upgrade to a Mega soon.