Reef Central Online Community

Reef Central Online Community (http://www.reefcentral.com/forums/index.php)
-   Do It Yourself (http://www.reefcentral.com/forums/forumdisplay.php?f=3)
-   -   Chinese LED hacking HELP! (http://www.reefcentral.com/forums/showthread.php?t=2654335)

thegasman2000 10/10/2017 09:56 AM

Chinese LED hacking HELP!
 
So I have been running a 130w Chinese LED for few years and noticed some rust... So I dismantled it and found the case was leaking. Could explain my SPS deaths.

Anyway I am making an arduino controlled reef controller and wondered if I could bypass all the electronics in this unit and just reuse the power supplies and the array itself.

The array
https://imgur.com/pjTMOVa

The PS
https://imgur.com/Pnp4hOT

and the board I wish to do away with
https://imgur.com/YaMP09m

So I figured a couple of LED drivers and I am in business right?

mcgyvr 10/10/2017 10:11 AM

The "power supply" you show is the LED driver..
But yes you can certainly ditch everything but just use the LED array itself provided you use the proper driver (that one is listed as 50-100VDC output at 500-550mA..)
So the Vf of the array is somewhere in that 50-100VDC range.. and your driver needs the same.. Finding one with a DC output rating of 100V and 500mA is what you want..

Note: Those are high voltage drivers and there are greater risks associated with those as they exceed SELV (safety extra low voltage ratings ) meaning that the voltage levels are sufficient to pose a real shock hazard..

Or you can just use the power supplies it comes with and PWM the output for dimming or whatever you are intending to do with them..
again.. caution.. high voltage.. not for the inexperienced (which you are.. no offense)..

thegasman2000 10/10/2017 10:21 AM

No I totally agree I am inexperienced and a friend who is an electrician will be testing and looking over everything when its ready to hook up.

I cracked open the PS and sure enough I could see it was the driver and the power supply.
On the PCB it has a 4x connector and I think its labeled above here
https://imgur.com/a/BqERn

Ground
PWM
+12V
On/Off

Does that make sense? Can I manipulate the PWM here to dim the unit?

mcgyvr 10/10/2017 03:43 PM

There is usually no need to open the LED driver..
I'm quite positive it has the following easy to identify wires (well easy if you haven't unhooked everything yet ;) )

AC input power (2 wires usually) many have a 3rd green ground (I see England but you still have 3 prong plugs composed of hot/neutral/ground)
DC output power( 2 wires that go to the LED board - probably red and black in color)
PWM input (1 or 2 wires that you apply a PWM signal too to dim)

So now its just a matter of figuring out if the driver needs a 5V PWM or 10V or something else..
You should be able to measure the output of the "board you wish to do away with" and see what the PWM peak voltage needs to be

thegasman2000 10/11/2017 09:05 AM

So while looking at the driver I had determined that
https://imgur.com/fptoxlx
Is the 240V input

https://imgur.com/O7oOfln
Is the LED output

https://imgur.com/CBpxUNM
This is the Fan Connection

https://imgur.com/yJ3QTJp
And this is the connector I need to manipulate.

The labelling on the PCB isnt too clear but I think the writing above shows that the pins are

Ground
PWM
+12V
On/Off

Top to bottom.
https://imgur.com/N7sab43

So I guess I plug the PWM from the arduino into the second pin and test the V values needed to dim and turn on and off the unit?

mcgyvr 10/11/2017 10:35 AM

you attach a GND wire from arduino to GND (pin 1 from top) and then PWM pin from arduino to PIN2 (from top)

Knighthawk 10/11/2017 12:34 PM

Have done this to a SB reef light to control with an apex. Similar setup to what you are trying to accomplish. The PWM signal was 0-10V well more like 2 - 10V. You can’t actually turn the lights off. Will have to cut power in order to do that.


Sent from my iPhone using Tapatalk

thegasman2000 10/11/2017 01:04 PM

So I tested it with the tutorial code for fading an led with PWM and it worked a charm. I had to provide 5V to the bottom pin though. I guess this is my on and off then? Just use a digital pin for the 5V and set to high or low?

Edit:

Used this code and it works a charm.


int blueledPin = 9; // Blue LEDs connected to digital pin 9
int bluepinon = 8;
int whiteledPin = 10; // White LEDs connected to digital pin 9
int whitepinon = 7;
int bluelevel = 255;
int whitelevel = 255;
void setup() {
// nothing happens in setup
}

void loop() {
digitalWrite(bluepinon, HIGH);
analogWrite(blueledPin, bluelevel);
digitalWrite(whitepinon, HIGH);
analogWrite(whiteledPin, whitelevel);
}



Now I need to figure out some networking to allow me to change the value of the bue and whitelevel.

Thanks!

mcgyvr 10/11/2017 03:59 PM

Sounds like you got it..
I'd highly suggest using an ESP8266 or ESP32 if you want to get into wifi,etc...
Get one thats a "development board" so it has the USB/serial chips,etc.. on it already and they can be programmed just like an arduino using the same IDE..
It makes wifi stuff simple as its all built into that small little chip vs needing to go with an expensive ethernet shield or a crappy enc28j60 type ethernet board..

Something like this..
http://www.ebay.com/itm/NodeMcu-Lua-...%257Ciid%253A1

jrhupp 10/11/2017 10:31 PM

thegasman2000, you might find this useful: http://www.reefcentral.com/forums/sh...1#post24206611

It shows a hack of the MarsAqua I did. I don't know if your fixtures work the same way (I am inclined to think they are quite similar given the pin out posted above, the dimming may be reversed though). But either way, it gives an example of how to isolate the electronics and shows how to implement a higher resolution PWM (14 bit versus 8 bit) on the Arduino (assuming you choose a board and pin arrangement that supports this). It also includes code to fit the dimming to a bell curve if you are interested.

If your driver does indeed use an actual PWM signal to dim, then you can drop the RC filter on the output of the optoisolator in the circuit I posted in the thread.

thegasman2000 10/12/2017 01:57 AM

Funnily enough mcgyvr I have a nodemcu8266 which I have made into an alexa enabled relay controller. I love them and was wondering about using one but my one hangup is getting it to talk to the main Arduino of my controller.... Seems complicated!

Thanks jrhupp I am definitely looking for a nice bell curve lighting schedule.

I should add that an arduino uno is the base of my controller at the min as the esp doesnt have enough gpio. The uno wont eventually and I will need a mega :)

perkint 10/12/2017 02:11 PM

Quote:

Originally Posted by thegasman2000 (Post 25240920)
Funnily enough mcgyvr I have a nodemcu8266 which I have made into an alexa enabled relay controller. I love them and was wondering about using one but my one hangup is getting it to talk to the main Arduino of my controller.... Seems complicated!

Thanks jrhupp I am definitely looking for a nice bell curve lighting schedule.

I should add that an arduino uno is the base of my controller at the min as the esp doesnt have enough gpio. The uno wont eventually and I will need a mega :)

Stick an MCP23017 on the ESP via I2C and you can have as many IO pins as you like - just needs the two pins from the ESP and you can add multiple MCP23017s :)

Tim

mcgyvr 10/12/2017 05:34 PM

Quote:

Originally Posted by thegasman2000 (Post 25240920)
I will need a mega

I've been using an Ethermega for a bunch of projects at work.. Wired ethernet is just better for my applications..and also I don't pay for it because its kind of pricey..

But yes you can easily add i2c expanders,etc...

but yes the ESP stuff is great/simple..
(and its easy to just use it as a wifi shield too)

mcgyvr 10/12/2017 05:35 PM

Quote:

Originally Posted by thegasman2000 (Post 25240920)
I will need a mega

I've been using an Ethermega for a bunch of projects at work.. Wired ethernet is just better for my applications..and also I don't pay for it because its kind of pricey..

But yes you can easily add i2c expanders,etc... to any micro

yes the ESP stuff is great/simple..
(and its easy to just use it as a wifi shield too)

thegasman2000 10/13/2017 12:36 AM

MCP23017 seems like it would do the trick. I wanted to try and make a pcb anyway :)

I used the Nodemcu and got the interface to: https://imgur.com/M2VCMvW

Its functional but now I need to try and figure out how to set the intensity in the interface. I have a variable in code already. I also need to checkout if the nodemcu has a rtc on it and if I can get a schedule set up. Then complicating it more by making that schedule adjustable in the interface.

edit:

Actually I am connecting it to the internet so I will just get the current time from good old google :)

Another Edit:

I managed to get the time and get it to display in both the serial monitor and on the web interface. I have no idea however how to use the time as a variable for setting a light schedule... Anyone got any advice? I just want a simple if time is after 7am turn on blues, if after 11 am turn on whites. If after 8pm turn off whites and if after 11pm turn of blues. I will fade in and out later! (this is fun :) )

jrhupp 10/13/2017 04:03 AM

Quote:

Originally Posted by thegasman2000 (Post 25241847)
I managed to get the time and get it to display in both the serial monitor and on the web interface. I have no idea however how to use the time as a variable for setting a light schedule... Anyone got any advice? I just want a simple if time is after 7am turn on blues, if after 11 am turn on whites. If after 8pm turn off whites and if after 11pm turn of blues. I will fade in and out later! (this is fun :) )

My preference for stuff like this is to convert to seconds or minutes after midnight and base my logic on that. Much more straight forward (at least to me anyway) then trying to work with human readable timestamps and it makes on/off type logic easy. Its easy for 24 hr time: (hour x 60) + minutes gets you minutes after midnight.

perkint 10/13/2017 12:00 PM

Personally I prefer to keep the time in hours and minutes where possible as it is more readable and saves messing if you are displaying it. But, to be fair, I have also used minutes since midnight, too.

Are you willing to share your code? Not necessary but would make it easier to give advice that fits in with how you have things.

Are you storing all the settings in the program? For example in an array? If so, you can simply loop thru the array from the highest value to the lowest, checking for the first you find that is lower or equal to the current time. That way you need the PWM levels associated with the time you've just matched are the ones you want :)

Tim

thegasman2000 10/13/2017 12:37 PM

Tim I will share my code no problem its just in separate bits all over at the min. I decided to use the NodeMcu... then blew it up putting 12v through a gpio pin (dont ask) I have another on order. I have an uno to work with too and am now working on the ATO / Relay code as it doesnt need a clock and I dont have a RTC here.

perkint 10/14/2017 10:06 AM

Oops! :lmao:

I've just picked up an ESP8266 for a play whilst I'm carefully watching the updates on the ESP32 Arduino integration threads (very active development on the outstanding issues, but a hell of a lot of functionality already implemented). Got lots of Arduino nanos which is what I tend to use, but I also have a handful of the ESP32s so want to start doing some stuff with control interface via Bluetooth/web, but absolutely no experience on that - yet!

Tim

lingwendil 10/14/2017 11:55 PM

Have a look at what I just stumbled across-

https://github.com/CelliesProjects/aquacontrol2

While on the esp8266 subject...

perkint 10/15/2017 04:38 AM

Looks like a nice controller. Interface looks like the sort of thing I'd design! Not one that would please web designers, but one that is simple and works! But, that is just from a quick look at the page - not looked at the code...

Tim

thegasman2000 10/15/2017 05:38 AM

Yeah after some (LOTS) CSS this could be a nice setup! I will dig through it and see if it a good base for what I want. Thanks for the link!

My plan is to use a esp8266 or the nicer esp32 to make the base controller. Perhaps with a slave esp on the lights and the main connected to a power bar. The esp32 would be better for this as it has bluetooth built in.

I wondered if you could emulate an apex and use their apps and web stuff...

snowlynx 10/15/2017 10:16 AM

Quote:

Originally Posted by thegasman2000 (Post 25243699)
Yeah after some (LOTS) CSS this could be a nice setup! I will dig through it and see if it a good base for what I want. Thanks for the link!

My plan is to use a esp8266 or the nicer esp32 to make the base controller. Perhaps with a slave esp on the lights and the main connected to a power bar. The esp32 would be better for this as it has bluetooth built in.

I wondered if you could emulate an apex and use their apps and web stuff...

Great work. If you don't mind sharing code, wiring, pics, that would be awesome.

Can you setup counter delays for the 24 hour cycle?

Or loop and constantly check time, if it hit your preset time, set
light level accordingly?

I have the ebay wifi unit and it sucks. I don't care for wifi, just ability to
program 24hrs. These wifi units go nuts and the lights behave on their own,
lights up, goes dark...

lingwendil 10/17/2017 12:10 AM

Quote:

Originally Posted by thegasman2000 (Post 25243699)
Yeah after some (LOTS) CSS this could be a nice setup! I will dig through it and see if it a good base for what I want. Thanks for the link!

My plan is to use a esp8266 or the nicer esp32 to make the base controller. Perhaps with a slave esp on the lights and the main connected to a power bar. The esp32 would be better for this as it has bluetooth built in.

I wondered if you could emulate an apex and use their apps and web stuff...

Looks pretty good to me for sure, but I'm braindead with code so I can't comment on how well put together it is :lol2:

I'm trying to learn as much as I can to put together a controller that will work for my pretty basic needs, although it's more complicated to implement them as I need them apparently.

If I knew what to do all at once, I would like the following features-

Cheap base hardware, I'm basing most of my efforts at the ~$5 Wemos Mini D1 type boards. Wifi onboard, and better processing power than the average Arduino specific boards in the same price range, while being compatible with the Arduino IDE. It also has native 10 bit PWM, which is nice if you only need 2-8 channels or so, which is realistically useful for the vast majority of applications.

Onboard Wifi to set and keep time. This would be a nice way to go, and I would preferably allow for a backup RTC. Simply turn on the controller, select the automatically generated access point it creates, log in to set your Wifi credentials, and go. Ideally it would then spool up an NTP request to set and sync the time, and would re-check every so often. It would be nice to replace the RTC with a bit of code!

2-8 channels of control, with 6 or more time slots. Ideally you would set these by logging into the unit via any internet browser, and set time slots and intensity via web form. It would be really nice to make this independent of apps and OS, so a simple interface such as those seen in old netgear routers would be awesome. Of course a pretty app can be figured out that will work too, but not really my priority.

Fan control seems a given, but having it track via temperature would be a nice feature, and is easy enough to do with a DS18B20 sensor. Alternatively, simply having the fan on/off at set times would work fine too.


All these features are implemented to some degree in many places and projects, it's just too much for me to figure out how to stitch them all together coherently enough to work in something. I'm a hardware guy, not a software guy! :worried2:

perkint 10/17/2017 02:33 PM

That is pretty much what my controller will do, when I get round to porting it onto the ESP32 or ESP8266. Probably more likely to go with the ESP32 for essentially the same reasons you suggest - still about the same price and more powerful! And Bluetooth built in!

Not sure how accurate the built in time keeping is in the ESPs tho - the Arduinos are pretty inaccurate without an RTC, so would be tempted to include an RTC, but automatically set it from an NTP server when the 'net is available.

Tim


All times are GMT -6. The time now is 12:25 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
User Alert System provided by Advanced User Tagging v3.3.0 (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.