MeanWell LED Drivers: 3 in 1 Dimming Function.

kanda

New Member
Ugh, now I am realising it is possible that the Fotek SSR - 40 and 25 DAs I have could be fake... They say "made in Taiwan" not "Taiwan made"

Considering I got four relays for $8... haha

The 40 Amp SSR was manufactured with a BTA20-600C TRIAC. I did a quick online search and discovered that the part is rated at a continuous load of 20 Amps and a non-repetitive load of 200 Amps. In other words, the TRIAC used in the 40 Amp SSR is only rated for 20 Amps!
I live in Australia, is it correct to say that the 240v would make the current pretty low or am I misremembering? Either way I'll probably just try and source a legitimate Fotek. ...
 
Last edited:

1212ham

Well-Known Member

Attachments

storm66

Active Member
hi guys so ive got a hlg 240h 36b driver and ive got a some 50k pots am i right in that , it will dim to 50% and upto 100% do i need a resistor? if so what? its all a bit confusing
 

RandomHero8913

Well-Known Member
hi guys so ive got a hlg 240h 36b driver and ive got a some 50k pots am i right in that , it will dim to 50% and upto 100% do i need a resistor? if so what? its all a bit confusing
I think you're going to need a 100k pot. People run 50k when they have two drivers.
 

xX_BHMC_Xx

Well-Known Member
hi guys so ive got a hlg 240h 36b driver and ive got a some 50k pots am i right in that , it will dim to 50% and upto 100% do i need a resistor? if so what? its all a bit confusing
You'll need a 100k ohm pot to get full power from the driver, plus a 10k ohm resistor to keep from going below the recommended 10% minimum. Or get a 50k ohm resistor for your current setup, but then you could only dim 60-100%.
 

storm66

Active Member
Ah OK so I'm only getting 10 to 50% with this 50k pot? If that the case this array is going to be bright . I'll get a 100k . I will try the 50k resistor cos that would be fine for me half dimming and up . Thanks guys for ur coments
 

Gromax 3590B

Active Member
Dimmable via internet (PWM). 60 Watt 6500K CXB3590 (highest bin CXB3590-65E-CD-N0H)and 200 Watt 2700K CXB3590 (highest bin CXB3590-27G-CB-N0H) to make different color temperatures by mixing. Make schedules like sunrise and sunset and lenght of day. Every led has an ds18b20 temperature sensor on the Tc measuring point. Build in camera to watch the plants from everywhere. I need a formula to calculate ppf, ppfd and lumen with the parameters Watt and Tc.

 
Last edited:

BobCajun

Well-Known Member
I've read that it's best to have lights on full when turned on, because plants will tend to gear their photosynthesis rate to the first light that hits them. I know it sounds like that would be bad in the natural world where it gradually gets brighter but that's what the article said. I don't have the reference at hand, just from memory. A gradual "sunset" might help something, I don't know on that one. My guess is that it would just reduce overall growth, being less total light. Unless somebody has an experiment showing that sunrise/sunset helps in some way, I'm just going with full on and full off myself.

In fact, it might actually be helpful to have the lights at higher brightness at turn-on and then gradually reduce to a lower brightness for the duration. You might get better growth with only slightly higher power usage, because it's only on full for like 15-30 minutes or whatever. Maybe even full light at the end too, sort of a sandwich. Nobody ever tried REVERSE sunrise/sunset yet.
 

Gromax 3590B

Active Member
nice setup. Is that two ESP8266 running on wifi?
That is one esp8266. All useable pins used for spi (4), i2c (2) and onewire (1). The lcd works via an i2c port expander (the black ic). the relais and buttons work via the i2c port expander also. The little blue thingy is an level shifter for communication between the esp8266 (3.3V) and the i2c port expander (5V) and pca9685 (5V). The big blue thingy is an pca9686 16 channel 12bit (4096 steps) PWM generator. PWM through a base resistor and a 2n3904 transistor (without additional 10V source).
 

wietefras

Well-Known Member
I need a formula to calculate ppf, ppfd and lumen with the parameters Watt and Tc.
You can get the the lumen values from the Cree Product Characterization Tool for combinations of W and Tc. Then use a simple a lumen/lux to PAR conversion factor for the COBs used to get PPF. Divide by surface area after deducting a guesstimate (or check) for the wall losses to go from PPF to PPFD.

Conversion for CXB3590 2700K 80CRI should be around 67 (divide the lumen numbers by that factor to get an estimate of PPF). Haven't seen any factors for 6500K coming by, but for Cree 5000K 80CRI it's 72.5

I guess you could try making a formula for the datasheet figures (lumen for W,Tc), but a lookup table with some interpolation for further fine tuning would probably be a lot easier.

On the other hand, the COB calculator probably does something like what you want already. Perhaps you can talk with him about sharing some data/formula's?
 

VegasWinner

Well-Known Member
That is one esp8266. All useable pins used for spi (4), i2c (2) and onewire (1). The lcd works via an i2c port expander (the black ic). the relais and buttons work via the i2c port expander also. The little blue thingy is an level shifter for communication between the esp8266 (3.3V) and the i2c port expander (5V) and pca9685 (5V). The big blue thingy is an pca9686 16 channel 12bit (4096 steps) PWM generator. PWM through a base resistor and a 2n3904 transistor (without additional 10V source).
Real nice. Great work. Love to see DIY and enginering all in one :) I use the ESP8266 development boards as well. I am experimenting with a motor driver board for dimming, as well with ESP. Have you looked at the ESP32 yet? many more pins, :) :O and lots more memory. I like the 2n3904 transistor solution, looks like a winner with that one. I am using LM358 with circuit balance and 12v external power for dimming. I developed a 6 and 12 channel led controller for the same purpose. I am looking at Raspberry Pi, with OpenHab and MQTT for a complete automation system. I have not been working on that as I have been working on another project for the last few months. A different lighting controller for a different industry, DMX512 Stage Light Controller for LED lights for a client. After I complete that I am finishing up my new 12 channel controller with 6 channel relay control, and 6 channel 5v and 10v dimming all internal.

The hardest part is packaging the project up for daily use. If you need a source for project boxes let me kn ow I can share with you, as well. I use a laser to cut acrylic sheets to make cases, and parts.
namaste
 

Gromax 3590B

Active Member
Real nice. Great work. Love to see DIY and enginering all in one :) I use the ESP8266 development boards as well. I am experimenting with a motor driver board for dimming, as well with ESP. Have you looked at the ESP32 yet? many more pins, :) :O and lots more memory. I like the 2n3904 transistor solution, looks like a winner with that one. I am using LM358 with circuit balance and 12v external power for dimming. I developed a 6 and 12 channel led controller for the same purpose. I am looking at Raspberry Pi, with OpenHab and MQTT for a complete automation system. I have not been working on that as I have been working on another project for the last few months. A different lighting controller for a different industry, DMX512 Stage Light Controller for LED lights for a client. After I complete that I am finishing up my new 12 channel controller with 6 channel relay control, and 6 channel 5v and 10v dimming all internal.

The hardest part is packaging the project up for daily use. If you need a source for project boxes let me kn ow I can share with you, as well. I use a laser to cut acrylic sheets to make cases, and parts.
namaste
I am planning to use a raspberry pi for complete automation too. All lights connected via WiFi to the raspberry and the raspberry controls the lights. I want to make it possible to change the settings of the lights via internet (wan) in the raspberry. If internet connection fails the lights will keep working because all the settings are stored in the raspberry. I am planning to let the lights make a HD picture (raw data) every 15 minutes and those pictures are stored on a harddisk on the raspberry for timelapse video's. I use lasercutting for making the case too. I plan to use two layers of plywood with the nerves in opposite direction for extra strength.
 

wietefras

Well-Known Member
I'm still planning on doing that too, but only if I can get a side-by-side going. Otherwise I doubt it will be easy to know if it works or not.
 

NoFucks2Give

Well-Known Member
've read that it's best to have lights on full when turned on, because plants will tend to gear their photosynthesis rate to the first light that hits them.
Did you read that in a peer review study? What do you think the plant would do otherwise? Let's say the lights come on dim then later get bright. Is the plant going to say aw shit, that too bright, and put its sunglasses on? No I think it's going to suck it in and make more oxygen and stuff.

Here is a hypothesis I like. Flash the light on at a 10hz rate with a millisecond flash. Based on a peer reviewed study.

In 1932, Robert Emerson and William Arnold performed a key experiment that provided the first evidence for the cooperation of many chlorophyll molecules in energy conversion during photosynthesis. They delivered very brief (0.00001 s) flashes of light to a suspension of the green alga Chlorella pyrenoidosaand measured the amount of oxygen produced. The flashes were spaced about 0.1 s apart, a time that Emerson and Arnold had determined in earlier work was long enough for the enzymatic steps of the process to be completed before the arrival of the next flash. The investigators varied the energy of the flashes and found that at high energies the oxygen production did not increase when a more intense flash was given: The photosynthetic system was saturated with light
 

NoFucks2Give

Well-Known Member
PWM through a base resistor and a 2n3904 transistor (without additional 10V source).
No. Don't do that. A transistor switching is not good. There is a reason they have an inductor on the output of an LED driver.

Something simple like this. $2 in parts. PCB footprint 0.5 sq in

pin 6 is the PWM dimer
R3 sets the default current
R4 sets the switching frequency
Then pick the value for the inductor based on the switching frequency and efficiency.
This driver can achieve a 97% efficiency for under $3.
It extends the footprint from 0.9" to about 1.25" as shown.
The yellow is optional. That is a thermal shut down switch. It gets connected to a thermistor mounted near an LED.


Untitled.jpg
 

NoFucks2Give

Well-Known Member
I'm still planning on doing that too, but only if I can get a side-by-side going.
If you are referring to the sunrise sunset thing I have the data where you set the lat lng and date (does not have to be today's date) and it will do sunrise to sunset based on whatever location and time of year.

I did it on a Heliospectra RX-30. The code running on windows controlling the fixture over Ethernet.

I also wrote some code to make the Heliospectra do a light show to an mp3 player using the Windows media API.

it's tested and works well. still looking for the sunrise sunset code.

<?php
header('Content-Type: text/html; charset=utf-8');
header('Connection: Keep-Alive');
header('Keep-Alive: timeout=5, max=100');
header('Cache-Control: max-age=3600');
header('Vary: Accept-Encoding');
header("Access-Control-Allow-Origin: http://169.254.1.104");
echo <<<EOT
<!DOCTYPE html><html lang="en"><head><title>Helio</title><meta name="viewport" content="width=480px, initial-scale=1.0" /><style type="text/css">

.float {
position: absolute;
}

.flex-container {
display: inline-flex;
flex-direction: column;
flex-wrap: wrap;
height: calc(100vh - 320px);
}

div {
margin: 10px;
}
</style></head><body>

<canvas id="theCanvas" width="1024" height="256" title="Press Play!"></canvas>
<div class="flex-container">
<div>
<button id="playButton" type="button" class="btn btn-primary"><h1>&#9658; Play Track!</h1></button>
<br/><button onclick="cap()">Capture</button><br/>
<button id="pause" class="ctl" onclick="pauseAudio()">Pause</button>
</div>
<div>
<span id="currentTime">00:00:00</span>
<input id="slider" type="range" value="0"/>
<span id="totalTime">00:00:00</span>
</div>

<div>
<br/><h1 id="artistName"></h1><br/>
</a>
</label>
</div>
<div>

</div>
</div>
<script type="text/javascript">//<![CDATA[
/*
Read my blog post about Web Audio API:
http://codepen.io/DonKarlssonSan/blog/fun-with-web-audio-api
*/
var capture = false;
var intensity = new Array(0,0,0,0,0,0,0,0,0);
var trans = new Array(5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,);
function cap(){capture = true;}
(function() {
var AudioContext;
var audio;
var audioContext;
var source;
var analyser;

var canvas = document.getElementById("theCanvas");
var canvasContext = canvas.getContext("2d");
var dataArray;
var analyserMethod = "getByteFrequencyData";
var slider = document.getElementById("slider");
var streamUrl;
var isIdle = true;
var pause = document.getElementById("pause");
var canvasWidth = canvas.width;
var canvasHeight = canvas.height;
function pauseAudio(){if (audio.paused) {audio.play();pause.innerHTML='Pause';}else{audio.pause();pause.innerHTML='&nbsp;Play&nbsp;';}}

function initAudio(streamUrl) {
AudioContext = window.AudioContext || window.webkitAudioContext;
audio = new Audio();
audio.crossOrigin = "anonymous";
audioContext = new AudioContext();
source = audioContext.createMediaElementSource(audio);
source.connect(audioContext.destination);
analyser = audioContext.createAnalyser();
source.connect(analyser);
};

function get(url, callback) {
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState === 4 && request.status === 200) {
callback(request.responseText);
}
}

request.open("GET", url, true);
request.send(null);
}

var clientParameter = "client_id=3b2585ef4a5eff04935abe84aad5f3f3"

// Basing everything on the track's permalink URL. That is what the user knows.
// Makes it possible to use the text box for pasting any track URL.
// The Outsider is a friend of mine.
// The majority of his tracks are on Mixcloud:
// https://www.mixcloud.com/outsider_music/
var trackPermalinkUrl = "https://soundcloud.com/the-outsider/the-outsider-death-by-melody";

function findTrack() {
get("http://api.soundcloud.com/resolve.json?url=" + trackPermalinkUrl + "&" + clientParameter,
function (response) {
var trackInfo = JSON.parse(response);
slider.max = trackInfo.duration / 1000;
document.getElementById("totalTime").innerHTML = millisecondsToHuman(trackInfo.duration);
// document.getElementById("artistUrl").href = trackInfo.user.permalink_url;
// document.getElementById("artistAvatar").src = trackInfo.user.avatar_url;
// document.getElementById("artistName").innerHTML = trackInfo.user.username;
// document.getElementById("trackUrl").href = trackInfo.permalink_url;
// if(trackInfo.artwork_url) {
// document.getElementById("trackArt").src = trackInfo.artwork_url;
// } else {
// document.getElementById("trackArt").src = "";
// }
// document.getElementById("trackName").innerHTML = trackInfo.title;
streamUrl = trackInfo.stream_url + "?" + clientParameter;
}
);
};

function startIdleAnimation() {
// Makes the sine wave height increase and decrease
var amplitude = 100;
// Makes the sine wave move to the left
var phase = 0;
var isIncreasing = false;
function drawIdleAnimation() {
canvasContext.clearRect(0, 0, canvasWidth, canvasHeight);
if(isIdle) {
requestAnimationFrame(drawIdleAnimation);
}
canvasContext.beginPath();
for(var x = 0; x < canvasWidth; x++){
canvasContext.lineTo(x, Math.sin((x+phase)/50)*amplitude + 120);
}
canvasContext.stroke();
phase++;
if(amplitude > 100) {
isIncreasing = false;
} else if(amplitude < 1) {
isIncreasing = true;
}

if(isIncreasing) {
amplitude++;
} else {
amplitude--;
}
}

drawIdleAnimation();
}

function startDrawing() {
// Stop drawing idle animation
isIdle = false;
analyser.fftSize = 32;
var bufferLength = analyser.frequencyBinCount;
console.log(bufferLength);
dataArray = new Uint8Array(bufferLength);
canvasContext.lineWidth = 16;
canvasContext.strokeStyle = 'rgba(0, 0, 0, 1)';
function drawAgain() {
canvasContext.clearRect(0, 0, canvasWidth, canvasHeight);
requestAnimationFrame(drawAgain);
analyser[analyserMethod](dataArray);

for(var i = 0; i < bufferLength; i++){
canvasContext.beginPath();
canvasContext.moveTo(i*32, 255);
canvasContext.lineTo(i*32, 255 - dataArray);
canvasContext.closePath();
canvasContext.stroke();
}
if(capture === true){console.log(dataArray);capture = false;}
intensity[5] = trans[dataArray[0] + dataArray[1] + dataArray[2] - 100]; // + dataArray[3]];
intensity[4] = trans[dataArray[4] + dataArray[5]]; // + dataArray[6] + 100]; // + dataArray[7]];
intensity[3] = trans[dataArray[8] + dataArray[9] + dataArray[10] + 75]; // + dataArray[11]];
intensity[6] = intensity[5] ;
setIntensity();

}

drawAgain();
}

function startButton_Clicked() {
audio.src = streamUrl;
audio.play();
slider.value = 0;
// Using four seconds so the user can change the value of
// the slider. Too short interval will cause the automatic
// updating to steal the control from the user.
setInterval(function () {
slider.value = audio.currentTime;
}, 4000);

var currentTime = document.getElementById("currentTime");
setInterval(function () {
currentTime.innerHTML = millisecondsToHuman(audio.currentTime * 1000);
}, 1000);

startDrawing();
}

function jumpTo(here) {
if (!audio.readyState) return false;
audio.currentTime = here;
//}
//audio.fastSeek(here);

};

slider.addEventListener("change", function () {
jumpTo(this.value);
});

function millisecondsToHuman(milliseconds) {
var date = new Date(null);
date.setMilliseconds(milliseconds);
return date.toISOString().substr(11, 8);
};
document.getElementById("playButton").addEventListener("click", startButton_Clicked);




// document.getElementById("findButton").addEventListener("click", function(){
// trackPermalinkUrl = document.getElementById("trackUrlSearch").value;
// findTrack();
// });

startIdleAnimation();
findTrack();
initAudio();

})();
function setIntensity(){
xmlhttp=null;
var Url='http://169.254.1.104/intensity.cgi?int=' + intensity[0] + ':' + intensity[1] + ':' + intensity[2] + ':' + intensity[3] + ':' + intensity[4] + ':' + intensity[5] + ':' + intensity[6] + ':' + intensity[7] + ':' + intensity[8] ;
document.getElementById("artistName").innerHTML = intensity[3] + ':' + intensity[4] + ':' + intensity[5];
if (window.XMLHttpRequest){ // Fuckin\' Microsoft!
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject){ // Fuck Fuckin\' Microsoft!
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp!=null){
// xmlhttp.onreadystatechange=intensityResponse;
xmlhttp.open("GET", Url, true);
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8",'Access-Control-Allow-Origin');
xmlhttp.send();
}else{
alert("UNEXPECTED ERROR: XMLHttpRequest not supported");
}


};
function intensityResponse(){
var retVals = '';
if (xmlhttp.readyState==4){
if (xmlhttp.status==200){
var retVal=xmlhttp.responseText;
if(retVal == 1){document.getElementById('m' + mp3).style.display = 'none';if(current == mp3){next();}}else{alert('WTF:' + retVal);}
drawAgain();
}
else{
alert("UNEXPECTED AJAX ERROR: : " + xmlhttp.statusText + "HTTP Status: " + xmlhttp.status);
}
}
};

//]]>
</script>
EOT;
echo microtime(true) - $t;
?>
</body></html>
 

BobCajun

Well-Known Member
If ever there was an appropriate time to use the quote condenser tags. But as far as sunrise/sunset, maybe changing the spectrum would help but starting and ending with reduced brightness would likely be pointless. For reptiles and fish maybe, so eyes won't get blasted, but plants don't seem to mind full light instantly.
 
Top