I am building, what started as an automated chicken coup door, and is now a Chicken Coup management system It is a fun projected to learn Arduino and electronics and many people have help here along the way.
The last part of the project is to add in an LED strip and have this come on to extend the day length at the end of Autumn and beginning of spring (Chickens need a minimum day length to lay eggs). The light will come on via a dimmable Mean Well driver and ramp up over 10 min to full brightness in the morning once a maximum night time is reached. (There is also a function to turn the light on or off for cleaning purposes in the coup)
The Mean Well Driver has 10v PWM dimming and while I was looking for how to drive the PWM from Arduino (stepping my 12v to 10 v and using a transistor for the PWM) I came across various posts about using an Opto Coupler. I didn't know what that was and have done some google research
A member on the forum here said (in 2015) to;
" Connect the opto transistor collector to Dim+, and the opto transistor emitter to Dim-.
Opto LED cathode to Arduino ground, and opto anode via a 1k current limiting resistor to an Arduino PWM pin."
I don't like using electronics if I don't understand it before I solder it in place, I also don't have one and the nearest electronics shop is a 1 hr drive, There were discussions on other posts about keeping the ground isolated between the 12v LED driver and the ground of the Opto. So will my diagram work as I am sharing a common battery? and is the Opto 4n25 or 4n28 suitable?
Secondly it seems to me the all this does is short the 10v PWM + and - together at the duty cycle of the PWM. So does this work by the fact that if the 10v PWM is open then the lights are 100% and if shorted to ground they are 0% and the Opto is then performing that function at the duty cycle to provide dimming ? So in reality it has no need of the 10v if done this way.
What type of strip are you using, and why does it need this mean well driver?
For light in my chicken houses I use ordinary 12V led strips. They are dimmed with a logic-level mosfet controlled directly by an arduino pwm pin. No driver, no opto-isolators.
PaulRB:
For light in my chicken houses I use ordinary 12V led strips. They are dimmed with a logic-level mosfet controlled directly by an Arduino PWM pin. No driver, no opto-isolators.
But are you using them just to be able to work inside, or are you emulating daylight?
To be honest, the lights are mostly to encorage them to go to bed at the right time and enable us to count them before locking up! We don't use them to extend the laying season. Didn't know the light needed to be that bright for that purpose.
The houses are too small to go in, the sides are removable for cleaning.
PaulRB:
What type of strip are you using, and why does it need this mean well driver?
For light in my chicken houses I use ordinary 12V led strips. They are dimmed with a logic-level mosfet controlled directly by an arduino pwm pin. No driver, no opto-isolators.
It is a MeanWell is a LPF-40D and only being used as it is sitting on my shelf unused. It will be driving about 2m of strip LED at a 1000mA per m.
Initially my searching said to use a MOSFETS exactly as you have done directly driving the strip. While trying to find out what Mosfet to use and how they work and how to read a datasheet for the current and heat etc I came across the post about using a opto on a LED driver and thought it sounded easier.
The programming allows you to set the desired day length i.e 10 hrs minimum and then calculates when to dim the lights on in the morning to achieve that (24hrs - 10 hrs = 14 hrs of darkness before lights come on). it can be dark here at 1730 hrs and sunrise at 0800. It just gives us a few more weeks of laying.
A constant current LED driver is the wrong supply for a LED strip that already has (resistive) current limiting.
LPF-40D??
What are the last two digits. You might be able to (mis-)use the 12volt version for a 12volt LED strip.
The opto isolation was given (by me) for mains powered LED drivers.
But your diagram could work.
Leo..
Wawa:
A constant current LED driver is the wrong supply for a LED strip that already has (resistive) current limiting.
LPF-40D??
What are the last two digits. You might be able to (mis-)use the 12volt version for a 12volt LED strip.
The opto isolation was given (by me) for mains powered LED drivers.
But your diagram could work.
Leo..
Sorry should have clarified it is the LPF-40d-12 so it is 40w dimmable 12 v constant current or constant voltage led power supply (according to data sheet) It has 3 way dimming of resistive, 0-10v or 10v PWM. The led strip is 12v strip and has been running off that driver using the 0-10v dimming on another project before being mothballed. Now just trying to recycle it.
Ok, so the mains powered version I saw from your post said to keep the ground/earth seperate due to the the fact it was mains powered (AC vs DC) I didn’t pick up on that from the original post. So my circuit all being DC should be ok with a common ground.
I know the opto 4n2x are obsolete from Paul’s comment but will it be adequate for my application.
I am an electronics newbie (or hack if you prefer) but trying my best to learn.
The 4N2x did work ok 50 years ago, and should work fine in this case.
Can drop the 1k resistor to 470 ohm if you can't dim right down to "off".
Should use more modern parts for new projects though.
Leo.. (Dunedin)
Wawa:
The 4N2x did work ok 50 years ago, and should work fine in this case.
Can drop the 1k resistor to 470 ohm if you can't dim right down to "off".
Should use more modern parts for new projects though.
Leo.. (Dunedin)
50 years ago, far out. That is the two available at Jaycar on their website. The others on the website were non-zero crossing (haven’t worked out what that is yet) or Darlington pair versions.
Also just realised my diver is 230v supplied not 12v (idiot) so probably go back down the mosfet path. (Currently holidaying in Hokitika)
Cheers Al
The one I often recommend and use myself is STP16NF06L, but there are many similar alternatives. It's rated at 16A, so for your 2A load you won't need a heatsink. The important thing is that it has a logic-level gate, so the 5V signal from the Arduino can switch it fully on, giving a low resistance and low heat dissipation.
I will check that one out. I’m not good at reading data sheets and it seems every manufacturer does them different combined with our local electronics shop has a limited selection
Allan_Pritchard:
OK, the 4N2x are the only two options in my catalog. The only other one is a MOC3020 or MOC3021 which are non-zero crossing.
I don't know what they mean with "non-zero crossing", that sounds nonsensical.
Those two parts are used commonly in AC control applications, as it's a DC to AC type of optocoupler (i.e. the output side conducts in both directions). This in contrast to the 4N25 or PC817 family which are DC to DC optocouplers.