Page 1 of 1

control external relay with PWM expansion.

Posted: Thu Oct 23, 2014 8:10 pm
by sesame
I just DIY another automatic zeovit reactor with Pump. as zeo system request, pump should be running as 3hours on/off schedule. unfortunately i dont have spare relay port.
since i got a PWM expansion with 4 ports free. is it possible to trigger a external relay by dimming expansion port.
i'd rather to use dosing pump library. It will be much easier to adjust interval timing.

i suppose code should be like this.

Code: Select all

ReefAngel.DosingPumpRepeat1(ReefAngel.PWM.SetChannel(2,100))
or

Code: Select all

ReefAngel.DosingPumpRepeat1(Pinmode(PWMports[2],output));

Re: control external relay with PWM expansion.

Posted: Fri Oct 24, 2014 7:51 am
by rimai
It won't work that way.
You can certainly use the dimming module to trigger a relay.
Be careful not to oversize the relay.
The max current per channel is 40mA. So, look for a relay that has a coil that will draw less than that.
You can use something like this though:

Code: Select all

ReefAngel.DosingPumpRepeat1(Box1_Port1);
ReefAngel.PWM.SetChannel(2,ReefAngel.Relay.Status(Box1_Port1)*100);
This code basically uses relay expansion box as virtual relay, even if you don't have it.
So, it will trigger the port 1 just using the dosing pump function and you can change the settings with phone app or portal.
Then, your dimming channel will follow the status of that port :)

Re: control external relay with PWM expansion.

Posted: Tue Oct 28, 2014 6:58 am
by sesame
thanks Robert