Jump to content

AlanM

President Emeritus
  • Posts

    7,152
  • Joined

  • Last visited

Everything posted by AlanM

  1. For another quick idea. Here's the arduino sketch I'm using to turn four 0-10V analog outputs from my Apex controller into four 5V PWM outputs for the LDD drivers. It's really simple. You don't even really need the Apex to do the dimming if you put the clock on I mentioned above. You can query the clock for the time in your main loop and do things based upon time. You also have a bunch of analog and digital input pins you can query to do things like ATO and stuff like that with a bit of work and some relays. int inPins[] = {A0, A1, A2, A3}; int outPins[] = {10,9,6,5}; const int numReadings = 60; // how many previous values do we want to average? int readings[4][numReadings]; // the readings from the analog input int totals[] = {0,0,0,0}; int newAverage = 0; void setup() { // initialize serial communications at 9600 bps: Serial.begin(9600); } void loop() { for (int c = 0; c < 4; c++) { // loop through all 4 channels for (int count = 0; count < numReadings; count++) { // average over numReadings to avoid jitter totals[c] -= readings[c][count]; // subtract old reading from the total readings[c][count]=analogRead(inPins[c]); // read new reading from analog pin totals[c] += readings[c][count]; // add new reading to total newAverage = totals[c]/numReadings; // take the average analogWrite(outPins[c],map(newAverage,0,1023,0,255)); // send it out the PWM pin } } delay(1000); // loop through once per second }
  2. Sort of depends how much you already know. You would buy: Arduino uno board A real time clock if you want to do sunrise timing and you dont already have a controller (like this one https://www.adafruit.com/products/255 ) 48V power supply with wattage rating you want depending on your leds Some Meanwell LDD drivers A 7-12v power supply for the Uno (wall wart) Lots of wires, 22gauge Some LEDs, 15 per driver usually A heatsink Wire it all up, making sure the negative DC wires are all tied together Write your Arduino sketch which lots of websites can help with. If you want half power on a driver, as an example, it is as simple as doing "analogWrite(outPin,127)" because 255 is full power. You dont even need a PWM shield. The uno comes with 6 channels of pwm out.
  3. There's a guy on the clownfish forum at RC who has about a bajillion nems and clowns in one large tank. The clowns were all siblings at some point. He keeps all of the nems on one side and not moving around by directing a lot of flow straight down the glass and kind of making a hi-flow barrier across the tank which the nems don't like to cross. Any nems that let go and go for a swim to find a new spot he trades away. 8)
  4. Just to followup on the topic of the aquarium controller interfaces from stevesleds converting 10V into PWM. Here are the scope outputs. It seems to work well. I tried to take a pic of both the apex interface and the scope display. First pic, lights at 0. Second pic, lights at 10. Note that the LightsAt10 switch is on. Looks like about a 10% duty cycle at 500Hz Third pic, lights at 25.
  5. You guys have bad luck with jaw fish.
  6. Yep. I'm online as "Alan M" now. Will make getting help for my program attempts much easier to be able to just let people see my program.
  7. I requested an account there today. I am learning a lot just looking at outlets and profiles on there.
  8. Wow, on that site you can even see the programs that people have on their Apex. Will be great as I'm figuring out what to do.
  9. Tagging along with this, if someone knows a public site I would be interested in seeing one too. Seems like you'd have to give them your admin password to your Apex, though, so they could scrape the page because I don't see a way to add a display only user account.
  10. So I am dumb. I took another look at the Comprehensive Reference Manual v3 and there are two chapters, 5 and 6, which contain all of the statements I was wondering about. I should be set to do some unnecessarily complicated stuff now. 8) Thanks Scott and Shoelace and DaveS for helping me figure it out.
  11. Now to get a scope to look at the PWM output...
  12. I still think they need a big list of stuff that can go in the Advanced field when configuring outlets. I'd like to see a list of Built-In Variables (so far I see Temp, Time, what else? The comprehensive manual lists a bunch, but doesn't actually include the variable name, just the description) Conditionals (If-Then, maybe While?) Operators (=, <, >, etc.) Commands (Set, Fallback, etc.)
  13. I changed LED_0.10 to have a ramp time of 60 and start and end intensity both at 10. Did the same for the 25% one. So I just went home for lunch and tested it. I switched the Virtual Outlet LightsAt10 to On and RoyalBlue and NeutralWhite to Auto, and measured the outputs on those channels with a voltmeter. I got 1.02V on them, and the RoyalBlue and NeutralWhite variable outlets turned orange in the GUI. Then I turned the 10% one of and LightsAt25 on and got 2.5V, so I guess that works. I set the LED_0.10 ramp time to 0 and tested again, and that also worked. So 0 ramp time must mean forever. Wonder if it means forever at the start or forever at the end. My guess would be end. So I think I'm sorting it out. Helps just to type it back and forth.
  14. The apex interface says that the ramp time is in minutes, not seconds. Is 0 a valid entry in that field to have them come on immediately? I will put start intensity to be the same as end intensity and put the ramp time to 1 so that there are nonzero values in those fields, and it should do the same thing I would guess? Will it then stay at the end intensity after the ramp is over or should I put some big number in there to get it to stay at 1v output essentially forever? In theory my LDD drivers dim from 0 all the way up. They arent supposed to cut out at a low value, but that is one thing I am trying to test by doing 10%.
  15. The DC8 isnt a real thing. It is just a fake module created in order to get some outlets that can be queried for state. Or at least that is my guess at how it works. I did it because of this post: http://forum.neptunesystems.com/showthread.php?57-Virtual-Outlets
  16. Playing with it now, and here's what I did so far: - Added a DC8 module to give me some virtual outlets to play with - Renamed the first of those outlets (which Apex calls Cntl_A1) to LightsAt10 - Renamed the second of those outlets (which Apex calls Cntl_A2) to LightsAt25 - Put the following into the program for the LightsAt10 and LightsAt25 outlets: Fallback OFF Set OFF - Renamed profile PF1 to LED_0.10 and put the following in it: Control Type: Ramp Ramp Time: 0 Start Intensity: 0 End Intensity: 10 - Renamed profile PF2 to LED_0.25 and put the following into it: Control Type: Ramp Ramp Time: 0 Start Intensity: 0 End Intensity: 25 - In my RoyalBlue variable outlet (which Apex calls base_Var3) I put the following program: Set OFF If Outlet LightsAt10 = ON Then LED_0.10 If Outlet LightsAt25 = ON Then LED_0.25 - In my NeutralWhite variable outlet (which Apex calls base_Var4) I put the same program: Set OFF If Outlet LightsAt10 = ON Then LED_0.10 If Outlet LightsAt25 = ON Then LED_0.25 and similar for the other 4 variable outlets Am I on the right track here? Seems like this should give me switches I can just turn on to get to fixed intensities across all channels if I put that into each variable outlet.
  17. OK. So you'd say something like the following in your Variable outlet Advanced program? Set Off If On then 25percent
  18. No hijack. That was exactly my followup question.
  19. DaveS, So you have to use profiles to control intensities, right? You can't have an "If Time then 25%" in the outlet config? Seems like if that's the case, then I'll want a profile with an immediate ramp up to 25% intensity and have an virtual outlet configured that says something like "If you're on, then tell RoyalBlue to use the profiles that ramps immediately to 25%" Can I set the ramp time to 0 minutes, the start intensity to 0 and the end intensity to 25? Are fractional minutes acceptable?
  20. Thanks. I renamed base_Var3 as RoyalBlue and base_Var4 as NeutralWhite. I have the outlets set to Advanced, and they currently have the following in their text field: Fallback OFF Set OFF If Time 08:00 to 20:00 Then ON If Temp > 82.0 Then OFF Min Time 030:00 Then OFF What would I need to do in order to get a button that would let me turn the two of them on at 10% and at 25% (1V and 2.5V) for continuity testing? I kind of get what they're doing in the default program I posted above.
  21. OK. So I'm spamming my own thread, but even the community developed "Comprehensive" reference manual on page 40 gives a list of variables you can test for, but doesn't actually give the variable names, just the descriptions. Neptune Systems seriously needs someone to run javadoc or something to generate some API documentation.
  22. Scott! I recognize your username now. I remember you posting a while ago offering help with Apex programming, but couldn't remember it when I was asking the question. I plan to read the Apex forums and dig for examples there. It kind of seems like once I get my head around what outlets, virtual outlets, and profiles are I should be good to just make them up. The reference material I've found so far is way short of being a real API on how to use these things. Is there a comprehensive command and variable name reference somewhere? Seems like the docs they have are ok, they just need a good programming reference instead of sticking an example or two into the manuals for their modules.
  23. Just programming, I think. I have the 0-10V output ports going to some Steves LEDs Aquarium Controller interfaces translating 0-10V into 0-100% duty cycle PWM and using that to drive some Meanwell LDD PWM input pins. I've wired the LED strings to the LDD outputs and am ready to plug the beast in, but want to make sure I can control intensities from my computer first. I might even hook up a scope to see if I'm getting the PWM output that I expect before risking my LEDs.
×
×
  • Create New...