Meeting location for the 2024/2025 Season will be at J.A. Dulude arena.  Meetings start at 7 pm.

Starting new project - Arduino-based LED controller. Electrical part

Started by gvv, December 02, 2011, 11:09:51 AM

Previous topic - Next topic

gvv

Ok, there are a lot of threads on reef forums, but I found that sometimes it is impossible to find the right answers on the questions I have, as some threads are hundreds of pages long and it is very difficult to follow the discussion... :)

My target is to make a controller, that will only deal with LED drivers (for now) and will do this sunrise, dawn effect. Besides that I'm currently only planning to be able to read the temp of the LED  heatsink and tank temp. After that we will see.
I selected Arduino instead of the ready available controllers, just because I decided that I want to do something by myself and be able to change the program, add additional functionality when I will need it on my own. Just for fun, so please don't tell me that it can be done by commercial controllers :) I planning to enjoy myself, with your help  ;D. And I will need it...

But this particular thread I would like to devote to the electrical circuit... If there are some people who knows the topic, I really want them to comment or correct me where I'm wrong :) We will come to the program later, when this topic will be covered.
Also, sorry, if I will be using some terms/numbers here

Before I will go to challenges, just some background:
Looking through the characteristics of Mean Well "P" driver (I'm looking specifically at ELN-60-48), I found out that the response diagram shown in the doc is far from ideal. Shut off at 11% duty cycle with very high step:
http://www.meanwell.com/search/eln-60/eln-60-spec.pdf
So, I decided to select ELN-60-48"D", which requires analog 0-10V DC for dimming control

So, here are some challenges:
1. Convert 0-5V PWM signal coming from Arduino digital pin into 0-5V analog signal
2. Amplify this analog signal to get 0-10V on the output

Again, I'm not electrical engineer, so sorry if I will start this "obvious" discussion  ;)
To resolve the first challenge, the so-called low-pass filter can be used. It is some kind of resistor-capacitor combination. We will not go with physics here, just some notes. In order to get smooth signal the correct R (resistor) and C (capacitor) should be used. Their parameters depend on the frequency of the PWM signal, which is very low in this particular case (about 500HZ for those who are interested). As I found out the better analog signal can be obtained for higher frequency value. Very good site I found which helps to select R/C combination can be found here:
http://sim.okawa-denshi.jp/en/PWMtool.php
With it's help, I found out that it is possible to get analog signal with low ripple at the expense of responsiveness. If you will select 500Hz, 100K (R) and 2.2uF (C) you will get pretty smooth output signal, but it will take a second or so... Do I care if the lights will be brighter a second later? Not sure.
So, assume this issue resolved.
Here - please correct me if I'm wrong!

In the next post I would like to talk about amplifier. There are lot of approaches, like using so-called "op amp", transistors, some other combination. I'm lost here :-\

fischkopp

I would use a opamp right after the PWM pin and set the gain to 2x or a bit more. That would assure that you don't overload the output of the microprocessor. Apply the smoothing circuit after the opamp.
be aware of the green side

gvv

Still waiting for parts to arrive...
Meanwhile I got my Arduino Uno and started with programming. Good this is not very complicated, as I'm in Java and C++ passed me by :)
Currently implemented the part dealing with LED drivers dimming in/out as well as temperature sensor reading. I found one site where the person was using digital potentiometer as the input from PWM pins and looks very interesting - you may get support for up to 6 independent channels from 2 PWM channels, but I need to give it a try - ordered some parts. So, soft now can either control 4 PWM channels which are connected to dimmable LED drivers or control up to 4 channels through 2 PWMs using digital pot.
I decided to use STL libraries (like vector, map, etc) and the support of these libraries just took 4-6K from my 32K pool... Not bad for now, but we will see how it will go :)
Idea to use EEPROM to store configuration values didn't went well - some of values are just "0" when I retries them. Either memory is not big enough or there are some issue in the library I was using, so decided not to use EEPROM anymore... :-\

With electrical schema - still not sure what I will do and will be ready to share only when will have parts in hands and make some experiments...

HomerJ

Quote from: gvv on December 07, 2011, 10:33:16 PM
Idea to use EEPROM to store configuration values didn't went well - some of values are just "0" when I retries them. Either memory is not big enough or there are some issue in the library I was using, so decided not to use EEPROM anymore... :-\

I am using EEPROM without problems, I can send you my code tonight when I get home if you want.