mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

mLink serial I2C modules
andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

Post by andrew » Fri Nov 22, 2024 3:50 pm

Thanks Andrew, remember the sub 1 second is not for an actual switching of the relay it's a fail safe so that if a poll update to keep the relay activated it will deactivate as a fail safe as per my above convocations with you. (Sorry, I'm just thinking of walk-arounds without changing the base system)

Yep, I reviewed our previous messages, and I believe I understand what you need. While I can't promise I can implement these features without looking at the code, here’s the functionality I have in mind for the timer mode:
  • Relay Triggering: Activating the relay (via a pin or software) will energize it, and it will automatically de-energize after the set "on time" elapses.
  • Re-triggering: If the relay is re-triggered (via pin or software) while the timer is active, the timer will restart. For example, with a 1-second "on time," re-triggering every 0.5 seconds will keep the relay energized indefinitely. If re-triggering stops, the relay will stay energized for 1 second before de-energizing.
  • Cancelling the timer: If the relay is turned off via software while active, the timer will cancel, and the relay will de-energize immediately.
  • Timer Resolution: An additional register will allow the timer resolution to be set to either 1-second increments (default) or 100ms increments. This provides a timer range of 1–65,535 seconds or 0.1–6,553.5 seconds, respectively.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

lewsut
Posts: 13
Joined: Tue Jan 09, 2024 9:08 pm

Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

Post by lewsut » Wed Nov 27, 2024 10:48 am

That would be perfect, thanks for the distillation!

In the meantime I have stacked two relay sets on top of eachother and have the non timed output relay set powered by a timed relay on the other set (that I kept active by a timed pulse), this gives me the fast switching and failsafe that I require.

I'll keep an eye on your products (I like them thus far!) and thanks for taking the time to reply.

andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

Post by andrew » Thu Nov 28, 2024 5:04 pm

That would be perfect, thanks for the distillation!
Pun intended? :-)

So.....

I’ve had time to review the firmware and have now added the features discussed. Since the existing registers couldn't support the changes, I’ve introduced 6 new registers:

Register 19 (Relay On):
- Writing a value between 0 and 3 to this register turns on the corresponding relay.
- If the relay’s timer is already running, writing to this register will restart the timer.

Register 20 (Relay Off):
- Writing a value between 0 and 3 to this register turns off the corresponding relay.
- If the relay’s timer is running, writing to this register will cancel the timer and immediately turn off the relay.

Register 21 (Relay 0 Timer Resolution):
- Writing 0 sets the timer resolution for Relay 0 to 1 second (default).
- Writing 1 sets the resolution to 100ms.

Register 22 (Relay 1 Timer Resolution):
- Writing 0 sets the timer resolution for Relay 1 to 1 second (default).
- Writing 1 sets the resolution to 100ms.

Register 23 (Relay 2 Timer Resolution):
- Writing 0 sets the timer resolution for Relay 2 to 1 second (default).
- Writing 1 sets the resolution to 100ms.

Register 24 (Relay 3 Timer Resolution):
- Writing 0 sets the timer resolution for Relay 3 to 1 second (default).
- Writing 1 sets the resolution to 100ms.


Any mLink relay modules purchased after today will include this version of firmware (v1.01).

---

The upcoming version of the mLink library (v2.2.0) will include macros to use these features:

mLink.RLY_ON(add, index) //Turns the specified relay ON.

mLink.RLY_OFF(add, index) //Turns the specified relay OFF.

mLink.RLY0_TIMER_RES(add, res) //Sets the timer resolution for Relay 0.

mLink.RLY1_TIMER_RES(add, res) //Sets the timer resolution for Relay 1.

mLink.RLY2_TIMER_RES(add, res) // Sets the timer resolution for Relay 2.

mLink.RLY3_TIMER_RES(add, res) // Sets the timer resolution for Relay 3.


- Parameters:
- add: I2C address of the module.
- index: Relay index (0 to 3).
- res: Timer resolution (0 = 1 second (default), 1 = 100ms).

---

I need to add a new servo controller to the library before I upload the updated version (V2.2.0) so I’m unsure when it will be available for download. However, I’m aiming for sometime next week or failing that, the following week.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

lewsut
Posts: 13
Joined: Tue Jan 09, 2024 9:08 pm

Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

Post by lewsut » Mon Dec 02, 2024 10:15 am

Pun intended?
No.... to the point I'm completely missing it!?

Excellent, I'll get a couple more boards purchased ASAP, thanks for your help :D

andrew
Site Admin
Posts: 1427
Joined: Sun Aug 05, 2012 4:15 pm

Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

Post by andrew » Tue Dec 03, 2024 9:25 am

No.... to the point I'm completely missing it!?
Ah, my mistake! I know your application involves controlling valves and water, but I thought it might also be related to a distillation process.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

lewsut
Posts: 13
Joined: Tue Jan 09, 2024 9:08 pm

Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules

Post by lewsut » Tue Dec 03, 2024 4:37 pm

Brewery. So you were close enough!

Post Reply

Return to “mLink”