2 RAs in tandem + H2O Automation

Talk about you and your tank/equipment
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Yes, I'm positive I moved the jumpers to the low trigger side.

Right now the relay does nothing... just sits there with the lights on. No clicking anymore.. even tried with everything else removed and just plain power. Same with switching back to the high level trigger.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

Yeah, let's see if your getting a full 5V out of the dimming port.
Maybe even try a 5V walwart to make sure the relays will trigger at 5v.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Yeah, that will be the approach moving forward as well. I need to adjust the test code I'm using on the RA so I can measure it easily enough. My main concern was that I was sharing the negative with the 24V PS and was afraid somehow 24V was going back into the RA. But if I don't connect it to that negative, then where else? Unless I don't need it for the trigger... I wish I knew more electronics...
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

I can't see the picture :(
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

I was able to see the picture from the link it was sent to my email though:
http://img.tapatalk.com/d/14/03/10/bu4ybe7u.jpg
Anyhow, what's DC+?
I think you fried the optical isolator in the relay board if it has one. You can't use the +24 in the right side. The +24 is only supposed to be connected to the left side and should not be connected to RA. That's what I think in my mind, but I would need to see how that relay board works. Do you have schematics?
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Yes, that's correct. I don't have schematics, I only have the description from the ebay link which I sent you a while back.

The IN on the relay is either a "High Level" or "Low Level" trigger input. You can see in the video it working fine when set to High and connecting a 24V lead to the relay. But when I switched it to low and connected the dimming wires, nothing was behaving as expected. I was trying to measure things with the multimeter I think when it got fried.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

lnevo wrote: I was trying to measure things with the multimeter I think when it got fried.
Very possible. That's very easy to do if you're no careful with the probes.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

Ahhh, I just revisited the ebay link and I think your connections are good :)
You need to set the trigger to high.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

Why does he need to set the trigger to high it he is using 5v from the RA dimming module to trigger it?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

rimai wrote:Ahhh, I just revisited the ebay link and I think your connections are good :)
You need to set the trigger to high.
That's one thing the description isn't very clear on as far as which voltage to use for the High/Low triggers...

So to repeat what Sacohen said.. why high?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

The trigger is whether you want the relay to activate when RA sends high (5V) signal or low (0V) signal.
If you set to low, the relay will activate when RA sends 0% or when RA is offline. That's the best scenario when you want something to be on when RA looses power.
If you set to high, the relay will activate when RA sends 100% (assuming you set the jumpers to 5V analog) and will not activate when RA looses power. So, the relay can only be activated when RA is operational and sending 100% signal.
That's what I picked up of what the trigger is.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

But if it is a 24V relay will a 5v signal from the RA even trigger it?

The E-Bay description is very unclear what the high and low triggers do?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

That's interesting and actually may match up to what I saw when initially testing....

I had the Low trigger option configured and initially when I wired everything up the relays were ON not OFF. Thats why I started screwing around with the wiring, etc. So I probably had good behavior and messed it up trying to unconfirm that behavior.

The Low option is almost what I'm looking to do with the signal from upstairs though so that's cool to know that other applications have similar requirement :)
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Sacohen wrote:But if it is a 24V relay will a 5v signal from the RA even trigger it?

The E-Bay description is very unclear what the high and low triggers do?
The relays are made to work with Arduino.. here's the ebay link http://bit.ly/1pFisuu

I have a feeling that the voltage on that signal doesn't really matter except that it's good. The test code on the controller was slow so I may not have waited it out long enough thinking something was wrong with my wiring to see the ports come on / off.

I also wasn't sure I had the pinout properly on the RA so I was debugging that at the same time... at least I got an extra set of relays this time. I'll go one at a time and make sure I don't fry them all in one shot...
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

The signal IN is not directly connected to the relay coil. It goes through an opto-isolator, which in turn controls a transistor, which in turn activates the coil, which is 24VDC.
The purpose of the opto-isolator is to isolate the RA port from being damaged by anything that is going on with the relay coil stuff, which is running at 24VDC.
The opto-isolator does not have enough power to activate the coil in the relay, so a transistor is need that can handle the 24V and 5mA current.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

Thanks for clarifying that. I had never heard of an Optocoupler before and wasn't sure what they did.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

Check the beginning of the thread for the schematics of an optocoupler:
http://forum.reefangel.com/viewtopic.php?p=36132#p36132
It works basically the same as your tv remote control. On one side you have a infrared led (your remote control) and on the other side, you have a photo-sensitive transistor (your tv).
When the led is turned on by the RA signal, it emits light that the transistor picks up so you have this layer of protection where one side is isolated from the other side by a small gap of air.
This small gap of air protects one side from another since they don't have any physical contact and the signal is transmitted by means of light through this led-transistor combo.
Roberto.
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

Very cool. You learn something new everyday. :)

Sent from my HTC One VX using Tapatalk
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

So I guess on the issue of high or low trigger, I couldn't find much documented.. I did find the specifications for one relay that said the low trigger was anything less than 7V and high was >7V.

I also found this link http://www1.electusdistribution.com.au/ ... tocoup.pdf

[quote]For example just like a discrete LED, you can drive an
optocoupler’s input LED from a transistor or logic
gate/buffer. All that’s needed is a series resistor to set the
current level when the LED is turned on. And regardless of
whether you use a transistor or logic buffer to drive the
LED, you still have the option of driving it in ‘pull down’ or
‘pull up’ mode — see Fig.2. This means you can arrange for
the LED, and hence the optocoupler, to be either ‘on’ or
‘off ’ for a logic high (or low) in the driving circuitry./quote]

And based on the behavior I saw (both relays going to ON when set to Low trigger) I'm pretty inclined to think that it was all working as expected and I screwed up it up trying to troubleshoot a working situation. Only one way to know once the new relays come in. I can't seem to find anyone in the US that sells these.. I found a few more links on Amazon, etc. but they all have crazy stupid shipping times. If anyone knows where I can source something like this locally, please lmk. In the meantime, I'm glad I have some confirmation that I was going in the right direction.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Got the replacement relays last night. Probably won't have time to connect and test them for a little while. Also received a delivery from Roberto. My dimming module.. so I can hack my D-120s and a salinity module so i can automate salt mixing :) I need to start working on the code for all of this soon...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Hooked up the relays tonight. Connected to the RA. Left it on high trigger. Working perfectly. PWM controller for the pump is hooked up as well. All electronics components are now in place. Oh, minus one more float switch. Plumbing, mounting, cabling still to come..
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

Good going.

Sent from my HTC One VX using Tapatalk
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Ok I spoke to soon.. I went to hook it up again to the RA to take a video and nothing was working. I measured the output now from the PWM and I'm getting 0. Not sure what happened... :(

Relays are working fine however...
User avatar
Sacohen
Posts: 1833
Joined: Sun Apr 21, 2013 6:25 am
Location: Davie, FL

Re: 2 RAs in tandem + H2O Automation

Post by Sacohen »

That sucks.

Sent from my HTC One VX using Tapatalk
howaboutme
Posts: 245
Joined: Tue Jan 28, 2014 11:10 am
Location: Northern VA

Re: 2 RAs in tandem + H2O Automation

Post by howaboutme »

lnevo wrote:Got the replacement relays last night. Probably won't have time to connect and test them for a little while. Also received a delivery from Roberto. My dimming module.. so I can hack my D-120s and a salinity module so i can automate salt mixing :) I need to start working on the code for all of this soon...
Hey Lee...When you do the D120 hack, can you document w/ a lot of photos? The official thread is short on photos detailing each individual steps making it hard for non-electronics people to follow along. I can only read so much short this, short that jargon. :D
Jack
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Will do...not rushing into that...especially after this right now...
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Can the salinity module be plugged in to the relay box or does it need to be isolated?
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: 2 RAs in tandem + H2O Automation

Post by rimai »

Yes it can
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

Ok temp probe received today. Will be mixing up some salt with my RA soon :)

I have my float switches ready to go. I need to setup the pump for the RO and install the float switches. Oh and need to setup the wifi so I can monitor the change in salinity.

Once I can monitor the salinity over time I'll be able to see how quickly the salinity changes when i add salt manually and when i add water manually. This way I can figure out what the routine will look like.

I'll use 1/2 the usual salt I use to mix up 1/2 my container of SW to 35ppt. Then I'll add 1/2 of the salt remaining and monitor the salinity. I'll then add RO in increments and watch the change in salinity until I'm back to 35ppt. That should get my barrel to 3/4 full. If the high level float switch gets triggered before we get to 35ppt, i will obviously stop adding RO and send an alert. At that point, I would just need to drain some water out so it can finish up or figure out what went wrong...

I'll fine-tune the fill amounts and timing based on how quickly the salinity reacts. Add a specified amount of real mixing time and signal the AWC to resume. Then the routine will just be to add a few cups of salt every week.

BTW, this process will only happen if I trigger WC mode :) This way the salinity isn't being constantly adjusted all week long.

Sorry if I've described the process multiple times already, but talking it out in my head is helping the overall thought process.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: 2 RAs in tandem + H2O Automation

Post by lnevo »

So I think I finally finished the first set of code and getting ready to load it up this weekend. In order to do what I want I've created a TimedPort class.

This is a wrapper for a relay port. You can do all the things you can do with a normal relay, but you can do a few extra things to it. You can set it up like a dosing pump by setting the Time, Offset, Repeat and then use the Run() function. What this adds over a normal DosingPumpRepeat function is built in state tracking, Pause() Resume() Start() Stop()

It has an Osc function that is similar to the APEX OSC call so if you just want a port that is on for 20 minutes and off for an hour and 40 you can do that too.

For me what I wanted was the ability to have the running schedule but be able to trigger a run or a stop when I want. I didn't want to have to do the timer in my loop or separate function every time. For instance, every time I come home and turn my fuge light on to take a look at my tank, i end up leaving the override on and then realize the next day my fuge light has been on for 24 hours...so now I can change my fuge light on to a Start(3600) and the override will be timed for one hour. Another example is my skimmer. I dose reefbooster and it needs the skimmer off for like 12 hours...i mask it off, but then I gotta remember to turn it back on. With this i can issue a call to Stop(12*SECS_PER_HOUR); and the Skimmer will now be off for that much time.

Anyway, it may sound complex but its quite easy, once I can post it, I'll write up some documentation. I haven't even tested the compile yet :)

I will also be adding a Scale function so you can specify the times in seconds, minutes, hours, or days.

The next class will be the dosing pump one. This will add calibration values, logging, and maybe millisecond scaling...have to do some more research on that one before I commit to that.

Anyway, when I'm ready to post it, I'll put up a few more use cases. If you want to help test or develop this, let me know and I'll be happy to give you an early version :)
Post Reply