control external relay with PWM expansion.

Do you have a question on how to do something.
Ask in here.
Post Reply
sesame
Posts: 71
Joined: Sun Aug 04, 2013 2:29 am

control external relay with PWM expansion.

Post 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));
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: control external relay with PWM expansion.

Post 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 :)
Roberto.
sesame
Posts: 71
Joined: Sun Aug 04, 2013 2:29 am

Re: control external relay with PWM expansion.

Post by sesame »

thanks Robert
Post Reply