mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules
Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules
Great work and thank you for taking the time to support these products. I've now added the link for your github page to the first post of this thread and the RGBW thread.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.
-
- Posts: 32
- Joined: Thu Dec 31, 2020 1:22 pm
Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules
Hi Andrew
I'm glad I read through this thread and found these new features in the library. For me this is a much more convenient way of turning the relays on and off.
Depending on how I chose to code things the less than one second timer may also be useful. I am using them to control model railway points. These require a short pulse of power to throw them. 100ms should do nicely.
Have you considered adding these features to the Reference Guide for these modules. Or adding an Example sketch to the library?
Cheers
Chris
I'm glad I read through this thread and found these new features in the library. For me this is a much more convenient way of turning the relays on and off.
Depending on how I chose to code things the less than one second timer may also be useful. I am using them to control model railway points. These require a short pulse of power to throw them. 100ms should do nicely.
Have you considered adding these features to the Reference Guide for these modules. Or adding an Example sketch to the library?
Cheers
Chris
andrew wrote: ↑Thu Nov 28, 2024 5:04 pmPun intended?That would be perfect, thanks for the distillation!
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.
Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules
Hi Chris, yep, it’s on the list but thanks for reminding me. Just got a new sensor module to get out of the way first. The currently uploaded library does support these new features though so the new commands as quoted in your post will work.Have you considered adding these features to the Reference Guide for these modules? Or adding an Example sketch to the library?
I must say that at the time of creating the original module it did not occur to me that a sub 1 second timer would be useful but I’m clearly wrong! Anyway thanks for the feedback on this.Depending on how I chose to code things the less than one second timer may also be useful. I am using them to control model railway points. These require a short pulse of power to throw them. 100ms should do nicely.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.
Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules
I'm glad this stuff is useful to others and it's not just my weird requirements
My testing has gone well and everything works as expected! Thanks.

My testing has gone well and everything works as expected! Thanks.
-
- Posts: 32
- Joined: Thu Dec 31, 2020 1:22 pm
Re: mLink 1ch (HCMODU00182), 2ch (HCMODU0183), And 4ch (HCMODU0184) I2C / Parallel Relay Modules
Somewhat frustrated that I purchased one of my relay models in mid November, just prior to this firmware update. I've found it much easier to code with the new features.