mLink I2C Environmental Sensor Module – Temperature, Humidity, Pressure, & Light Sensor (HCMODU0265)

mLink serial I2C modules
Post Reply
admin
Site Admin
Posts: 885
Joined: Sun Aug 05, 2012 4:02 pm

mLink I2C Environmental Sensor Module – Temperature, Humidity, Pressure, & Light Sensor (HCMODU0265)

Post by admin » Thu Jun 26, 2025 10:52 am

Image



Image

The mLink Environmental Sensor Module combines multiple precision sensors to monitor temperature, humidity, atmospheric pressure, ambient light, and white light levels. Designed for easy integration with microcontrollers via mLink I²C interface, this module provides accurate and reliable environmental data for weather stations, automation systems, indoor climate monitoring, and more.


Image


mLink I²C Interface
  • Microcontroller Compatibility: Works with any microcontroller or development board with a standard I²C interface
  • Expandable System: Seamlessly daisy-chain with other mLink modules (e.g., displays, relays, input devices) using a single I²C connection
  • Unified Library: A single Arduino library or Raspberry Pi module with a tiny memory footprint enables control of all connected mLink modules.

Arduino & Raspberry Pi Support
  • Arduino: An Arduino library is available via GitHub, PlatformIO, or directly from out support forum.
  • Raspberry Pi: A Raspberry Pi Compatible Python module is available via PyPi for easy installation.s
  • Resources Provided: Code example(s) and documentation are available to help you get started quickly

Use Cases
  • Smart weather stations
  • Environmental monitoring
  • Greenhouse automation
  • Indoor lighting control based on ambient conditions
  • Climate-aware IoT systems


Module Specifications:
Product code:				HCMODU0265
Supply Voltage:				5V via mLink header (3.3V via solder pad)
Supply current:				~700uA (idle), ~170uA (sleep)
Temp sensor range:			-40 to 85oC
Temp sensor resolution:		0.01oC
Hum sensor range:			0 to 100%RH
Hum sensor resolution:		0.024%RH
Pressure sensor range:		300 to 1100hPa / mBar
Pressure sensor resolution:	0.01hPa / mBar
Light sensor range:			0 to 35232lx
Light sensor resolution:		0.54lx
I²C Interface speed:			400kbits/s (fast mode)
I²C default address (HEX):		0x61
Maximum number of modules:	5 with pullups fitted, 112 with pullups removed*
Module dimensions: 			27mm x 21mm x 11.5mm (excluding headers)

*Note: Do not exceed 5 mLink modules in series with pullups fitted to all modules. For chaining more modules, see the mLink pullup configuration guide.




Image


Image


Image


  1. /* FILE:    mLink_Env_Sensor_Example.ino
  2.    DATE:    23/06/25
  3.    VERSION: 1.0
  4.    AUTHOR:  Andrew Davies
  5.    
  6.  
  7. This sketch uses the mLink library to repeatedly read the
  8. sensors of the mLink environmental sensor module and output
  9. the result to the serial monitor.
  10.  
  11. Please see Licence.txt in the library folder for terms of use.
  12. */
  13.  
  14.  
  15. #include "mLink.h"                          // Include the library
  16.  
  17. mLink mLink;                                // Create an instance of the library
  18.  
  19. #define I2C_ADD 0x61                        // Default I2C address
  20.  
  21.  
  22. void setup()
  23. {
  24.   Serial.begin(9600);
  25.  
  26.   mLink.init();                             // Initialise the library
  27. }
  28.  
  29.  
  30. void loop()
  31. {
  32.   mLink.wake(I2C_ADD);                      // Wake device
  33.  
  34.   mLink.envSens_Trigger(I2C_ADD);           // Trigger a measurement
  35.  
  36.   while(mLink.busy(I2C_ADD));               // Wait until done
  37.  
  38.   float tmp = mLink.envSens_Temp(I2C_ADD);  // Get new temperature (oC)
  39.   float hum = mLink.envSens_Hum(I2C_ADD);   // Get new humidity (%RH)
  40.   float prs = mLink.envSens_Pres(I2C_ADD);  // Get new pressure (mbar/hPa)
  41.   float amb = mLink.envSens_Amb(I2C_ADD);   // Get new ambient light (lux)
  42.   float wht = mLink.envSens_Wht(I2C_ADD);   // Get new white light (lux)
  43.  
  44.   mLink.sleep(I2C_ADD);                     // Go back to sleep
  45.  
  46.   // Print the results
  47.   Serial.print("Temp:\t"); Serial.println(tmp);
  48.   Serial.print("Hum:\t"); Serial.println(hum);
  49.   Serial.print("Pres:\t"); Serial.println(prs);
  50.   Serial.print("Amb:\t"); Serial.println(amb);
  51.   Serial.print("White:\t"); Serial.println(wht);
  52.   Serial.println("");
  53.  
  54.   delay(2000);
  55. }



Image

Image


When connecting to a Raspberry Pi the mLink modules I2C pullup resistors should be removed. See the 'Removing the modules I2C pullup resistors' section below for more information.



  1. # mLink environmental sensor example
  2. # This example demonstrates how to read the various sensors of the
  3. # mLink Environmental sensor module.
  4. #
  5. # To use this script you will need to have the mLink module installed.
  6. # Please see library forum thread for more information:
  7. #
  8. # https://forum.hobbycomponents.com/viewtopic.php?f=131&t=3135
  9.  
  10.  
  11.  
  12. from mLink import mLink                     # Import the mLink module
  13. import time
  14.  
  15. ml = mLink.mLink(1)                         # Create an instance of the module
  16.  
  17. I2C_ADD = 0x61                              # Default I2C address is 0x61
  18.  
  19.  
  20.  
  21. while 1:
  22.    
  23.     ml.envSens_Trigger(I2C_ADD)
  24.    
  25.     while (ml.busy(I2C_ADD)):               # Wait for data to be transmitted
  26.         continue
  27.    
  28.     tmp = ml.envSens_Temp(I2C_ADD)          # Get temperature in oC
  29.     hum = ml.envSens_Hum(I2C_ADD)           # Get humidity in %RH
  30.     prs = ml.envSens_Pres(I2C_ADD)          # Get pressure in mBar/hPa
  31.     amb = ml.envSens_Amb(I2C_ADD)           # Get ambient light in lux
  32.     wht = ml.envSens_Wht(I2C_ADD)           # Get white light in lux
  33.    
  34.     print("Tmp =", tmp);                    # Print the results
  35.     print("Hum =", hum);
  36.     print("Prs =", prs);
  37.     print("Amb =", amb);
  38.     print("Wht =", wht, "\n");
  39.  
  40.     time.sleep(2)                           # Wait a little before reading again


Image


Dimensions:

Image



Factory Reset:
Should you wish to restore the module back to its factory default configuration, this can be done by manually forcing a factory reset. All mLink modules include a set of pads labelled clear:


Image


To perform a factory reset carefully link the two pads together with a piece of wire or with something conductive such as a paperclip. Whilst linked, connect power to the module via the VCC and GND connections. Wait a few seconds and then remove the short from the pads. The module's settings, including its I2C address, should now be restored back to factory defaults.



Removing I2C pullups:
If your development board already has pullups for its I2C interface fitted, or you wish to connect more than 5 mLink boards to the same I2C interface, then you can remove the pullups for the additional boards by cutting the tracks between the solder pads shown below.


Image



Image


mLink Arduino library

viewtopic.php?f=58&t=3001

Please note that you will need at least V2.3.0 (25 Jun 2025) of the library to support this module. If you have an older version already installed please update it to the latest version.


mLink Raspberry Pi Python module
The mLink python module can be installed with the following terminal command:

  1. pip install hc-mlink

Alternatively the library can be manually installed by downloading it from the forum and unzipping it to your project folder. See the Python module forum thread for more information and download link:
viewtopic.php?f=131&t=3062&p=8592#p8592

Please note that in some cases there may be additional configuration required. If you have issues getting your Raspberry Pi to communicate with the mLink module then please see the Python module forum thread here: viewtopic.php?f=131&t=3062


mLink Specifications and Register Map

https://hobbycomponents.com/downloads/m ... er_Map.pdf



Libraries, example code, and diagrams are provided as an additional free service by Hobby Components and are not sold as part of this product. We do not provide any guarantees or warranties as to their accuracy or fitness for purpose.

Post Reply

Return to “mLink”