diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/compatibility.yml b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/compatibility.yml new file mode 100644 index 0000000000..f0008fc25d --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/compatibility.yml @@ -0,0 +1,17 @@ +software: + - arduino-ide + - arduino-cli + - web-editor +hardware: + boards: + - nano-33-iot + - nano-33-ble + - nano-33-ble-sense + - nano-rp2040-connect + - nano-esp32 + - nano-matter + - uno-r4-wifi + - uno-q + shields: ~ + carriers: + - nano-connector-carrier diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/GenMech.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/GenMech.png new file mode 100644 index 0000000000..809a8d6213 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/GenMech.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/I2CTag.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/I2CTag.png new file mode 100644 index 0000000000..5e290c908a Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/I2CTag.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/JoyMec.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/JoyMec.png new file mode 100644 index 0000000000..715de08195 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/JoyMec.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/JoystickPinout.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/JoystickPinout.png new file mode 100644 index 0000000000..7ae139c6a4 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/JoystickPinout.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/Modulino_Joystick_Block_Diagram.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/Modulino_Joystick_Block_Diagram.png new file mode 100644 index 0000000000..61a5f6e99d Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/Modulino_Joystick_Block_Diagram.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/Modulino_Joystick_Power_Tree.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/Modulino_Joystick_Power_Tree.png new file mode 100644 index 0000000000..cbf5e90dc5 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/Modulino_Joystick_Power_Tree.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/ResistorsPullupGen.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/ResistorsPullupGen.png new file mode 100644 index 0000000000..7095581413 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/ResistorsPullupGen.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/featured.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/featured.png new file mode 100644 index 0000000000..b68f8fa253 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/assets/featured.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/datasheet.md b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/datasheet.md new file mode 100644 index 0000000000..f37e016933 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/datasheet/datasheet.md @@ -0,0 +1,242 @@ +--- +identifier: ABX00135 +title: Arduino® Modulino® Joystick +type: maker +author: Pedro Sousa Lima +--- + +![](assets/featured.png) + +# Description + +The Arduino® Modulino Joystick features a FJN10K-S1B10KD0N analogue joystick with an integrated pushbutton, powered by an on-board STM32C011F4 microcontroller. This dual-axis input device with centre-click functionality enables precise directional control and user interaction for gaming, robotics, and interface applications. + +# Target Areas + +Maker, beginner, education + +# Contents +## Application Examples + +- **Gaming Controllers** + Create custom game controllers or remote control interfaces with precise analogue input and pushbutton functionality for enhanced gaming experiences. + +- **Robotics Control** + Control robot movement, camera positioning, or servo motors with smooth analogue input across horizontal and vertical axes for precise control. + +- **Interactive Interfaces** + Design menu navigation systems, parameter adjustment interfaces, or interactive art installations with intuitive joystick-based user input. + +
+ +## Features +- **Analogue joystick** (FJN10K-S1B10KD0N) with dual-axis control and integrated pushbutton. +- **60° movement angle** providing smooth analogue control across both horizontal and vertical axes. +- Integrated **STM32C011F4** microcontroller providing I2C interface by default. +- **Optional SWD** interface for custom firmware and advanced features. +- Designed for **3.3V** operation via the Qwiic connector (I2C). +- **Breadboard compatible** with 900mil header spacing for prototyping. + +### Contents +| **SKU** | **Name** | **Purpose** | **Quantity** | +| ---------- | --------------------- | -------------------------------------- | ------------ | +| ABX00135 | Modulino® Joystick | Dual-axis analogue joystick with button | 1 | +| | I2C Qwiic cable | Compatible with the Qwiic standard | 1 | + +## Related Products +- *SKU: ASX00027* - [Arduino® Sensor Kit](https://store.arduino.cc/products/arduino-sensor-kit) +- *SKU: K000007* - [Arduino® Starter Kit](https://store.arduino.cc/products/arduino-starter-kit-multi-language) +- *SKU: AKX00026* - [Arduino® Oplà IoT Kit](https://store.arduino.cc/products/opla-iot-kit) +- *SKU: AKX00069* - [Arduino® Plug and Make Kit](https://store.arduino.cc/products/plug-and-make-kit) + +## Rating + +### Recommended Operating Conditions +- **Powered at 3.3 V** through the Qwiic interface (in accordance with the Qwiic standard) +- **Operating temperature:** -40 °C to +85 °C + +**Typical current consumption:** +- Microcontroller + joystick: ~3.4 mA + +## Power Tree +The power tree for the Modulino® node can be consulted below: + +![Modulino® Joystick Power Tree](assets/Modulino_Joystick_Power_Tree.png) + +## Block Diagram +This module includes an STM32C011F4 microcontroller that reads the analogue joystick potentiometers for horizontal and vertical axes, plus the integrated pushbutton. It communicates via I2C by default, but can be reprogrammed via SWD for custom functionality. + +![Modulino® Joystick Block Diagram](assets/Modulino_Joystick_Block_Diagram.png) + +## Functional Overview +The Modulino® Joystick reads the FJN10K-S1B10KD0N analogue joystick's dual potentiometers (horizontal and vertical axes) and the integrated pushbutton state. The STM32C011F4 microcontroller processes these analogue signals and provides digital values via I2C. The joystick offers 60° movement range in both directions with smooth analogue control and reliable centre positioning. + +### Technical Specifications (Module-Specific) +| **Specification** | **Details** | +| ----------------------- | ----------------------------------------------- | +| **Microcontroller** | STM32C011F4 | +| **Joystick Model** | FJN10K-S1B10KD0N | +| **Movement Range** | 60° in both horizontal and vertical axes | +| **Pushbutton** | Integrated centre-click button | +| **Supply Voltage** | Rec: 3.3 V | +| **Power Consumption** | ~3.4 mA (microcontroller + joystick) | +| **Resolution** | 12-bit ADC for both axes | +| **Communication** | I2C (Qwiic), SWD (reprogramming), UART (option) | + +### Pinout + +**Qwiic / I2C (1×4 Header)** +| **Pin** | **Function** | +|---------|---------------------------| +| GND | Ground | +| 3.3 V | Power Supply (3.3 V) | +| SDA | I2C Data | +| SCL | I2C Clock | + +These pads and the Qwiic connectors share the same I2C bus at 3.3 V. + +**Additional 1×4 Header (MCU Debug Signals)** +| **Pin** | **Function** | +|---------|-------------------| +| PF2 | RESET (NRST) | +| SWCLK | SWD Clock (PA14) | +| SWDIO | SWD Data (PA13) | +| TX1 | USART Transmit (PA9) | + +**1×4 Header (Joystick & MCU Signals)** +| **Pin** | **Function** | +|---------|---------------------------| +| RX1 | USART Receive (PA10) | +| PA0 | Joystick Horizontal Axis | +| PA1 | Joystick Vertical Axis | +| PA2 | Joystick Pushbutton | + +**Note:** The board is breadboard compatible with 1×4 headers spaced by 900 mil (22.86 mm). The joystick axes provide analogue values from 0-4095 (12-bit resolution), with centre position at approximately 2048. + +![Pinout Overview](assets/JoystickPinout.png) + +### Power Specifications +- **Nominal operating voltage:** 3.3 V via Qwiic + +### Mechanical Information +![Modulino® Joystick Mechanical Information](assets/JoyMec.png) + +- Board dimensions: 41 mm × 25.36 mm +- Thickness: 1.6 mm (±0.2 mm) +- Four mounting holes (⌀ 3.2 mm) + - Hole spacing: 16 mm vertically, 32 mm horizontally +- **Breadboard compatible:** 1×4 headers spaced by 900 mil (22.86 mm) + +![Modulino® Node Shape](assets/GenMech.png) + +### I2C Address Reference +| **Board Silk Name** | **Sensor/Actuator** | **Modulino® I2C Address (HEX)** | **Editable Addresses (HEX)** | **Hardware I2C Address (HEX)** | +|---------------------|-------------------------|--------------------------------|---------------------------------------------|--------------------------------| +| MODULINO JOYSTICK | Analogue Joystick + MCU | 0x40 | Any custom address (via software config.) | 0x20 | + + **Note:** + - Default I2C address is **0x40**. + - A white rectangle on the bottom silk allows users to write a new address after reconfiguration. + ![Blank silk for identification](assets/I2CTag.png) + +#### Pull-up Resistors + +This module has pads for optional I2C pull-up mounting in both data lines. No resistors are mounted by default but in case the resistors are needed 4.7 K resistors in an SMD 0402 format are recommended. + +These are positioned near the Qwiic connector on the power LED side. +![Generic pull-up resistor position](assets/ResistorsPullupGen.png) + +## Device Operation +By default, the board is an I2C target device. It continuously monitors the joystick's horizontal and vertical potentiometers plus the pushbutton state, providing digital values via I2C registers. The joystick returns to centre position when released, with values ranging from 0-4095 for each axis. Simply connect it to a 3.3 V Qwiic interface and read the axis positions and button state via I2C. + +### Getting Started +Use any standard Arduino workflow-desktop IDE or Arduino Cloud Editor. The official Modulino library provides simple functions to read joystick X/Y coordinates and button state. The joystick values are automatically centred and scaled for easy use in gaming or control applications. + +### Joystick Output Values +- **Horizontal Axis (X):** 0-4095 (left to right), centre ≈ 2048 +- **Vertical Axis (Y):** 0-4095 (down to up), centre ≈ 2048 +- **Pushbutton:** Boolean state (pressed/released) +- **Centre Position:** Joystick returns to centre when released + +# Certifications + +## Certifications Summary + +| **Certification** | **Status** | +|:-----------------:|:----------:| +| CE/RED (Europe) | Yes | +| UKCA (UK) | Yes | +| FCC (USA) | Yes | +| IC (Canada) | Yes | +| RoHS | Yes | +| REACH | Yes | +| WEEE | Yes | + +## Declaration of Conformity CE DoC (EU) + +

We declare under our sole responsibility that the products above are in conformity with the essential requirements of the following EU Directives and therefore qualify for free movement within markets comprising the European Union (EU) and European Economic Area (EEA).

+ +## Declaration of Conformity to EU RoHS & REACH 211 01/19/2021 + +

Arduino boards are in compliance with RoHS 2 Directive 2011/65/EU of the European Parliament and RoHS 3 Directive 2015/863/EU of the Council of 4 June 2015 on the restriction of the use of certain hazardous substances in electrical and electronic equipment.

+ +| Substance | **Maximum limit (ppm)** | +|----------------------------------------|-------------------------| +| Lead (Pb) | 1000 | +| Cadmium (Cd) | 100 | +| Mercury (Hg) | 1000 | +| Hexavalent Chromium (Cr6+) | 1000 | +| Poly Brominated Biphenyls (PBB) | 1000 | +| Poly Brominated Diphenyl ethers (PBDE) | 1000 | +| Bis(2-Ethylhexyl) phthalate (DEHP) | 1000 | +| Benzyl butyl phthalate (BBP) | 1000 | +| Dibutyl phthalate (DBP) | 1000 | +| Diisobutyl phthalate (DIBP) | 1000 | + +Exemptions: No exemptions are claimed. + +

Arduino Boards are fully compliant with the related requirements of European Union Regulation (EC) 1907 /2006 concerning the Registration, Evaluation, Authorization and Restriction of Chemicals (REACH). We declare none of the SVHCs (https://echa.europa.eu/web/guest/candidate-list-table), the Candidate List of Substances of Very High Concern for authorization currently released by ECHA, is present in all products (and also package) in quantities totaling in a concentration equal or above 0.1%. To the best of our knowledge, we also declare that our products do not contain any of the substances listed on the "Authorization List" (Annex XIV of the REACH regulations) and Substances of Very High Concern (SVHC) in any significant amounts as specified by the Annex XVII of Candidate list published by ECHA (European Chemical Agency) 1907 /2006/EC.

+ +## FCC WARNING + +This device complies with part 15 of the FCC Rules. + +Operation is subject to the following two conditions: + +(1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. + +## IC Caution + +This device complies with Industry Canada licence-exempt RSS standard(s). + +Operation is subject to the following two conditions: + +(1) This device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. + +## Conflict Minerals Declaration + +

As a global supplier of electronic and electrical components, Arduino is aware of our obligations with regard to laws and regulations regarding Conflict Minerals, specifically the Dodd-Frank Wall Street Reform and Consumer Protection Act, Section 1502. Arduino does not directly source or process conflict minerals such as Tin, Tantalum, Tungsten, or Gold. Conflict minerals are contained in our products in the form of solder or as a component in metal alloys. As part of our reasonable due diligence, Arduino has contacted component suppliers within our supply chain to verify their continued compliance with the regulations. Based on the information received thus far we declare that our products contain Conflict Minerals sourced from conflict-free areas.

+ +# Company Information + +| Company name | Arduino SRL | +|-----------------|-----------------------------------------------| +| Company Address | Via Andrea Appiani, 25 - 20900 MONZA(Italy) | + +# Reference Documentation + +| Ref | Link | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Arduino IDE (Desktop) | [https://www.arduino.cc/en/software/](https://www.arduino.cc/en/software/) | +| Arduino Courses | [https://www.arduino.cc/education/courses](https://www.arduino.cc/education/courses) | +| Arduino Documentation | [https://docs.arduino.cc/](https://docs.arduino.cc/) | +| Arduino IDE (Cloud) | [https://create.arduino.cc/editor](https://create.arduino.cc/editor) | +| Cloud IDE Getting Started | [https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor](https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor) | +| Project Hub | [https://projecthub.arduino.cc/](https://projecthub.arduino.cc/) | +| Library Reference | [https://github.com/arduino-libraries/](https://github.com/arduino-libraries/) | +| Online Store | [https://store.arduino.cc/](https://store.arduino.cc/) | + +# Revision History +| **Date** | **Revision** | **Changes** | +|------------|--------------|-----------------------------------| +| 14/10/2025 | 1 | First release | \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/essentials.md b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/essentials.md new file mode 100644 index 0000000000..c61bcb5a56 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/essentials.md @@ -0,0 +1,11 @@ + + + +This library allows you to communicate with the Arduino Modulino® nodes. + + + +This library allows you to communicate with the Arduino Modulino® nodes in MicroPython. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/features.md b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/features.md new file mode 100644 index 0000000000..5898d96eaa --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/features.md @@ -0,0 +1,14 @@ + +The Modulino® Joystick module features a dual-axis analogue joystick with an integrated pushbutton, perfect for gaming, robotics control, and interactive interfaces. It is designed to be used with any compatible board with Qwiic, allowing you to build interactive projects without making complicated connections. The module also includes example projects for you to learn important programming concepts and get inspired. + + + + + +This module provides smooth analogue control across both horizontal and vertical axes with a 60° movement range, perfect for gaming controllers and robotics navigation. + + +The Modulino® Joystick module connects to your UNO R4 WiFi with Qwiic cables, letting you focus on learning programming without building complex circuits. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/image.svg b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/image.svg new file mode 100644 index 0000000000..e5a538fd00 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/image.svg @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/product.md b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/product.md new file mode 100644 index 0000000000..4c5530ecb3 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/product.md @@ -0,0 +1,13 @@ +--- +title: Modulino Joystick +url_shop: https://store.arduino.cc/products/modulino-joystick +url_guide: https://courses.arduino.cc/plugandmake +primary_button_url: https://docs.arduino.cc/tutorials/modulino-joystick/how-joystick/ +primary_button_title: Get Started +secondary_button_url: https://docs.arduino.cc/tutorials/modulino-thermo/how-general/ +secondary_button_title: More on Modulino Nodes +forumCategorySlug: '/hardware/accessories/modulino-joystick/?!?!' +sku: [ABX00135] +--- + +A dual-axis analogue joystick with integrated pushbutton for precise directional control. Perfect for gaming controllers, robotics navigation, or interactive interfaces. Compatible with Arduino UNO R4 WiFi or any Qwiic-enabled board, with solderable pins available for custom wiring. Get smooth, responsive control without complex circuitry. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tech-specs.md b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tech-specs.md new file mode 100644 index 0000000000..0c19b9f9bb --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tech-specs.md @@ -0,0 +1 @@ +Here you will find the technical specifications for the Modulino® Joystick. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tech-specs.yml b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tech-specs.yml new file mode 100644 index 0000000000..7b4e56a0ec --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tech-specs.yml @@ -0,0 +1,11 @@ +Node: + Name: Modulino Joystick + SKU: ABX00135 + Board recommended: Arduino® UNO R4 WiFi (ABX00087) and Arduino® UNO Q (ABX00162) + Communications: I2C (over Qwiic connector or solderable pin) + Operational voltage: 3.3V + Sensor: + Analogue Joystick (FJN10K-S1B10KD0N) with STM32C011F4: 0x40 (address can change via software) + +Other accessories: + Qwiic cables: 1x diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/assets/JoystickOverview.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/assets/JoystickOverview.png new file mode 100644 index 0000000000..b68f8fa253 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/assets/JoystickOverview.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/assets/JoystickPinout.png b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/assets/JoystickPinout.png new file mode 100644 index 0000000000..7ae139c6a4 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/assets/JoystickPinout.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/how-joystick.md b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/how-joystick.md new file mode 100644 index 0000000000..3f5e926d1b --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-joystick/tutorials/how-joystick/how-joystick.md @@ -0,0 +1,322 @@ +--- +title: "Getting Started with Modulino Joystick" +description: "Complete guide for the Modulino Joystick input module and programming with Arduino and MicroPython." +tags: + - Modulino + - Joystick + - Input + - Control + - QWIIC + - I2C +author: 'Pedro Sousa Lima' +hardware: + - hardware/11.modulinos/modulinos/modulino-joystick +software: + - ide-v2 + - web-editor + - micropython +--- + +![Joystick Overview](assets/JoystickOverview.png) + +The Modulino Joystick is a modular input device that provides two-axis analogue control with an integrated push button, making it perfect to add intuitive directional input to your projects! It uses the standardised Modulino form factor with QWIIC connectors for easy integration. + +## Hardware Overview + +### General Characteristics + +The Modulino Joystick features a two-axis analogue joystick with push button functionality: + +| Parameter | Condition | Minimum | Typical | Maximum | Unit | +|-----------|-----------|---------|---------|---------|------| +| X-Axis Range | - | 0 | 2048 | 4095 | - | +| Y-Axis Range | - | 0 | 2048 | 4095 | - | +| Resolution | - | - | 12 | - | bit | + +### Sensor Details + +The **Modulino Joystick** module features an analogue joystick with two potentiometers (horizontal and vertical axes) and an integrated push button. The joystick does not have native I²C capabilities. Instead, the readings are processed by the Modulino's onboard microcontroller (STM32C011F4), which provides I²C communication. + +One unique feature of this setup is the ability to change the I²C address via software, making it adaptable to different system configurations. + +The default I²C address for the **Modulino Joystick** module is: + +| Modulino I²C Address | Hardware I²C Address | Editable Addresses (HEX) | +|----------------------|----------------------|--------------------------------------------------| +| 0x40 | 0x20 | Any custom address (via software configuration) | + +### Pinout + +![Modulino Joystick Pinout](assets/JoystickPinout.png) + +**Qwiic / I2C (1×4 Header)** +| **Pin** | **Function** | +|---------|---------------------------| +| GND | Ground | +| 3.3 V | Power Supply (3.3 V) | +| SDA | I2C Data | +| SCL | I2C Clock | + +These pads and the Qwiic connectors share the same I2C bus at 3.3 V. + +**Additional 1×4 Header (MCU Debug Signals)** +| **Pin** | **Function** | +|---------|-------------------| +| PF2 | RESET (NRST) | +| SWCLK | SWD Clock (PA14) | +| SWDIO | SWD Data (PA13) | +| TX1 | USART Transmit (PA9) | + +**1×4 Header (Joystick & MCU Signals)** +| **Pin** | **Function** | +|---------|---------------------------| +| RX1 | USART Receive (PA10) | +| PA0 | Joystick Horizontal Axis | +| PA1 | Joystick Vertical Axis | +| PA2 | Joystick Pushbutton | + +**Note:** The board is breadboard compatible with 1×4 headers spaced by 900 mil (22.86 mm). The joystick axes provide analogue values from 0-4095 (12-bit resolution), with centre position at approximately 2048. + +### Power Specifications + +| Parameter | Condition | Typical | Unit | +|---------------------|-----------|---------|------| +| Operating Voltage | - | 3.3 | V | +| Current Consumption | - | ~3.4 | mA | + +The module includes a power LED that draws 1 mA and turns on as soon as it is powered. + +### Schematic + +The Modulino Joystick features an analogue joystick controlled through a microcontroller for I²C communication. + +The main components are the analogue joystick with two potentiometers and the **STM32C011F4** microcontroller (U1), which reads the analogue values and handles I²C communication. + +You can connect to the I²C pins (SDA and SCL) using either the **QWIIC connectors** (J1 and J2, this is the recommended method) or the **solderable pins** (J4). The board runs on **3.3V**, which comes from the QWIIC cable or the **3V3 pin** on J4. + +There's also a small power LED indicator that lights up when the board is on. + +You can grab the full schematic and PCB files from the [Modulino Joystick page](https://docs.arduino.cc/hardware/modulinos/modulino-joystick). + +## Programming with Arduino + +The Modulino Joystick is fully compatible with the Arduino IDE and the official Modulino library. The following examples showcase how to read joystick position and button state for gaming and control applications. + +### Prerequisites + +- Install the Modulino library via the Arduino IDE Library Manager +- Connect your Modulino Joystick via QWIIC or solderable headers + +For detailed instructions on setting up your Arduino environment and installing libraries, please refer to the [Getting Started with Modulinos guide](../how-general). + +Library repository available [here](https://github.com/arduino-libraries/Arduino_Modulino). + +### Basic Example + +```arduino +#include + +ModulinoJoystick joystick; + +void setup() { + Serial.begin(9600); + Modulino.begin(); + joystick.begin(); +} + +void loop() { + // Update joystick readings + if (joystick.update()) { + // Read X and Y axes (range: -128 to 127) + int8_t x = joystick.getX(); + int8_t y = joystick.getY(); + + // Check button state + bool pressed = joystick.isPressed(); + + // Display readings + Serial.print("X: "); + Serial.print(x); + Serial.print("\tY: "); + Serial.print(y); + Serial.print("\tButton: "); + Serial.println(pressed ? "PRESSED" : "Released"); + } + + delay(50); +} +``` + +### Key Functions + +- `update()`: Updates joystick state, returns `true` if values changed +- `getX()`: Returns horizontal position (-128 to 127, centre = 0) +- `getY()`: Returns vertical position (-128 to 127, centre = 0) +- `isPressed()`: Returns button state (`HIGH` when pressed) +- `setDeadZone(threshold)`: Sets the centre dead zone threshold (default 26) + +### Advanced Example - Direction Detection + +```arduino +#include + +ModulinoJoystick joystick; + +// Movement thresholds +const int8_t MOVE_THRESHOLD = 50; + +void setup() { + Serial.begin(9600); + Modulino.begin(); + joystick.begin(); + + // Set custom dead zone (smaller = more sensitive) + joystick.setDeadZone(20); + + Serial.println("Joystick Direction Detector"); +} + +void loop() { + if (joystick.update()) { + int8_t x = joystick.getX(); + int8_t y = joystick.getY(); + bool button = joystick.isPressed(); + + // Determine direction + String direction = "CENTRE"; + + if (y > MOVE_THRESHOLD) { + direction = "DOWN"; + } else if (y < -MOVE_THRESHOLD) { + direction = "UP"; + } + + if (x > MOVE_THRESHOLD) { + direction += (direction == "CENTRE") ? "RIGHT" : " RIGHT"; + } else if (x < -MOVE_THRESHOLD) { + direction += (direction == "CENTRE") ? "LEFT" : " LEFT"; + } + + // Display state + Serial.print("Direction: "); + Serial.print(direction); + + if (button) { + Serial.println(" [ACTION!]"); + } else { + Serial.println(); + } + } + + delay(50); +} +``` + +## Programming with MicroPython + +The Modulino Joystick is fully compatible with MicroPython through the official Modulino MicroPython library. The following examples demonstrate how to read joystick position and button state in your MicroPython projects. + +### Prerequisites + +- Install the Modulino MicroPython library (see [Getting Started with Modulinos](./how-general) for detailed instructions) +- Ensure Arduino Lab for MicroPython is installed + +### Basic Example + +```python +from modulino import ModulinoJoystick +from time import sleep + +joystick = ModulinoJoystick() + +while True: + x = joystick.x + y = joystick.y + pressed = joystick.is_pressed + + if x is not None and y is not None: + print(f"X: {x:4d} Y: {y:4d} Button: {'PRESSED' if pressed else 'Released'}") + + sleep(0.1) +``` + +### Key Properties + +- `.x`: Returns horizontal position (-128 to 127, centre = 0) +- `.y`: Returns vertical position (-128 to 127, centre = 0) +- `.is_pressed`: Returns button state (True when pressed) + +### Advanced Example - Game Controller + +```python +from modulino import ModulinoJoystick +from time import sleep + +joystick = ModulinoJoystick() + +MOVE_THRESHOLD = 50 + +def get_direction(x, y): + """Determine joystick direction""" + direction = "CENTRE" + + if y > MOVE_THRESHOLD: + direction = "DOWN" + elif y < -MOVE_THRESHOLD: + direction = "UP" + + if x > MOVE_THRESHOLD: + direction += " RIGHT" if direction == "CENTRE" else " RIGHT" + elif x < -MOVE_THRESHOLD: + direction += " LEFT" if direction == "CENTRE" else " LEFT" + + return direction + +print("🎮 Game Controller Ready") +print("Move joystick to control") + +while True: + x = joystick.x + y = joystick.y + pressed = joystick.is_pressed + + if x is not None and y is not None: + direction = get_direction(x, y) + action = " [ACTION!]" if pressed else "" + print(f"Direction: {direction:15s}{action}") + + sleep(0.1) +``` + +## Troubleshooting + +### Sensor Not Reachable + +If your Modulino's power LED isn't on or the sensor isn't responsive: +- Ensure both the board and the Modulino are connected to your computer +- Verify that the power LEDs on both are lit +- Check that the QWIIC cable is properly clicked into place + +### Inaccurate Values + +If the joystick values are not centred or accurate: +- Allow the joystick to self-centre (release it completely) +- Adjust the dead zone using `setDeadZone()` if needed +- Ensure the module is on a stable surface + +### Library Issues + +See the [Getting Started with Modulinos](./how-general) guide for library installation troubleshooting. + +## Project Ideas + +Now that you've learned how to use your Modulino Joystick, try these projects: + +- **Robot Controller**: Control a wheeled robot with intuitive directional input +- **Game Console**: Build retro-style games with joystick control +- **Camera Pan/Tilt**: Control servo motors for camera movement +- **Drone Controller**: Create a ground station for RC vehicles +- **Menu Navigation**: Navigate through LCD menu systems +- **Drawing Pad**: Control cursor position for digital art applications +- **Lighting Control**: Adjust RGB LED colours by moving the joystick +- **Mechanical Arm**: Control robotic arm positioning diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/compatibility.yml b/content/hardware/11.modulino/modulino-nodes/modulino-latch/compatibility.yml new file mode 100644 index 0000000000..f0008fc25d --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/compatibility.yml @@ -0,0 +1,17 @@ +software: + - arduino-ide + - arduino-cli + - web-editor +hardware: + boards: + - nano-33-iot + - nano-33-ble + - nano-33-ble-sense + - nano-rp2040-connect + - nano-esp32 + - nano-matter + - uno-r4-wifi + - uno-q + shields: ~ + carriers: + - nano-connector-carrier diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/GenMech.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/GenMech.png new file mode 100644 index 0000000000..809a8d6213 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/GenMech.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/I2CTag.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/I2CTag.png new file mode 100644 index 0000000000..5e290c908a Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/I2CTag.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/Modulino_Latch_Block_Diagram.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/Modulino_Latch_Block_Diagram.png new file mode 100644 index 0000000000..eea2289c2a Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/Modulino_Latch_Block_Diagram.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/Modulino_Latch_Power_Tree.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/Modulino_Latch_Power_Tree.png new file mode 100644 index 0000000000..01d9db7a25 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/Modulino_Latch_Power_Tree.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/RelayMec.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/RelayMec.png new file mode 100644 index 0000000000..ca2ca44659 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/RelayMec.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/RelayPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/RelayPinouts.png new file mode 100644 index 0000000000..7b93ddaaff Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/RelayPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/ResistorsPullupGen.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/ResistorsPullupGen.png new file mode 100644 index 0000000000..7095581413 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/ResistorsPullupGen.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/featured.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/featured.png new file mode 100644 index 0000000000..925e7fd015 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/assets/featured.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/datasheet.md b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/datasheet.md new file mode 100644 index 0000000000..f3dcef885a --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/datasheet/datasheet.md @@ -0,0 +1,238 @@ +--- +identifier: ABX00138 +title: Arduino® Modulino® Latch Relay +type: maker +author: Pedro Sousa Lima +--- + +![](assets/featured.png) + +# Description + +The Arduino® Modulino Latch Relay, powered by an on-board STM32C011F4 microcontroller, features an electromechanical bistable latching relay (HFE60/3-1HT-L2) capable of switching high-power loads. This setup enables both simple relay control via I2C and maintains its last state even when power is removed. + +**IMPORTANT SAFETY NOTE: This board is NOT SAFE for 250VAC switching and must only be used for DC loads (maximum 30V DC) due to exposed metal contacts.** + +# Target Areas + +Maker, beginner, education + +# Contents +## Application Examples + +- **DC Power Control** + Switch DC motors, pumps, heaters, or lighting systems in automation projects with high current capacity. + +- **Smart Home Automation** + Control appliances and devices that require bistable switching, where maintaining state during power outages is critical. + +- **Industrial Control** + Implement safety interlocks or control systems where the relay state must be maintained regardless of control system power status. + +
+ +## Features +- **Electromechanical bistable latching relay** (HFE60/3-1HT-L2) that maintains state without power. +- Integrated **STM32C011F4** microcontroller providing I2C interface by default. +- **Dual coil design** with SET and RESET functionality controlled via I2C. +- Designed for **3.3V** operation via the Qwiic connector (I2C). + +### Contents +| **SKU** | **Name** | **Purpose** | **Quantity** | +| ---------- | --------------------------- | -------------------------------------------- | ------------ | +| ABX00138 | Modulino® Latch Relay | Bistable relay for high-power switching | 1 | +| | I2C Qwiic cable | Compatible with the Qwiic standard | 1 | + +## Related Products +- *SKU: ASX00027* - [Arduino® Sensor Kit](https://store.arduino.cc/products/arduino-sensor-kit) +- *SKU: K000007* - [Arduino® Starter Kit](https://store.arduino.cc/products/arduino-starter-kit-multi-language) +- *SKU: AKX00026* - [Arduino® Oplà IoT Kit](https://store.arduino.cc/products/opla-iot-kit) +- *SKU: AKX00069* - [Arduino® Plug and Make Kit](https://store.arduino.cc/products/plug-and-make-kit) + +## Rating + +### Recommended Operating Conditions +- **Powered at 3.3 V** through the Qwiic interface (in accordance with the Qwiic standard) +- **Operating temperature:** -40 °C to +85 °C + +**Typical current consumption:** +- Microcontroller: ~3.4mA +- Coil activation: ~100mA for 50ms (during switching only) + +## Power Tree +The power tree for the Modulino® node can be consulted below: + +![Modulino® Latch Relay Power Tree](assets/Modulino_Latch_Power_Tree.png) + +## Block Diagram +This module includes an STM32C011F4 microcontroller handling relay control via dual MOSFETs. The bistable relay maintains its state without continuous power. It communicates via I2C by default, but can be reprogrammed via SWD for custom functionality. + +![Modulino® Latch Relay Block Diagram](assets/Modulino_Latch_Block_Diagram.png) + +## Functional Overview +The Modulino® Latch Relay features a bistable latching relay that retains its last state (OPEN/CLOSED) even when power is removed. The on-board STM32C011F4 controls dual N-MOSFETs (2N7002PS,115) that drive the SET and RESET coils. LED indicators show the current state, and the relay can switch DC loads up to 30V DC. + +### Technical Specifications (Module-Specific) +| **Specification** | **Details** | +| --------------------------- | ----------------------------------------------- | +| **Microcontroller** | STM32C011F4 | +| **Relay Type** | HFE60/3-1HT-L2 bistable latching | +| **Supply Voltage** | Rec: 3.3 V | +| **Power Consumption** | ~3.4 mA idle, ~100 mA during switching | +| **Coil Voltage** | 3 V nominal, 2.4 V min, 3.9 V max | +| **Communication** | I2C (Qwiic), SWD (reprogramming) | + +### Pinout + + +**1×10 Header** + +| **Pin** | **Function** | +|---------|--------------| +| PA0 | SET Coil Control | +| PA1 | RESET Coil Control | +| GND | Ground | +| 3V3 | 3.3 V Power | +| PF2 | RESET | +| SDA | I2C Data | +| SCL | I2C Clock | +| SWCLK | SWD Clock | +| SWDIO | SWD Data | +| PA4 | Additional GPIO | + + **Note:** + - Never set both PA0 and PA1 HIGH simultaneously as this creates an undefined state. + - LED indicators: PA3 (SET yellow LED), PA2 (RESET red LED). + +![Pinout Overview](assets/RelayPinouts.png) + +### Power Specifications +- **Nominal operating voltage:** 3.3 V via Qwiic + +### Mechanical Information +![Modulino® Latch Relay Mechanical Information](assets/RelayMec.png) + +- Board dimensions: 41 mm × 25.36 mm +- Thickness: 1.6 mm (±0.2 mm) +- Four mounting holes (⌀ 3.2 mm) + - Hole spacing: 16 mm vertically, 32 mm horizontally + +![Modulino® Node Shape](assets/GenMech.png) + +### I2C Address Reference +| **Board Silk Name** | **Sensor/Actuator** | **Modulino® I2C Address (HEX)** | **Editable Addresses (HEX)** | **Hardware I2C Address (HEX)** | +|---------------------|-------------------------|--------------------------------|---------------------------------------------|--------------------------------| +| MODULINO LATCH RELAY| Bistable Latch Relay | 0x2A | Any custom address (via software config.) | 0x15 | + + **Note:** + - Default I2C address is **0x2A**. + - A white rectangle on the bottom silk allows users to write a new address after reconfiguration. + ![Blank silk for identification](assets/I2CTag.png) + +#### Pull-up Resistors + +This module has pads for optional I2C pull-up mounting in both data lines. No resistors are mounted by default but in case the resistors are needed 4.7 K resistors in an SMD 0402 format are recommended. + +These are positioned near the Qwiic connector on the power LED side. + +![Generic pull-up resistor position](assets/ResistorsPullupGen.png) + +## Device Operation +By default, the board is an I2C target device. It manages relay switching through integrated firmware that drives the SET and RESET coils via dual MOSFETs. The bistable nature means the relay maintains its state without continuous power. **DANGER: Never activate both SET and RESET coils simultaneously.** + +### Relay Control States +| **PA0 (SET)** | **PA1 (RESET)** | **Relay State** | +|---------------|-----------------|-----------------| +| HIGH (≥50ms) | LOW | CLOSED (Latched) | +| LOW | HIGH (≥50ms) | OPEN (Latched) | +| LOW | LOW | No change | +| HIGH | HIGH | **DANGER - UNDEFINED** | + +# Important Safety Warning + +**The board NODE36 RELAY ABX00138 IS NOT SAFE TO BE USED WHILE SWITCHING AC LOADS AND MUST ONLY BE USED TO SWITCH DC LOADS.** + +**Maximum DC voltage: 30V** + +# Certifications + +## Certifications Summary + +| **Certification** | **Status** | +|:-----------------:|:----------:| +| CE/RED (Europe) | Yes | +| UKCA (UK) | Yes | +| FCC (USA) | Yes | +| IC (Canada) | Yes | +| RoHS | Yes | +| REACH | Yes | +| WEEE | Yes | + +## Declaration of Conformity CE DoC (EU) + +

We declare under our sole responsibility that the products above are in conformity with the essential requirements of the following EU Directives and therefore qualify for free movement within markets comprising the European Union (EU) and European Economic Area (EEA).

+ +## Declaration of Conformity to EU RoHS & REACH 211 01/19/2021 + +

Arduino boards are in compliance with RoHS 2 Directive 2011/65/EU of the European Parliament and RoHS 3 Directive 2015/863/EU of the Council of 4 June 2015 on the restriction of the use of certain hazardous substances in electrical and electronic equipment.

+ +| Substance | **Maximum limit (ppm)** | +|----------------------------------------|-------------------------| +| Lead (Pb) | 1000 | +| Cadmium (Cd) | 100 | +| Mercury (Hg) | 1000 | +| Hexavalent Chromium (Cr6+) | 1000 | +| Poly Brominated Biphenyls (PBB) | 1000 | +| Poly Brominated Diphenyl ethers (PBDE) | 1000 | +| Bis(2-Ethylhexyl) phthalate (DEHP) | 1000 | +| Benzyl butyl phthalate (BBP) | 1000 | +| Dibutyl phthalate (DBP) | 1000 | +| Diisobutyl phthalate (DIBP) | 1000 | + +Exemptions: No exemptions are claimed. + +

Arduino Boards are fully compliant with the related requirements of European Union Regulation (EC) 1907 /2006 concerning the Registration, Evaluation, Authorization and Restriction of Chemicals (REACH). We declare none of the SVHCs (https://echa.europa.eu/web/guest/candidate-list-table), the Candidate List of Substances of Very High Concern for authorization currently released by ECHA, is present in all products (and also package) in quantities totaling in a concentration equal or above 0.1%. To the best of our knowledge, we also declare that our products do not contain any of the substances listed on the "Authorization List" (Annex XIV of the REACH regulations) and Substances of Very High Concern (SVHC) in any significant amounts as specified by the Annex XVII of Candidate list published by ECHA (European Chemical Agency) 1907 /2006/EC.

+ +## FCC WARNING + +This device complies with part 15 of the FCC Rules. + +Operation is subject to the following two conditions: + +(1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. + +## IC Caution + +This device complies with Industry Canada licence-exempt RSS standard(s). + +Operation is subject to the following two conditions: + +(1) This device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. + +## Conflict Minerals Declaration + +

As a global supplier of electronic and electrical components, Arduino is aware of our obligations with regard to laws and regulations regarding Conflict Minerals, specifically the Dodd-Frank Wall Street Reform and Consumer Protection Act, Section 1502. Arduino does not directly source or process conflict minerals such as Tin, Tantalum, Tungsten, or Gold. Conflict minerals are contained in our products in the form of solder or as a component in metal alloys. As part of our reasonable due diligence, Arduino has contacted component suppliers within our supply chain to verify their continued compliance with the regulations. Based on the information received thus far we declare that our products contain Conflict Minerals sourced from conflict-free areas.

+ +# Company Information + +| Company name | Arduino SRL | +|-----------------|-----------------------------------------------| +| Company Address | Via Andrea Appiani, 25 - 20900 MONZA(Italy) | + +# Reference Documentation + +| Ref | Link | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Arduino IDE (Desktop) | [https://www.arduino.cc/en/software/](https://www.arduino.cc/en/software/) | +| Arduino Courses | [https://www.arduino.cc/education/courses](https://www.arduino.cc/education/courses) | +| Arduino Documentation | [https://docs.arduino.cc/](https://docs.arduino.cc/) | +| Arduino IDE (Cloud) | [https://create.arduino.cc/editor](https://create.arduino.cc/editor) | +| Cloud IDE Getting Started | [https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor](https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor) | +| Project Hub | [https://projecthub.arduino.cc/](https://projecthub.arduino.cc/) | +| Library Reference | [https://github.com/arduino-libraries/](https://github.com/arduino-libraries/) | +| Online Store | [https://store.arduino.cc/](https://store.arduino.cc/) | + +# Revision History +| **Date** | **Revision** | **Changes** | +|------------|--------------|-----------------------------------| +| 01/07/2025 | 1 | First release | \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/essentials.md b/content/hardware/11.modulino/modulino-nodes/modulino-latch/essentials.md new file mode 100644 index 0000000000..c61bcb5a56 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/essentials.md @@ -0,0 +1,11 @@ + + + +This library allows you to communicate with the Arduino Modulino® nodes. + + + +This library allows you to communicate with the Arduino Modulino® nodes in MicroPython. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/features.md b/content/hardware/11.modulino/modulino-nodes/modulino-latch/features.md new file mode 100644 index 0000000000..0af41aa950 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/features.md @@ -0,0 +1,14 @@ + +The Modulino® Latch Relay module features a bistable latching relay that maintains its state without continuous power, capable of switching high-current DC loads up to 30V. It is designed to be used with any compatible board with Qwiic, allowing you to build automation and power control projects without making complicated connections. The module also includes example projects for you to learn important programming concepts and get inspired. + + + + + +This module uses a latching relay that maintains its state even when power is removed, ideal for energy-efficient automation and safety-critical applications. + + +The Modulino® Latch Relay module connects to your UNO R4 WiFi with Qwiic cables, letting you focus on learning programming without building complex circuits. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/image.svg b/content/hardware/11.modulino/modulino-nodes/modulino-latch/image.svg new file mode 100644 index 0000000000..57e298b1a4 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/image.svg @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/product.md b/content/hardware/11.modulino/modulino-nodes/modulino-latch/product.md new file mode 100644 index 0000000000..ac700b04d6 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/product.md @@ -0,0 +1,13 @@ +--- +title: Modulino Latch Relay +url_shop: https://store.arduino.cc/products/modulino-latch +url_guide: https://courses.arduino.cc/plugandmake +primary_button_url: https://docs.arduino.cc/tutorials/modulino-latch/how-latch/ +primary_button_title: Get Started +secondary_button_url: https://docs.arduino.cc/tutorials/modulino-thermo/how-general/ +secondary_button_title: More on Modulino Nodes +forumCategorySlug: '/hardware/accessories/modulino-latch/?!?!' +sku: [ABX00138] +--- + +A bistable latching relay that maintains its state without continuous power, ideal for DC power control and automation. Switch high-current loads up to 30V DC with easy I2C control. Compatible with Arduino UNO R4 WiFi or any Qwiic-enabled board. Control motors, pumps, or lighting systems without complex wiring. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/tech-specs.md b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tech-specs.md new file mode 100644 index 0000000000..168e54b9ca --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tech-specs.md @@ -0,0 +1 @@ +Here you will find the technical specifications for the Modulino® Latch Relay. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/tech-specs.yml b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tech-specs.yml new file mode 100644 index 0000000000..5b8753c13a --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tech-specs.yml @@ -0,0 +1,11 @@ +Node: + Name: Modulino Latch Relay + SKU: ABX00138 + Board recommended: Arduino® UNO R4 WiFi (ABX00087) and Arduino® UNO Q (ABX00162) + Communications: I2C (over Qwiic connector or solderable pin) + Operational voltage: 3.3V + Sensor: + Bistable Latch Relay (HFE60/3-1HT-L2) with STM32C011F4: 0x2A (address can change via software) + +Other accessories: + Qwiic cables: 1x diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/assets/RelayOverview.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/assets/RelayOverview.png new file mode 100644 index 0000000000..925e7fd015 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/assets/RelayOverview.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/assets/RelayPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/assets/RelayPinouts.png new file mode 100644 index 0000000000..7b93ddaaff Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/assets/RelayPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/how-latch.md b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/how-latch.md new file mode 100644 index 0000000000..b93bf671c4 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-latch/tutorials/how-latch/how-latch.md @@ -0,0 +1,376 @@ +--- +title: "Getting Started with Modulino Relay" +description: "Complete guide for the Modulino Relay switching module and programming with Arduino and MicroPython." +tags: + - Modulino + - Relay + - Switch + - Control + - QWIIC + - I2C +author: 'Pedro Sousa Lima' +hardware: + - hardware/11.modulinos/modulinos/modulino-relay +software: + - ide-v2 + - web-editor + - micropython +--- + +![Relay Overview](assets/RelayOverview.png) + +The Modulino Relay is a modular latching relay that can switch DC electrical loads, making it perfect to add power control to your projects! It uses the standardised Modulino form factor with QWIIC connectors for easy integration. + +**IMPORTANT SAFETY NOTE: This board is NOT SAFE for 250VAC switching and must only be used for DC loads (maximum 30V DC) due to exposed metal contacts.** + +## Hardware Overview + +### General Characteristics + +The Modulino Relay features a bistable latching relay capable of switching DC loads up to 2 A at 30 VDC. + +| Parameter | Condition | Minimum | Typical | Maximum | Unit | +|---------------|-----------|---------|---------|---------|------| +| Voltage (DC) | - | - | - | 30 | VDC | +| Current (DC) | - | - | - | 2 | A | + +### Sensor Details + +The **Modulino Relay** module uses a latching relay, which does not have native I²C capabilities. Instead, the relay is controlled by the Modulino's onboard microcontroller (STM32C011F4), which manages the relay coil switching and provides I²C communication. + +A latching relay maintains its state without continuous power, making it energy-efficient for applications where the relay state changes infrequently. + +One unique feature of this setup is the ability to change the I²C address via software, making it adaptable to different system configurations. + +The default I²C address for the **Modulino Relay** module is: + +| Modulino I²C Address | Hardware I²C Address | Editable Addresses (HEX) | +|----------------------|----------------------|--------------------------------------------------| +| 0x2A | 0x15 | Any custom address (via software configuration) | + +### Pinout + +![Modulino Relay Pinout](assets/RelayPinouts.png) + +**1×10 Header** + +| **Pin** | **Function** | +|---------|--------------| +| PA0 | SET Coil Control | +| PA1 | RESET Coil Control | +| GND | Ground | +| 3V3 | 3.3 V Power | +| PF2 | RESET | +| SDA | I2C Data | +| SCL | I2C Clock | +| SWCLK | SWD Clock | +| SWDIO | SWD Data | +| PA4 | Additional GPIO | + +**Note:** +- Never set both PA0 and PA1 HIGH simultaneously as this creates an undefined state. +- LED indicators: PA3 (SET yellow LED), PA2 (RESET red LED). + +#### Relay Contacts + +The relay provides normally open (NO) and normally closed (NC) contacts for switching loads: + +- **Common (COM)**: Connect to your power source +- **NO (Normally Open)**: Closes when relay is activated +- **NC (Normally Closed)**: Opens when relay is activated + +### Power Specifications + +| Parameter | Condition | Typical | Unit | +|---------------------|-----------|---------|------| +| Operating Voltage | - | 3.3 | V | +| Current Consumption | - | ~3.4 | mA | +| Coil Current | Switching | Brief | mA | + +The module includes a power LED that draws 1 mA and turns on as soon as it is powered. + +***Important Safety Notice:*** This relay must ONLY be used for DC loads up to 30V DC. Never use this module for AC switching or mains voltage applications due to exposed metal contacts which create a safety hazard. + +### Schematic + +The Modulino Relay features a latching relay design for efficient power control. + +The main components are the latching relay and the **STM32C011F4** microcontroller (U1), which controls the relay coils and handles I²C communication. + +You can connect to the I²C pins (SDA and SCL) using either the **QWIIC connectors** (J1 and J2, this is the recommended method) or the **solderable pins** (J4). The board runs on **3.3V**, which comes from the QWIIC cable or the **3V3 pin** on J4. + +There's also a small power LED indicator that lights up when the board is on. + +You can grab the full schematic and PCB files from the [Modulino Relay page](https://docs.arduino.cc/hardware/modulinos/modulino-relay). + +## Programming with Arduino + +The Modulino Relay is fully compatible with the Arduino IDE and the official Modulino library. The following examples showcase how to control loads and create automated switching systems. + +### Prerequisites + +- Install the Modulino library via the Arduino IDE Library Manager +- Connect your Modulino Relay via QWIIC or solderable headers + +For detailed instructions on setting up your Arduino environment and installing libraries, please refer to the [Getting Started with Modulino Nodes guide](../how-general). + +Library repository available [here](https://github.com/arduino-libraries/Arduino_Modulino). + +### Basic Example + +```arduino +#include + +ModulinoRelay relay; + +void setup() { + Serial.begin(9600); + Modulino.begin(); + relay.begin(); + + Serial.println("Relay Control Started"); +} + +void loop() { + // Turn relay on + Serial.println("Relay ON"); + relay.on(); + delay(2000); + + // Turn relay off + Serial.println("Relay OFF"); + relay.off(); + delay(2000); +} +``` + +### Key Functions + +- `on()`: Activates the relay (closes NO contacts, opens NC contacts) +- `off()`: Deactivates the relay (opens NO contacts, closes NC contacts) +- `update()`: Updates relay state, returns `true` if state changed +- `getStatus()`: Returns current relay state (`true` = on, `false` = off) + +### Advanced Example - Timed Control + +```arduino +#include + +ModulinoRelay relay; + +// Timing configuration +const unsigned long ON_DURATION = 5000; // 5 seconds on +const unsigned long OFF_DURATION = 10000; // 10 seconds off + +// State tracking +unsigned long lastChangeTime = 0; +bool relayState = false; + +void setup() { + Serial.begin(9600); + Modulino.begin(); + relay.begin(); + + Serial.println("Timed Relay Control System"); + Serial.println("ON: 5 seconds, OFF: 10 seconds"); + + // Start with relay off + relay.off(); + lastChangeTime = millis(); +} + +void loop() { + unsigned long currentTime = millis(); + unsigned long elapsed = currentTime - lastChangeTime; + + // Check if it's time to change state + if (relayState) { + // Relay is ON, check if on-duration has elapsed + if (elapsed >= ON_DURATION) { + relay.off(); + relayState = false; + lastChangeTime = currentTime; + + Serial.println("=== Relay switched OFF ==="); + Serial.print("Next cycle in: "); + Serial.print(OFF_DURATION / 1000); + Serial.println(" seconds"); + } + } else { + // Relay is OFF, check if off-duration has elapsed + if (elapsed >= OFF_DURATION) { + relay.on(); + relayState = true; + lastChangeTime = currentTime; + + Serial.println("=== Relay switched ON ==="); + Serial.print("Active for: "); + Serial.print(ON_DURATION / 1000); + Serial.println(" seconds"); + } + } + + // Display status every second + static unsigned long lastStatusTime = 0; + if (currentTime - lastStatusTime >= 1000) { + lastStatusTime = currentTime; + + Serial.print("Status: "); + Serial.print(relayState ? "ON " : "OFF"); + Serial.print(" | Time remaining: "); + + if (relayState) { + Serial.print((ON_DURATION - elapsed) / 1000); + } else { + Serial.print((OFF_DURATION - elapsed) / 1000); + } + Serial.println(" s"); + } + + delay(100); +} +``` + +## Programming with MicroPython + +The Modulino Relay is fully compatible with MicroPython through the official Modulino MicroPython library. The following examples demonstrate how to control loads and create automated systems in your MicroPython projects. + +### Prerequisites + +- Install the Modulino MicroPython library (see [Getting Started with Modulino Nodes](./how-general) for detailed instructions) +- Ensure Arduino Lab for MicroPython is installed + +### Basic Example + +```python +from modulino import ModulinoRelay +from time import sleep + +relay = ModulinoRelay() + +while True: + # Turn relay on + print("Relay ON") + relay.on() + sleep(2) + + # Turn relay off + print("Relay OFF") + relay.off() + sleep(2) +``` + +### Key Methods + +- `.on()`: Activates the relay +- `.off()`: Deactivates the relay +- `.status`: Returns current relay state (True = on, False = off) + +### Advanced Example - Automated Controller + +```python +from modulino import ModulinoRelay +from time import sleep, ticks_ms + +relay = ModulinoRelay() + +# Timing configuration (in milliseconds) +ON_DURATION = 5000 # 5 seconds +OFF_DURATION = 10000 # 10 seconds + +# State tracking +last_change_time = ticks_ms() +relay_state = False + +print("🔌 Timed Relay Control System") +print("ON: 5 seconds, OFF: 10 seconds") + +# Start with relay off +relay.off() + +while True: + current_time = ticks_ms() + elapsed = current_time - last_change_time + + # Check if it's time to change state + if relay_state: + # Relay is ON + if elapsed >= ON_DURATION: + relay.off() + relay_state = False + last_change_time = current_time + print("\n=== Relay switched OFF ===") + print(f"Next cycle in: {OFF_DURATION / 1000:.0f} seconds") + else: + # Relay is OFF + if elapsed >= OFF_DURATION: + relay.on() + relay_state = True + last_change_time = current_time + print("\n=== Relay switched ON ===") + print(f"Active for: {ON_DURATION / 1000:.0f} seconds") + + # Display status + status_text = "ON " if relay_state else "OFF" + if relay_state: + remaining = (ON_DURATION - elapsed) / 1000 + else: + remaining = (OFF_DURATION - elapsed) / 1000 + + print(f"Status: {status_text} | Time remaining: {remaining:.0f} s", end='\r') + + sleep(1) +``` + +## Troubleshooting + +### Sensor Not Reachable + +If your Modulino's power LED isn't on or the sensor isn't responsive: +- Ensure both the board and the Modulino are connected to your computer +- Verify that the power LEDs on both are lit +- Check that the QWIIC cable is properly clicked into place + +### Relay Not Switching + +If the relay doesn't switch: +- Verify that the relay coils are receiving proper signals +- Check that your load doesn't exceed the relay's ratings +- Ensure proper wiring of NO/NC/COM contacts + +### Load Not Operating + +If your connected load doesn't operate: +- Verify correct wiring (check NO vs NC connections) +- Ensure load voltage and current are within relay specifications +- Test relay operation with a multimeter in continuity mode + +### Library Issues + +See the [Getting Started with Modulino nodes](./how-general) guide for library installation troubleshooting. + +## Project Ideas + +Now that you've learned how to use your Modulino Relay, try these projects: + +- **Smart Light Switch**: Control room lighting automatically +- **Irrigation System**: Schedule watering times for gardens +- **Appliance Controller**: Turn coffee makers or heaters on/off remotely +- **Security System**: Control door locks or alarm sirens +- **Temperature Controller**: Switch heating/cooling based on sensor readings +- **Timer Switch**: Create countdown timers for equipment +- **Energy Monitor**: Log when devices are powered on/off +- **Automated Greenhouse**: Control fans, lights, and pumps + +## Safety Warnings + +⚠️ **Important Safety Information:** + +- Never exceed the relay's voltage and current ratings +- Always disconnect power before wiring +- Use appropriate wire gauge for your current requirements +- Provide proper isolation for high-voltage applications +- Consider using a fuse for overcurrent protection +- Never use for mains voltage or AC applications - DC only (max 30V DC) +- Follow all local electrical codes and regulations +- Ensure proper ventilation if switching high-power loads diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/compatibility.yml b/content/hardware/11.modulino/modulino-nodes/modulino-light/compatibility.yml new file mode 100644 index 0000000000..f0008fc25d --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/compatibility.yml @@ -0,0 +1,17 @@ +software: + - arduino-ide + - arduino-cli + - web-editor +hardware: + boards: + - nano-33-iot + - nano-33-ble + - nano-33-ble-sense + - nano-rp2040-connect + - nano-esp32 + - nano-matter + - uno-r4-wifi + - uno-q + shields: ~ + carriers: + - nano-connector-carrier diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/GenMech.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/GenMech.png new file mode 100644 index 0000000000..809a8d6213 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/GenMech.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/LightMec.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/LightMec.png new file mode 100644 index 0000000000..c291fe94da Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/LightMec.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/LightPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/LightPinouts.png new file mode 100644 index 0000000000..766c333c3d Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/LightPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/Modulino_Light_Block_Diagram.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/Modulino_Light_Block_Diagram.png new file mode 100644 index 0000000000..7fad7289a4 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/Modulino_Light_Block_Diagram.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/Modulino_Light_Power_Tree.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/Modulino_Light_Power_Tree.png new file mode 100644 index 0000000000..505c1af9d8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/Modulino_Light_Power_Tree.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/featured.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/featured.png new file mode 100644 index 0000000000..7fb3df7015 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/assets/featured.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/datasheet.md b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/datasheet.md new file mode 100644 index 0000000000..1086eb59d9 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/datasheet/datasheet.md @@ -0,0 +1,218 @@ +--- +identifier: ABX00111 +title: Arduino® Modulino® Light +type: maker +author: Pedro Sousa Lima +--- + +![](assets/featured.png) + +# Description + +The Arduino Modulino® Light features the LTR-381RGB-01 ambient light, RGB, and infrared sensor, providing comprehensive optical sensing capabilities in a compact form factor. This sensor enables colour recognition, ambient light measurement, and infrared detection for a wide range of interactive and automation applications. + +# Target Areas + +Maker, beginner, education + +# Contents +## Application Examples + +- **Colour Recognition** + Detect and identify colours in objects, liquids, or environments for sorting systems, art projects, or interactive installations. + +- **Ambient Light Control** + Automatically adjust LED brightness, screen intensity, or activate lighting systems based on surrounding light conditions for smart home applications. + +- **Infrared Detection** + Monitor infrared radiation for proximity sensing, temperature indication, or remote control applications in various IoT projects. + +
+ +## Features +- **LTR-381RGB-01 sensor** providing ambient light, RGB colour, and infrared measurements. +- **High-precision colour detection** with separate red, green, and blue channels for accurate colour identification. +- **Ambient light sensing** with wide dynamic range for automatic lighting control. +- **Infrared detection** for proximity and thermal sensing applications. +- **I2C (Qwiic)** interface for solder-free integration; operates at **3.3V**. + +### Contents +| **SKU** | **Name** | **Purpose** | **Quantity** | +| ---------- | ------------------- | --------------------------------------------- | ------------ | +| ABX00111 | Modulino® Light | Ambient light, RGB and infrared sensor | 1 | +| | I2C Qwiic cable | Compatible with the Qwiic standard | 1 | + +## Related Products +- *SKU: ASX00027* - [Arduino® Sensor Kit](https://store.arduino.cc/products/arduino-sensor-kit) +- *SKU: K000007* - [Arduino® Starter Kit](https://store.arduino.cc/products/arduino-starter-kit-multi-language) +- *SKU: AKX00026* - [Arduino® Oplà IoT Kit](https://store.arduino.cc/products/opla-iot-kit) +- *SKU: AKX00069* - [Arduino® Plug and Make Kit](https://store.arduino.cc/products/plug-and-make-kit) + +## Rating + +### Recommended Operating Conditions +- **Powered at 3.3 V** through the Qwiic interface (in accordance with the Qwiic standard) +- **Operating temperature:** -30 °C to +70 °C + +**Typical current consumption:** +- ~200 µA active measurement + + +## Power Tree +The power tree for the Modulino® Light can be consulted below: + +![Modulino® Light Power Tree](assets/Modulino_Light_Power_Tree.png) + +## Block Diagram +This node is designed to be placed on an I2C bus, allowing the on-board LTR-381RGB-01 sensor to communicate with a host microcontroller via I2C. + +![Modulino® Light block diagram](assets/Modulino_Light_Block_Diagram.png) + +## Functional Overview +The Modulino® Light uses the LTR-381RGB-01 sensor to measure ambient light levels, detect RGB colour components, and sense infrared radiation. The sensor communicates via I2C (through the Qwiic connector at 3.3V) and provides an interrupt output for event-driven applications. The sensor can distinguish between different light sources and accurately measure colour characteristics. + +### Technical Specifications +| **Specification** | **Details** | +| ----------------------- | ------------------------------------------------ | +| **Sensor** | LTR-381RGB-01 | +| **Supply Voltage** | Rec:3.3 V | +| **Power Consumption** | ~200 µA active | +| **Ambient Light Range** | 0.01 lux to 120,000 lux | +| **Spectral Response** | Red: 600-700 nm, Green: 500-600 nm, Blue: 400-500 nm | +| **Resolution** | 20-bit ADC | +| **Communication** | I2C | + +### Pinout + +**Qwiic / I2C (1×4 Header)** +| **Pin** | **Function** | +| ------- | ----------------------- | +| GND | Ground | +| 3.3 V | Power Supply (3.3 V) | +| SDA | I2C Data | +| SCL | I2C Clock | + +These pads and the Qwiic connectors share the same I2C bus. You can optionally solder header pins here. + +**Additional 1×4 Header (LTR-381RGB-01 Signals)** +| **Pin** | **Function** | +| ------- | ------------------------------------ | +| GND | Ground | +| GND | Ground | +| 3V3 | 3.3 V Power | +| INT | Interrupt Output | + +**Note:** INT pin features a 10 kΩ pull-up resistor to 3.3 V and provides interrupt signalling for threshold detection and data ready events. + +![Pinout Overview](assets/LightPinouts.png) + +### Power Specifications +- **Nominal operating voltage:** 3.3 V via Qwiic + +### Mechanical Information +### Mechanical Information + +![Modulino® Light Mechanical Information](assets/LightMec.png) + +- Board dimensions: 41 mm × 25.36 mm +- Thickness: 1.6 mm (±0.2 mm) +- Four mounting holes (⌀ 3.2 mm) + - Hole spacing: 16 mm vertically, 32 mm horizontally + +![Modulino® Node Shape](assets/GenMech.png) + +### I2C Address Reference +| **Board Silk Name** | **Sensor** | **Modulino® I2C Address (HEX)** | **Editable Addresses (HEX)** | **Hardware I2C Address (HEX)** | +|---------------------|------------------|--------------------------------|-------------------------------------------|--------------------------------| +| MODULINO LIGHT | LTR-381RGB-01 | 0x53 | Fixed hardware address | 0x53 | + +**Note:** The default and only address is **0x53**. This sensor has a fixed I2C address that cannot be changed. + +## Device Operation +The Modulino® Light operates as an I2C target device on the Qwiic bus. A host microcontroller can read ambient light values, RGB colour components, and infrared levels. The INT pin can be configured to trigger interrupts when measurements exceed programmed thresholds. + +### Getting Started +Use any standard Arduino or microcontroller environment at 3.3 V. The Arduino_LTR381RGB library provides comprehensive functions for colour detection, ambient light measurement, and infrared sensing. The sensor should be positioned to face the light source or object being measured, with the sensing area unobstructed. + +# Certifications + +## Certifications Summary + +| **Certification** | **Status** | +|:-----------------:|:----------:| +| CE/RED (Europe) | Yes | +| UKCA (UK) | Yes | +| FCC (USA) | Yes | +| IC (Canada) | Yes | +| RoHS | Yes | +| REACH | Yes | +| WEEE | Yes | + +## Declaration of Conformity CE DoC (EU) + +

We declare under our sole responsibility that the products above are in conformity with the essential requirements of the following EU Directives and therefore qualify for free movement within markets comprising the European Union (EU) and European Economic Area (EEA).

+ +## Declaration of Conformity to EU RoHS & REACH 211 01/19/2021 + +

Arduino boards are in compliance with RoHS 2 Directive 2011/65/EU of the European Parliament and RoHS 3 Directive 2015/863/EU of the Council of 4 June 2015 on the restriction of the use of certain hazardous substances in electrical and electronic equipment.

+ +| Substance | **Maximum limit (ppm)** | +|----------------------------------------|-------------------------| +| Lead (Pb) | 1000 | +| Cadmium (Cd) | 100 | +| Mercury (Hg) | 1000 | +| Hexavalent Chromium (Cr6+) | 1000 | +| Poly Brominated Biphenyls (PBB) | 1000 | +| Poly Brominated Diphenyl ethers (PBDE) | 1000 | +| Bis(2-Ethylhexyl) phthalate (DEHP) | 1000 | +| Benzyl butyl phthalate (BBP) | 1000 | +| Dibutyl phthalate (DBP) | 1000 | +| Diisobutyl phthalate (DIBP) | 1000 | + +Exemptions: No exemptions are claimed. + +

Arduino Boards are fully compliant with the related requirements of European Union Regulation (EC) 1907 /2006 concerning the Registration, Evaluation, Authorization and Restriction of Chemicals (REACH). We declare none of the SVHCs (https://echa.europa.eu/web/guest/candidate-list-table), the Candidate List of Substances of Very High Concern for authorization currently released by ECHA, is present in all products (and also package) in quantities totaling in a concentration equal or above 0.1%. To the best of our knowledge, we also declare that our products do not contain any of the substances listed on the "Authorization List" (Annex XIV of the REACH regulations) and Substances of Very High Concern (SVHC) in any significant amounts as specified by the Annex XVII of Candidate list published by ECHA (European Chemical Agency) 1907 /2006/EC.

+ +## FCC WARNING + +This device complies with part 15 of the FCC Rules. + +Operation is subject to the following two conditions: + +(1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. + +## IC Caution + +This device complies with Industry Canada licence-exempt RSS standard(s). + +Operation is subject to the following two conditions: + +(1) This device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. + +## Conflict Minerals Declaration + +

As a global supplier of electronic and electrical components, Arduino is aware of our obligations with regard to laws and regulations regarding Conflict Minerals, specifically the Dodd-Frank Wall Street Reform and Consumer Protection Act, Section 1502. Arduino does not directly source or process conflict minerals such as Tin, Tantalum, Tungsten, or Gold. Conflict minerals are contained in our products in the form of solder or as a component in metal alloys. As part of our reasonable due diligence, Arduino has contacted component suppliers within our supply chain to verify their continued compliance with the regulations. Based on the information received thus far we declare that our products contain Conflict Minerals sourced from conflict-free areas.

+ +# Company Information + +| Company name | Arduino SRL | +|-----------------|-----------------------------------------------| +| Company Address | Via Andrea Appiani, 25 - 20900 MONZA(Italy) | + +# Reference Documentation + +| Ref | Link | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Arduino IDE (Desktop) | [https://www.arduino.cc/en/software/](https://www.arduino.cc/en/software/) | +| Arduino Courses | [https://www.arduino.cc/education/courses](https://www.arduino.cc/education/courses) | +| Arduino Documentation | [https://docs.arduino.cc/](https://docs.arduino.cc/) | +| Arduino IDE (Cloud) | [https://create.arduino.cc/editor](https://create.arduino.cc/editor) | +| Cloud IDE Getting Started | [https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor](https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor) | +| Project Hub | [https://projecthub.arduino.cc/](https://projecthub.arduino.cc/) | +| Library Reference | [https://github.com/arduino-libraries/](https://github.com/arduino-libraries/) | +| Online Store | [https://store.arduino.cc/](https://store.arduino.cc/) | + +# Revision History +| **Date** | **Revision** | **Changes** | +|------------|--------------|-----------------------------------| +| 14/10/2025 | 1 | First release | \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/essentials.md b/content/hardware/11.modulino/modulino-nodes/modulino-light/essentials.md new file mode 100644 index 0000000000..c61bcb5a56 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/essentials.md @@ -0,0 +1,11 @@ + + + +This library allows you to communicate with the Arduino Modulino® nodes. + + + +This library allows you to communicate with the Arduino Modulino® nodes in MicroPython. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/features.md b/content/hardware/11.modulino/modulino-nodes/modulino-light/features.md new file mode 100644 index 0000000000..b17414adc0 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/features.md @@ -0,0 +1,14 @@ + +The Modulino® Light module features an advanced optical sensor providing ambient light, RGB colour detection, and infrared sensing capabilities. It is designed to be used with any compatible board with Qwiic, allowing you to build smart lighting, colour recognition, and optical sensing projects without making complicated connections. The module also includes example projects for you to learn important programming concepts and get inspired. + + + + + +This module provides high-precision colour detection with separate red, green, and blue channels, plus ambient light and infrared sensing for comprehensive optical measurements. + + +The Modulino® Light module connects to your UNO R4 WiFi with Qwiic cables, letting you focus on learning programming without building complex circuits. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/image.svg b/content/hardware/11.modulino/modulino-nodes/modulino-light/image.svg new file mode 100644 index 0000000000..a72900847d --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/image.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/product.md b/content/hardware/11.modulino/modulino-nodes/modulino-light/product.md new file mode 100644 index 0000000000..b1e5b063b3 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/product.md @@ -0,0 +1,13 @@ +--- +title: Modulino Light +url_shop: https://store.arduino.cc/products/modulino-light +url_guide: https://courses.arduino.cc/plugandmake +primary_button_url: https://docs.arduino.cc/tutorials/modulino-light/how-light/ +primary_button_title: Get Started +secondary_button_url: https://docs.arduino.cc/tutorials/modulino-thermo/how-general/ +secondary_button_title: More on Modulino Nodes +forumCategorySlug: '/hardware/accessories/modulino-light/?!?!' +sku: [ABX00111] +--- + +An advanced optical sensor featuring ambient light, RGB colour detection, and infrared sensing capabilities. Identify colours, measure light levels, or detect infrared radiation for smart lighting, colour sorting, or interactive projects. Compatible with Arduino UNO R4 WiFi or any Qwiic-enabled board, with simple I2C integration for comprehensive optical sensing. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/tech-specs.md b/content/hardware/11.modulino/modulino-nodes/modulino-light/tech-specs.md new file mode 100644 index 0000000000..18be8b3a38 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/tech-specs.md @@ -0,0 +1 @@ +Here you will find the technical specifications for the Modulino® Light. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/tech-specs.yml b/content/hardware/11.modulino/modulino-nodes/modulino-light/tech-specs.yml new file mode 100644 index 0000000000..c0ceb36f48 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/tech-specs.yml @@ -0,0 +1,11 @@ +Node: + Name: Modulino Light + SKU: ABX00111 + Board recommended: Arduino® UNO R4 WiFi (ABX00087) and Arduino® UNO Q (ABX00162) + Communications: I2C (over Qwiic connector or solderable pin) + Operational voltage: 3.3V + Sensor: + Ambient Light, RGB & IR Sensor (LTR-381RGB-01): 0x53 (fixed hardware address) + +Other accessories: + Qwiic cables: 1x diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/assets/LightOverview.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/assets/LightOverview.png new file mode 100644 index 0000000000..7fb3df7015 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/assets/LightOverview.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/assets/LightPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/assets/LightPinouts.png new file mode 100644 index 0000000000..766c333c3d Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/assets/LightPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/how-light.md b/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/how-light.md new file mode 100644 index 0000000000..ffacfac7d1 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-light/tutorials/how-light/how-light.md @@ -0,0 +1,385 @@ +--- +title: "Getting Started with Modulino Light" +description: "Complete guide for the Modulino Light colour sensor module and programming with Arduino and MicroPython." +tags: + - Modulino + - Light Sensor + - Colour Detection + - RGB + - QWIIC + - I2C +author: 'Pedro Sousa Lima' +hardware: + - hardware/11.modulinos/modulinos/modulino-light +software: + - ide-v2 + - web-editor + - micropython +--- + +![Light Overview](assets/LightOverview.png) + +The Modulino Light is a modular colour sensor that measures ambient light, RGB colour components, and infrared levels, making it perfect to add colour detection and light sensing to your projects! It uses the standardised Modulino form factor with QWIIC connectors for easy integration. + +## Hardware Overview + +### General Characteristics + +The Modulino Light is based on the LTR-381RGB-01 sensor, capable of detecting colours and measuring light intensity. + +| Parameter | Condition | Minimum | Typical | Maximum | Unit | +|-------------------|-----------|---------|---------|---------|------| +| Operating Voltage | - | 1.7 | 3.3 | 3.6 | V | +| Light Range | - | 0 | - | 64,000 | lux | + +### Sensor Details + +The **Modulino Light** module uses the **LTR-381RGB-01** colour sensor from Lite-On. This sensor natively supports digital communication (I²C), meaning it connects directly to the I²C bus without requiring additional conversion circuitry. + +The sensor provides measurements for: +- Red, Green, and Blue colour channels +- Ambient light level +- Infrared (IR) level + +The default address for the module is: + +| Modulino I²C Address | Hardware I²C Address | Editable Addresses (HEX) | +|----------------------|----------------------|--------------------------| +| 0x53 | 0x53 | Fixed hardware address | + +***Note: Since the address cannot be changed on this Modulino specifically, using two or more identical modules on the same I²C bus will result in address conflicts and cause communication issues.*** + +### Pinout + +![Modulino Light Pinout](assets/LightPinouts.png) + +**Qwiic / I2C (1×4 Header)** +| **Pin** | **Function** | +| ------- | ----------------------- | +| GND | Ground | +| 3.3 V | Power Supply (3.3 V) | +| SDA | I2C Data | +| SCL | I2C Clock | + +These pads and the Qwiic connectors share the same I2C bus. You can optionally solder header pins here. + +**Additional 1×4 Header (LTR-381RGB-01 Signals)** +| **Pin** | **Function** | +| ------- | ------------------------------------ | +| GND | Ground | +| GND | Ground | +| 3V3 | 3.3 V Power | +| INT | Interrupt Output | + +**Note:** INT pin features a 10 kΩ pull-up resistor to 3.3 V and provides interrupt signalling for threshold detection and data ready events. + +### Power Specifications + +The board is typically powered by +3.3 VDC when using the QWIIC interface as per the I²C standard. + +| Parameter | Condition | Typical | Unit | +|---------------------|-----------|---------|------| +| Operating Voltage | - | 3.3 | V | +| Current Consumption | - | Variable| µA | + +The module includes a power LED that draws 1 mA and turns on as soon as it is powered. + +### Schematic + +The Modulino Light uses a simple circuit built around the **LTR-381RGB-01** sensor (U1), which handles colour detection, ambient light measurement, and I²C communication. + +You can connect to the I²C pins (SDA and SCL) using either the **QWIIC connectors** (J1 and J2, recommended) or the **solderable pins** (J4). The board runs on **3.3V** from the QWIIC cable or the **3V3 pin** on J4. + +Full schematic and PCB files are available from the [Modulino Light page](https://docs.arduino.cc/hardware/modulinos/modulino-light). + +## Programming with Arduino + +The Modulino Light is fully compatible with the Arduino IDE and the official Modulino library. The following examples showcase how to detect colours, measure light intensity, and create colour-based applications. + +### Prerequisites + +- Install the Modulino library via the Arduino IDE Library Manager +- Connect your Modulino Light via QWIIC or solderable headers + +For detailed instructions on setting up your Arduino environment and installing libraries, please refer to the [Getting Started with Modulinos guide](../how-general). + +Library repository available [here](https://github.com/arduino-libraries/Arduino_Modulino). + +### Basic Example + +```arduino +#include + +ModulinoLight light; + +void setup() { + Serial.begin(9600); + Modulino.begin(); + light.begin(); +} + +void loop() { + // Update sensor readings + light.update(); + + // Get colour approximation + String colourName = light.getColorApproximate(); + + // Get RGB values + ModulinoColor colour = light.getColor(); + int r = (0xFF000000 & colour) >> 24; + int g = (0x00FF0000 & colour) >> 16; + int b = (0x0000FF00 & colour) >> 8; + + // Get light intensity values + int lux = light.getAL(); // Ambient light (raw) + int luxCalibrated = light.getLux(); // Calibrated lux + int ir = light.getIR(); // Infrared level + + // Display readings + Serial.print("Colour: "); + Serial.print(colourName); + Serial.print("\tRGB: ("); + Serial.print(r); + Serial.print(", "); + Serial.print(g); + Serial.print(", "); + Serial.print(b); + Serial.print(")\tLux: "); + Serial.print(luxCalibrated); + Serial.print("\tIR: "); + Serial.println(ir); + + delay(500); +} +``` + +### Key Functions + +- `update()`: Updates sensor readings, returns `true` if successful +- `getColor()`: Returns colour as ModulinoColor object (extract RGB with bit shifting) +- `getColorApproximate()`: Returns colour name as String (e.g., "RED", "BLUE", "GREEN") +- `getAL()`: Returns raw ambient light value +- `getLux()`: Returns calibrated lux value +- `getIR()`: Returns infrared level + +### Advanced Example - Colour Sorting + +```arduino +#include + +ModulinoLight light; + +// Colour thresholds for sorting +const int MIN_LUX = 50; // Minimum light level for detection + +void setup() { + Serial.begin(9600); + Modulino.begin(); + light.begin(); + + Serial.println("Colour Sorting System"); + Serial.println("Place coloured objects under sensor"); + Serial.println("-------------------------------------"); +} + +void loop() { + light.update(); + + // Check if there's enough light to detect + int lux = light.getLux(); + if (lux < MIN_LUX) { + Serial.println("Waiting for object..."); + delay(1000); + return; + } + + // Get colour information + String colour = light.getColorApproximate(); + ModulinoColor rgb = light.getColor(); + + int r = (0xFF000000 & rgb) >> 24; + int g = (0x00FF0000 & rgb) >> 16; + int b = (0x0000FF00 & rgb) >> 8; + + // Categorise the colour + String category = categoriseColour(colour); + + // Display results + Serial.println("=== OBJECT DETECTED ==="); + Serial.print("Detected Colour: "); + Serial.println(colour); + Serial.print("RGB Values: ("); + Serial.print(r); + Serial.print(", "); + Serial.print(g); + Serial.print(", "); + Serial.print(b); + Serial.println(")"); + Serial.print("Category: "); + Serial.println(category); + Serial.print("Light Level: "); + Serial.print(lux); + Serial.println(" lux"); + Serial.println(); + + delay(2000); +} + +String categoriseColour(String colour) { + // Convert to uppercase for comparison + colour.toUpperCase(); + + if (colour.indexOf("RED") >= 0 || colour.indexOf("ROSE") >= 0 || + colour.indexOf("ORANGE") >= 0) { + return "WARM COLOURS"; + } else if (colour.indexOf("BLUE") >= 0 || colour.indexOf("CYAN") >= 0 || + colour.indexOf("AZURE") >= 0) { + return "COOL COLOURS"; + } else if (colour.indexOf("GREEN") >= 0 || colour.indexOf("LIME") >= 0) { + return "NATURAL COLOURS"; + } else if (colour.indexOf("PURPLE") >= 0 || colour.indexOf("VIOLET") >= 0 || + colour.indexOf("MAGENTA") >= 0) { + return "PURPLE TONES"; + } else if (colour.indexOf("YELLOW") >= 0) { + return "BRIGHT COLOURS"; + } else if (colour.indexOf("WHITE") >= 0 || colour.indexOf("GRAY") >= 0 || + colour.indexOf("BLACK") >= 0) { + return "NEUTRAL COLOURS"; + } else { + return "UNKNOWN"; + } +} +``` + +## Programming with MicroPython + +The Modulino Light is fully compatible with MicroPython through the official Modulino MicroPython library. The following examples demonstrate how to detect colours and measure light intensity in your MicroPython projects. + +### Prerequisites + +- Install the Modulino MicroPython library (see [Getting Started with Modulinos](./how-general) for detailed instructions) +- Ensure Arduino Lab for MicroPython is installed + +### Basic Example + +```python +from modulino import ModulinoLight +from time import sleep + +light = ModulinoLight() + +while True: + # Get colour name + colour_name = light.colour_name + + # Get RGB values + r, g, b = light.colour + + # Get light intensity + lux = light.lux + ir = light.ir + + if colour_name: + print(f"Colour: {colour_name:20s} RGB: ({r:3d}, {g:3d}, {b:3d}) Lux: {lux:5d} IR: {ir:5d}") + + sleep(0.5) +``` + +### Key Properties + +- `.colour_name`: Returns colour name as string +- `.colour`: Returns tuple of (red, green, blue) values +- `.lux`: Returns calibrated lux value +- `.ir`: Returns infrared level + +### Advanced Example - Colour Detection + +```python +from modulino import ModulinoLight +from time import sleep + +light = ModulinoLight() + +MIN_LUX = 50 + +def categorise_colour(colour_name): + """Categorise colour into groups""" + colour_upper = colour_name.upper() + + if any(x in colour_upper for x in ["RED", "ROSE", "ORANGE"]): + return "WARM COLOURS" + elif any(x in colour_upper for x in ["BLUE", "CYAN", "AZURE"]): + return "COOL COLOURS" + elif any(x in colour_upper for x in ["GREEN", "LIME"]): + return "NATURAL COLOURS" + elif any(x in colour_upper for x in ["PURPLE", "VIOLET", "MAGENTA"]): + return "PURPLE TONES" + elif "YELLOW" in colour_upper: + return "BRIGHT COLOURS" + elif any(x in colour_upper for x in ["WHITE", "GRAY", "BLACK"]): + return "NEUTRAL COLOURS" + else: + return "UNKNOWN" + +print("🎨 Colour Detection System") +print("Place coloured objects under sensor") + +while True: + lux = light.lux + + if lux < MIN_LUX: + print("Waiting for object...") + sleep(1) + continue + + # Get colour information + colour_name = light.colour_name + r, g, b = light.colour + + # Categorise + category = categorise_colour(colour_name) + + # Display results + print("\n=== OBJECT DETECTED ===") + print(f"Detected Colour: {colour_name}") + print(f"RGB Values: ({r}, {g}, {b})") + print(f"Category: {category}") + print(f"Light Level: {lux} lux") + + sleep(2) +``` + +## Troubleshooting + +### Sensor Not Reachable + +If your Modulino's power LED isn't on or the sensor isn't responsive: +- Ensure both the board and the Modulino are connected to your computer +- Verify that the power LEDs on both are lit +- Check that the QWIIC cable is properly clicked into place + +### Inaccurate Colour Detection + +If the colour readings are not accurate: +- Ensure adequate lighting conditions +- Position the sensor facing the object directly +- Avoid mixed lighting sources (e.g., daylight + artificial light) +- Keep the sensor at a consistent distance from objects + +### Library Issues + +See the [Getting Started with Modulinos](./how-general) guide for library installation troubleshooting. + +## Project Ideas + +Now that you've learned how to use your Modulino Light, try these projects: + +- **Colour Sorting Machine**: Automatically sort objects by colour +- **Ambient Light Controller**: Adjust LED brightness based on room lighting +- **Colour Matching Game**: Create interactive colour identification games +- **Paint Colour Identifier**: Help identify paint or material colours +- **Plant Monitor**: Track light levels for optimal plant growth +- **Display Calibration**: Measure screen colour output +- **Art Installation**: Create colour-reactive light displays +- **Quality Control**: Detect colour defects in manufacturing diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/datasheet/datasheet.md b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/datasheet/datasheet.md index f48d49ee98..ef2117914b 100644 --- a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/datasheet/datasheet.md +++ b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/datasheet/datasheet.md @@ -41,9 +41,9 @@ Maker, beginner, education ## Related Products -- **SKU: ASX00027** – [Arduino® Sensor Kit](https://store.arduino.cc/products/arduino-sensor-kit) -- **SKU: K000007** – [Arduino® Starter Kit](https://store.arduino.cc/products/arduino-starter-kit-multi-language) -- **SKU: AKX00026** – [Arduino® Oplà IoT Kit](https://store.arduino.cc/products/opla-iot-kit) +- *SKU: ASX00027* – [Arduino® Sensor Kit](https://store.arduino.cc/products/arduino-sensor-kit) +- *SKU: K000007* – [Arduino® Starter Kit](https://store.arduino.cc/products/arduino-starter-kit-multi-language) +- *SKU: AKX00026* – [Arduino® Oplà IoT Kit](https://store.arduino.cc/products/opla-iot-kit) ## Rating @@ -53,7 +53,7 @@ Maker, beginner, education - **Operating temperature:** –40 °C to +85 °C **Typical current consumption:** -- Up to **33 mA per RGB LED*** at full brightness ** 8 LEDs (264 mA total), plus ~3.4 mA for the microcontroller. Actual usage depends on brightness and color settings. +- Up to **33 mA per RGB LED** at full brightness * 8 LEDs (264 mA total), plus ~3.4 mA for the microcontroller. Actual usage depends on brightness and color settings. ## Power Tree The power tree for the Modulino® node can be consulted below: diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/product.md b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/product.md index c33d8b7d6e..135ad3dc88 100644 --- a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/product.md +++ b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/product.md @@ -2,10 +2,10 @@ title: Modulino Pixels url_shop: https://store.arduino.cc/products/modulino-pixels url_guide: https://courses.arduino.cc/plugandmake -primary_button_url: https://docs.arduino.cc/tutorials/modulino-pixels/how-pixels/ -primary_button_title: Get Started -secondary_button_url: https://docs.arduino.cc/tutorials/modulino-thermo/how-general/ -secondary_button_title: More on Modulino Nodes +primary_button_url: https://docs.arduino.cc/tutorials/modulino-pixels/how-pixels-ardu/ +primary_button_title: With Arduino +secondary_button_url: https://docs.arduino.cc/tutorials/modulino-pixels/how-pixels-mp/ +secondary_button_title: With MicroPython forumCategorySlug: '/hardware/accessories/modulino-pixels/219' sku: [ABX00109] --- diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/IDE-Left-Tab.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/IDE-Left-Tab.png new file mode 100644 index 0000000000..c7bb86575e Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/IDE-Left-Tab.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/Modulino_Pixels_Power_Tree.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/Modulino_Pixels_Power_Tree.png new file mode 100644 index 0000000000..1360acf9f8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/Modulino_Pixels_Power_Tree.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/PixelsPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/PixelsPinouts.png new file mode 100644 index 0000000000..753e749422 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/PixelsPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/addressChangeIDE.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/addressChangeIDE.png new file mode 100644 index 0000000000..d5cd3fd195 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/addressChangeIDE.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/adressChanger.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/adressChanger.png new file mode 100644 index 0000000000..c6eae670c8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/adressChanger.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-jumper.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-jumper.png new file mode 100644 index 0000000000..cdce255db8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-jumper.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-qwiic-chain.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-qwiic-chain.png new file mode 100644 index 0000000000..5899d68721 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-qwiic-chain.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-qwiik.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-qwiik.png new file mode 100644 index 0000000000..3b09f3b752 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels-qwiik.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels.png new file mode 100644 index 0000000000..229410a0c3 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/connection-guide-pixels.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/expansion-guide-pixels.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/expansion-guide-pixels.png new file mode 100644 index 0000000000..427dc10d40 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/expansion-guide-pixels.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/library-install.gif b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/library-install.gif new file mode 100644 index 0000000000..16f396c353 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/library-install.gif differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/pixel-expantion-mc.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/pixel-expantion-mc.png new file mode 100644 index 0000000000..ef177015f8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/pixel-expantion-mc.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/schematic.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/schematic.png new file mode 100644 index 0000000000..8f5504efee Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/assets/schematic.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/content.md b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/content.md new file mode 100644 index 0000000000..5850c78318 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/content.md @@ -0,0 +1,276 @@ +--- +title: "How To Use The Modulino Pixels" +description: "Learn how to get the most out of your Modulino Pixels." +tags: + - Modulino + - QWIIC + - I2C +author: 'Pedro Sousa Lima' +hardware: + - hardware/11.modulinos/modulinos/modulino-pixels +software: + - ide-v2 + - web-editor +--- + +The Modulino Pixels is a modular sensor that generates RGB light effects, making it perfect to add colorful visual feedback to your projects! +The Modulino form factor is shaped with two QWIIC connectors and the I²C protocol integration, allowing the connection and programming of multiple Modulino nodes in a very simple way. In addition to the QWIIC's connectors, the Modulino nodes also expose solderable pins that can be used in multiple ways and make them compatible with boards that are not QWIIC compatible. + + +## Hardware Specifications + +The Modulino Pixels based on 8 LC8822-2020 addressable LEDs is capable of generating colorful light patterns and effects. Take a look at the following table to know more about its characteristics: + +| Parameter | Condition | Minimum | Typical | Maximum | Unit | +|------------------|-------------------|---------|---------|---------|------| +| Supply Voltage | - | 2.0 | 3.3 | 3.6 | V | +| Resolution (ADC) | Default | - | 12-bit | - | mcd | +| Communication | I²C,USART,SPI | - | I²C | - | - | + +## Pinout + +The LC8822-2020 addressable LEDs are the core components of this module. These RGB light output devices are controlled by an onboard STM32C011F4U6TR microcontroller, which supports digital communication (I²C), meaning it connects directly to the I²C bus on the module without requiring additional conversion circuitry. + +![Modulino Pixels Pinout](assets/PixelsPinouts.png) + +### 1x10 Header (LC8822-2020 and Microcontroller Signals) + +| Pin | Function | +|--------|-----------------| +| GND | Ground | +| GND | Ground | +| 3V3 | 3.3V Power | +| RESET | Reset | +| SWCLK | SWD Clock | +| SWDIO | SWD Data | +| TX1 | USART Transmit | +| RX1 | USART Receive | +| D0 | Pixels Data Out | +| C0 | Pixels Clock Out| + +- **GND: Ground**: Provides ground reference for the circuit. Multiple ground pins ensure stable power distribution. +- **3V3: 3.3V Power**: Supplies 3.3V power to connected components and modules. +- **RESET: Reset**: Used to reset the microcontroller or connected system. +- **SWCLK and SWDIO: SWD Interface**: Used for debugging, programming, and reprogramming the microcontroller via Serial Wire Debug protocol. +- **TX1 and RX1: USART Communication**: Enable serial communication for data transmission and reception with other devices or modules. +- **D0: Pixels Data Out**: Sends pixel data to addressable LED strips in a daisy chain configuration for lighting control. +- **C0: Pixels Clock Out**: Provides clock signal synchronization for addressable LED strips, ensuring proper timing for pixel data. + +### 1x4 Header (I2C) + +The pinout for the Modulino Pixels is shown below. While the recommended connection method is via the QWIIC connectors, this solderable header provides a connection option when using the modulino with a non-QWIIC compatible board. + +| Pin | Function | +|-------|--------------| +| GND | Ground | +| 3.3 V | Power Supply | +| SDA | I²C Data | +| SCL | I²C Clock | + +## I2C Address + +The **Modulino Pixels** module uses **LC8822-2020** addressable LEDs, which do not have native I²C capabilities. Instead, the LED array is controlled by the Modulino's onboard microcontroller (STM32C011F4U6TR). This microcontroller provides I²C communication, allowing for flexible control of the LEDs. + +One unique feature of this setup is the ability to change the I²C address via software. This means the address can be modified based on your application needs, making it adaptable to different system configurations. The default I²C address for the **Modulino Pixels** module is: + +| Modulino I²C Address | Hardware I²C Address | Editable Addresses (HEX) | +|----------------------|----------------------|-----------------------------------| +| 0x6C | 0x36 | Any custom address (via software) | + +When scanning for I²C address on the bus, you might find the modulino using the **Hardware I²C Address**. However, you should always use the **Modulino I²C Address** when using the official Modulino library. + +Later in this article we teach how to [change the address](#how-to-change-i2c-address). + +## Power Specifications + +The board is typically powered by +3.3 VDC when using the QWIIC interface as per the I²C standard. + +| Parameter | Condition | Typical | Maximum | Unit | +|------------------------|----------------|---------|---------|------| +| Operating Voltage | - | 3.3 | - | V | +| Power Dissipation | - | - | 350 | mW | +| Standby Current | No data signal | - | 1 | mA | +| Max LED Output Current | Per Channel | 18 | - | mA | + + +The module additionally includes a power LED that draws 1 mA and turns on as soon as it is powered. + +J1 (Qwiic connector), J2 (Qwiic connector), and the headers all share the same power branch. The power distribution of the module is therefore as follows: + +![Power Tree Modulino Pixels](assets/Modulino_Pixels_Power_Tree.png) + +## Schematic + +The Modulino Pixels uses a simple circuit, as shown in the schematic below: + +![Full Schematic Modulino Pixels](assets/schematic.png) + +The main components are the **8 LC8822-2020 addressable LEDs** and the **STM32C011F4U6TR** microcontroller (U1), which handles LED control as well as I²C communication. + +You can connect to the I²C pins (SDA and SCL) using either the **QWIIC connectors** (J1 and J2, this is the recommended method) or the **solderable pins** (J4). The board runs on **3.3V**, which comes from the QWIIC cable or the **3V3 pin** on J4. + +The **LC8822-2020** LEDs are connected in a daisy chain, with the first LED receiving clock and data signals from the microcontroller. The **CO (Clock Out)** and **DO (Data Out)** of the last LED in the chain are accessible via the **1x10 header**, allowing for expansion. ![LED Expantion](assets/expansion-guide-pixels.png) + +These can also be found in small pads near the STM32 microcontroller alongside a few user defines pads that can be used by editing the firmware: + +![Exposed user-defined and LED expansion pads](assets/pixel-expantion-mc.png) + +There's also a small power LED indicator that lights up when the board is on. + +You can grab the full schematic and PCB files from the [Modulino Pixels](https://docs.arduino.cc/hardware/modulinos/modulino-pixels) product page. + +## How To Connect Your Modulino + +The easiest and most reliable way to connect your Modulino is through the QWIIC Connect System. It’s plug-and-play, uses standard I²C, and makes it easy to join multiple modules. If your board supports QWIIC, this is the recommended way to go. +Note that the dedicated I²C pins will differ from board to board meaning it is always a good idea to check your specific model. + + +![Modulino Wiring Options QWIIC(A - recommended) and Header(B)](assets/connection-guide-pixels.png) + +### QWIIC Connector + +Whenever available, the **QWIIC Connect System** is the preferred method. Connecting to the Modulino is extremely simple, just use a standard QWIIC cable to connect your board to either of the QWIIC connectors on the Modulino. Because the cable and connectors are polarized, there is no need to worry about accidentally swapping connections. + +QWIIC is a plug-and-play I²C Connect System that uses standardized 4-pin connectors: + +- GND +- 3.3V +- SDA (Data) +- SCL (Clock) + +![Connection Guide QWIIC](assets/connection-guide-pixels-qwiik.png) + +The Modulino features two QWIIC connectors, which are internally connected in parallel. This means you can daisy-chain multiple modules easily by connecting additional QWIIC cables between them. + +### Solderable Header + +When QWIIC is not available, you can use the exposed solderable pins on the module. You can solder pins to the unpopulated pads; just remember the pinout provided in this guide to connect to the right pins of your board. + +![Connection Guide Solder Pads](assets/connection-guide-pixels-jumper.png) + +## Daisy-Chaining Multiple Modulino Nodes + +Regardless of whether you connect the first Modulino via QWIIC or through the solderable pins, you can still take advantage of the extra QWIIC connector to daisy-chain additional modules. + +Each Modulino includes two QWIIC connectors wired in parallel, allowing you to connect one module to the next in a chain. As long as each module is configured with a unique I²C address, they can all communicate on the same bus. + +This approach keeps your setup clean, modular, and expandable without adding extra wiring complexity. + +![Modulino Wiring Options](assets/connection-guide-pixels-qwiic-chain.png) + +***The number of modules you can connect will depend on what modules you are chaining together, as this system allows for multiple sensors from different manufacturers to be added. Also, the cables you use for these connections will play a significant role in the setup’s performance. Ensure your cables are properly connected and capable of handling the required data transfer. +Each module should have a unique address on a chain if you plan to address them individually. Later in this article we teach how to [change the address](#how-to-change-i2c-address). Multiple modules with the same address will cause conflicts on the I²C bus and will not allow you to address them individually.*** + +## How To Use Your Modulino + +### Installing The Modulino Library + +You need the official Modulino library available [here](https://github.com/arduino-libraries/Modulino) to use the Modulino Thermo. + +With the Arduino IDE you get some tools that make adding a library easier. To learn how to install the IDE please visit our [page](https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing/). + +After opening the IDE, a tab should be visible on the left. Press the book icon for "library" as highlighted in the image. + +![IDE Library Tab](assets/IDE-Left-Tab.png) + +The process should look like this: + +![Library Install](assets/library-install.gif) + +A message will appear after the installation is successful. + +### Set LED Colors + +Controlling RGB LEDs using the **Modulino Pixels** module is straightforward with the `Modulino` library. + +For the **Pixels**, there are two important functions: + +- `set(index, color, brightness)`: Sets a specific LED to a chosen color and brightness level. (`RED`,`BLUE`,`GREEN`,`VIOLET`,`WHITE`) +- `show()`: Applies the changes to the LEDs. +- ```Modulino.begin();```: By default the Modulino library uses ```Wire1``` if your connection is in a different Wire you will have to edit it, check [here](https://docs.arduino.cc/language-reference/en/functions/communication/wire/) (by default the Modulino library uses ```Wire1``` if your board model has a different pinout for the dedicated I²C pins you might have to edit it. More information on **Wire** can be found [here](https://docs.arduino.cc/language-reference/en/functions/communication/wire/)) for the library's hardware compatibility. More information on **Wire** can be found [here](https://docs.arduino.cc/language-reference/en/functions/communication/wire/). + +Here is an example of how to implement these functions to control the LEDs: + +```arduino +#include + +ModulinoPixels leds; + +int brightness = 25; + +void setup(){ + Modulino.begin(); + leds.begin(); +} + +void loop(){ + // Set all LEDs to blue + for (int i = 0; i < 8; i++) { + leds.set(i, BLUE, brightness); + leds.show(); + } +} +``` + +The code example provided demonstrates how to initialize the LED module and set all 8 LEDs to blue with a brightness level of 25%. The for-loop cycles through each LED (indexed 0-7), sets its color and brightness, and then uses the show() function to apply the change. This creates a simple blue light display that can be easily modified to create more complex lighting patterns or visual indicators for your projects. + +### How To Change I²C Address + +An example sketch, AddressChanger, is also included with the library inside the `Utilities` folder and available [here](https://github.com/arduino-libraries/Modulino/blob/main/examples/Utilities/AddressChanger/AddressChanger.ino). This sketch changes the I²C address at a software level on the Module's microcontroller. + +![Example location on the IDE](assets/addressChangeIDE.png) + +- Connect the module to your board, remove any other modules that might be in the chain. Connection must be via I²C. +- Upload the sketch. +- Open the Serial Monitor. +- Text should now appear. Make sure the correct bauld-rate is selected if the displayed characters seem corrupted. + + ![Expected console output](assets/adressChanger.png) + +- Select the address and confirm. +- Your address should now have changed. Make sure to take note of the selected address. + +To keep track of the address in use the module has a white rectangle on the back. Feel free to use this to write the address that was chosen. + +When using a custom address in your sketch, you'll need to specify this address when creating the module object. For example: + +```arduino +ModulinoPixels pixels(0x3E); // Replace 0x3E with your specific address +``` + +## Troubleshooting + +### LEDs Not Lighting + +If your Modulino's power LED isn't on or the RGB LEDs aren't responsive, first check that the board is properly connected: + +- Ensure both the board and the Modulino are connected to your computer, and that the power LEDs on both are lit. +- If the issue persists, make sure the Qwiic cable is properly clicked into place. + +### Library Not Installed Properly + +If you encounter an issue with the `#include "modulino.h"` command, verify that the Modulino library is correctly installed: + +- Check your IDE to ensure the library is installed and up-to-date. +- Re-install the library through the Library Manager. + +### Incorrect Colors or Flickering + +If the LED colors are incorrect or the LEDs are flickering unexpectedly, make sure: + +- The brightness values are within the appropriate range (typically 0-255). +- All exposed electronics are not touching any conductive surfaces, as this could interfere with the LED output. +- The power supply is stable and providing sufficient current for all LEDs at the desired brightness. + +## Conclusion + +The **Modulino Pixels** is a digital RGB LED control module that communicates over I²C and follows the Modulino form factor. It includes standard Qwiic connectors for quick, solderless connections and easy daisy-chaining with other modules. Paired with the Modulino library, it makes generating colorful light effects straightforward, allowing you to focus on experimenting or building your system logic. It's a small, reliable module suited for both visual feedback and creative lighting projects. + +## What Is Next? + +Now that you've learned how to use your Modulino Pixels, you're all set to integrate it into your projects! + +- Create an animated progress bar that visually displays status, or battery charge level using a gradient of colors. +- Build a live sound level indicator that responds to ambient noise. +- Design a pomodoro timer with color coded work and rest periods to boost your productivity. +- Program an interactive game where players must match patterns of colors in the correct sequence, with difficulty increasing as they progress. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/image.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/image.png new file mode 100644 index 0000000000..bceefec75d Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-ardu/image.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/Modulino_Pixels_Power_Tree.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/Modulino_Pixels_Power_Tree.png new file mode 100644 index 0000000000..1360acf9f8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/Modulino_Pixels_Power_Tree.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/PixelsPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/PixelsPinouts.png new file mode 100644 index 0000000000..753e749422 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/PixelsPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-jumper.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-jumper.png new file mode 100644 index 0000000000..6796fa2911 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-jumper.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-qwiic-chain.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-qwiic-chain.png new file mode 100644 index 0000000000..5899d68721 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-qwiic-chain.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-qwiik.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-qwiik.png new file mode 100644 index 0000000000..621425659d Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels-qwiik.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels.png new file mode 100644 index 0000000000..229410a0c3 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/connection-guide-pixels.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/expansion-guide-pixels.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/expansion-guide-pixels.png new file mode 100644 index 0000000000..427dc10d40 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/expansion-guide-pixels.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/mp-usb-connection.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/mp-usb-connection.png new file mode 100644 index 0000000000..fb059f9e8b Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/mp-usb-connection.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/package-installer-overview.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/package-installer-overview.png new file mode 100644 index 0000000000..67678dc808 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/package-installer-overview.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/pixel-expantion-mc.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/pixel-expantion-mc.png new file mode 100644 index 0000000000..ef177015f8 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/pixel-expantion-mc.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/schematic.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/schematic.png new file mode 100644 index 0000000000..8f5504efee Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/assets/schematic.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/content.md b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/content.md new file mode 100644 index 0000000000..2ea4fc2ee4 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/content.md @@ -0,0 +1,332 @@ +--- +title: "How To Use The Modulino Pixels And MicroPython" +description: "Learn how to get the most out of your Modulino Pixels in a MicroPython environment." +tags: + - Modulino + - QWIIC + - I2C +author: 'Pedro Sousa Lima' +hardware: + - hardware/11.modulinos/modulinos/modulino-pixels +software: + - ide-v2 + - web-editor +--- + +The Modulino Pixels is a modular sensor that generates RGB light effects, making it perfect to add colorful visual feedback to your projects! +The Modulino form factor is shaped with two QWIIC connectors and the I²C protocol integration, allowing the connection and programming of multiple Modulino nodes in a very simple way. In addition to the QWIIC's connectors, the Modulino nodes also expose solderable pins that can be used in multiple ways and make them compatible with boards that are not QWIIC compatible. + +## Hardware Specifications + +The Modulino Pixels based on 8 LC8822-2020 addressable LEDs is capable of generating colorful light patterns and effects. Take a look at the following table to know more about its characteristics: + +| Parameter | Condition | Minimum | Typical | Maximum | Unit | +|------------------|-------------------|---------|---------|---------|------| +| Supply Voltage | - | 2.0 | 3.3 | 3.6 | V | +| Resolution (ADC) | Default | - | 12-bit | - | mcd | +| Communication | I²C,USART,SPI | - | I²C | - | - | + +## Pinout + +The LC8822-2020 addressable LEDs are the core components of this module. These RGB light output devices are controlled by an onboard STM32C011F4U6TR microcontroller, which supports digital communication (I²C), meaning it connects directly to the I²C bus on the module without requiring additional conversion circuitry. + +![Modulino Pixels Pinout](assets/PixelsPinouts.png) + +### 1x10 Header (LC8822-2020 and Microcontroller Signals) + +| Pin | Function | +|--------|-----------------| +| GND | Ground | +| GND | Ground | +| 3V3 | 3.3V Power | +| RESET | Reset | +| SWCLK | SWD Clock | +| SWDIO | SWD Data | +| TX1 | USART Transmit | +| RX1 | USART Receive | +| D0 | Pixels Data Out | +| C0 | Pixels Clock Out| + +- **GND: Ground**: Provides ground reference for the circuit. Multiple ground pins ensure stable power distribution. +- **3V3: 3.3V Power**: Supplies 3.3V power to connected components and modules. +- **RESET: Reset**: Used to reset the microcontroller or connected system. +- **SWCLK and SWDIO: SWD Interface**: Used for debugging, programming, and reprogramming the microcontroller via Serial Wire Debug protocol. +- **TX1 and RX1: USART Communication**: Enable serial communication for data transmission and reception with other devices or modules. +- **D0: Pixels Data Out**: Sends pixel data to addressable LED strips in a daisy chain configuration for lighting control. +- **C0: Pixels Clock Out**: Provides clock signal synchronization for addressable LED strips, ensuring proper timing for pixel data. + +### 1x4 Header (I2C) + +The pinout for the Modulino Pixels is shown below. While the recommended connection method is via the QWIIC connectors, this solderable header provides a connection option when using the modulino with a non-QWIIC compatible board. + +| Pin | Function | +|-------|--------------| +| GND | Ground | +| 3.3 V | Power Supply | +| SDA | I²C Data | +| SCL | I²C Clock | + +## I2C Address + +The **Modulino Pixels** module uses **LC8822-2020** addressable LEDs, which do not have native I²C capabilities. Instead, the LED array is controlled by the Modulino's onboard microcontroller (STM32C011F4U6TR). This microcontroller provides I²C communication, allowing for flexible control of the LEDs. + +One unique feature of this setup is the ability to change the I²C address via software. This means the address can be modified based on your application needs, making it adaptable to different system configurations. The default I²C address for the **Modulino Pixels** module is: + +| Modulino I²C Address | Hardware I²C Address | Editable Addresses (HEX) | +|----------------------|----------------------|-----------------------------------| +| 0x6C | 0x36 | Any custom address (via software) | + +When scanning for I²C address on the bus, you might find the modulino using the **Hardware I²C Address**. However, you should always use the **Modulino I²C Address** when using the official Modulino library. + +Later in this article we teach how to [change the address](#how-to-change-i2c-address). + +## Power Specifications + +The board is typically powered by +3.3 VDC when using the QWIIC interface as per the I²C standard. + +| Parameter | Condition | Typical | Maximum | Unit | +|------------------------|----------------|---------|---------|------| +| Operating Voltage | - | 3.3 | - | V | +| Power Dissipation | - | - | 350 | mW | +| Standby Current | No data signal | - | 1 | mA | +| Max LED Output Current | Per Channel | 18 | - | mA | + +The module additionally includes a power LED that draws 1 mA and turns on as soon as it is powered. + +J1 (Qwiic connector), J2 (Qwiic connector), and the headers all share the same power branch. The power distribution of the module is therefore as follows: + +![Power Tree Modulino Pixels](assets/Modulino_Pixels_Power_Tree.png) + +## Schematic + +The Modulino Pixels uses a simple circuit, as shown in the schematic below: + +![Full Schematic Modulino Pixels](assets/schematic.png) + +The main components are the **8 LC8822-2020 addressable LEDs** and the **STM32C011F4U6TR** microcontroller (U1), which handles LED control as well as I²C communication. + +You can connect to the I²C pins (SDA and SCL) using either the **QWIIC connectors** (J1 and J2, this is the recommended method) or the **solderable pins** (J4). The board runs on **3.3V**, which comes from the QWIIC cable or the **3V3 pin** on J4. + +The **LC8822-2020** LEDs are connected in a daisy chain, with the first LED receiving clock and data signals from the microcontroller. The **CO (Clock Out)** and **DO (Data Out)** of the last LED in the chain are accessible via the **1x10 header**, allowing for expansion. + +![LED Expantion](assets/expansion-guide-pixels.png) + +These can also be found in small pads near the STM32 microcontroller alongside a few user defines pads that can be used by editing the firmware: + +![Exposed user-defined and LED expansion pads](assets/pixel-expantion-mc.png) + +There's also a small power LED indicator that lights up when the board is on. + +You can grab the full schematic and PCB files from the [Modulino Pixels](https://docs.arduino.cc/hardware/modulinos/modulino-pixels) product page. + +## How To Connect Your Modulino + +The easiest and most reliable way to connect your Modulino is through the QWIIC Connect System. It’s plug-and-play, uses standard I²C, and makes it easy to join multiple modules. If your board supports QWIIC, this is the recommended way to go. + +Note that the dedicated I²C pins will differ from board to board meaning it is always a good idea to check your specific model. + + +![Modulino Wiring Options QWIIC(A - recommended) and Header(B)](assets/connection-guide-pixels.png) + +### QWIIC Connector + +Whenever available, the **QWIIC Connect System** is the preferred method. Connecting to the Modulino is extremely simple, just use a standard QWIIC cable to connect your board to either of the QWIIC connectors on the Modulino. Because the cable and connectors are polarized, there is no need to worry about accidentally swapping connections. + +QWIIC is a plug-and-play I²C Connect System that uses standardized 4-pin connectors: + +- GND +- 3.3V +- SDA (Data) +- SCL (Clock) + +![Connection Guide QWIIC](assets/connection-guide-pixels-qwiik.png) + +The Modulino features two QWIIC connectors, which are internally connected in parallel. This means you can daisy-chain multiple modules easily by connecting additional QWIIC cables between them. + +### Solderable Header + +When QWIIC is not available, you can use the exposed solderable pins on the module. You can solder pins to the unpopulated pads; just remember the pinout provided in this guide to connect to the right pins of your board. + +![Connection Guide Solder Pads](assets/connection-guide-pixels-jumper.png) + +## Daisy-Chaining Multiple Modulino Nodes + + +Regardless of whether you connect the first Modulino via QWIIC or through the solderable pins, you can still take advantage of the extra QWIIC connector to daisy-chain additional modules. + +Each Modulino includes two QWIIC connectors wired in parallel, allowing you to connect one module to the next in a chain. As long as each module is configured with a unique I²C address, they can all communicate on the same bus. + +This approach keeps your setup clean, modular, and expandable without adding extra wiring complexity. + +![Modulino Wiring Options](assets/connection-guide-pixels-qwiic-chain.png) + +***The number of modules you can connect will depend on what modules you are chaining together, as this system allows for multiple sensors from different manufacturers to be added. Also, the cables you use for these connections will play a significant role in the setup’s performance. Ensure your cables are properly connected and capable of handling the required data transfer. +Each module should have a unique address on a chain if you plan to address them individually. Later in this article we teach how to [change the address](#how-to-change-i2c-address). Multiple modules with the same address will cause conflicts on the I²C bus and will not allow you to address them individually.*** + +Later in this article we teach how to [change the address](#how-to-change-i2c-address). + +## How To Program Your Modulino + +### Installing The Modulino Library + +To program your Modulino it is recommended you use the official ```Modulino``` micropython library available [here](https://github.com/arduino/arduino-modulino-mpy). The library is fully compatible with the no **Arduino Lab for MicroPython**. + +For information on installing the **Arduino Lab for MicroPython** please visit our [page](https://docs.arduino.cc/micropython/first-steps/install-guide/). + + + +The ```Modulino``` library is not available by default on MicroPython devices hence installation is needed. + +To simplify the process the [MicroPython Package Installer](https://github.com/arduino/lab-micropython-package-installer/releases) is recommended as it will provide a graphical interface to guide installation. + +After installation, you should now be able to: + +1. Open the tool. +2. Plug in your board to the computer. + + ![USB Connection](assets/mp-usb-connection.png) + + If the board does not appear in the Detected Boards section, click Reload. If the board is still undetected, ensure no other programs (e.g., a code editor) are using the board's COM port. + +3. Search for the ```Modulino``` package by filling in the text box on the search feature. +4. Click Install and wait for the installation confirmation. +5. Disconnect the board from the tool before returning to your code editor to avoid conflicts due to a busy COM port. + +![Package Installer Overview](assets/package-installer-overview.png) + +The module should now be includable in your program using: + +```from modulino import ModulinoBuzzer``` + +### Control RGB LEDs with MicroPython + +Getting LED data from the **Modulino Pixels** module is simple using the `Modulino` library. The crucial functions to control the LEDs are: + +- `set_rgb(index, r, g, b, brightness)`: Sets a specific LED to an RGB color with the specified brightness. +- `set_all_rgb(r, g, b, brightness)`: Sets all LEDs to an RGB color with the specified brightness. +- `set_all_color(color, brightness)`: Sets all LEDs to a predefined color. (`RED`,`BLUE`,`GREEN`,`VIOLET`,`WHITE`) +- `clear_all()`: Turns off all LEDs. +- `show()`: Sends the updated data to the LEDs. +- By default the Modulino library uses ```Wire1``` if your board model has a different pinout for the dedicated I²C pins you might have to edit it as instructed [here](https://github.com/arduino/arduino-modulino-mpy/tree/main/docs#%E2%84%B9%EF%B8%8F-using-3rd-party-boards). More information on **Wire** can be found [here](https://docs.arduino.cc/language-reference/en/functions/communication/wire/). + +Here’s an example demonstrating how to set colors and create a **Knight Rider animation**: + +```python +from modulino import ModulinoPixels, ModulinoColor +from time import sleep + +pixels = ModulinoPixels() + +# Set each LED to a different color from a color wheel +for index in range(0, 8): + color_wheel_colors = [ + (255, 0, 0), + (255, 85, 0), + (255, 255, 0), + (0, 255, 0), + (0, 255, 255), + (0, 0, 255), + (255, 0, 255), + (255, 0, 0) + ] + pixels.set_rgb(index, *color_wheel_colors[index], 100) +pixels.show() +sleep(1) + +# Set all LEDs to solid colors +pixels.set_all_rgb(255, 0, 0, 100) # Red +pixels.show() +sleep(1) + +pixels.set_all_color(ModulinoColor.GREEN, 100) +pixels.show() +sleep(1) + +pixels.set_all_color(ModulinoColor.BLUE, 100) +pixels.show() +sleep(1) + +# Knight Rider animation +def set_glowing_led(index, r, g, b, brightness): + """ + Set the color of the LED at the given index with its + neighboring LEDs slightly dimmed to create a glowing effect. + """ + pixels.clear_all() + pixels.set_rgb(index, r, g, b, brightness) + + if index > 0: + pixels.set_rgb(index - 1, r, g, b, brightness // 8) # Left LED + if index < 7: + pixels.set_rgb(index + 1, r, g, b, brightness // 8) # Right LED + + pixels.show() + +for j in range(3): + for i in range(8): + set_glowing_led(i, 255, 0, 0, 100) + sleep(0.05) + + for i in range(7, -1, -1): + set_glowing_led(i, 255, 0, 0, 100) + sleep(0.05) + +# Turn off all LEDs +pixels.clear_all().show() +``` + +This example shows different ways to control the Pixels. It starts by creating a rainbow pattern using different colors for each LED. Next, it demonstrates setting all LEDs to the same color, using both RGB values and predefined color constants. The final section implements a Knight Rider animation by lighting one main LED at full brightness while slightly illuminating adjacent LEDs at reduced brightness. The `set_glowing_led()` function handles this effect by managing the primary LED and its neighbors, creating a back-and-forth scanning pattern that repeats three times before turning off all LEDs. + +### How To Change Address + +A sketch is also available included with the library named `AddressChanger` and also available [here](https://github.com/arduino/arduino-modulino-mpy/blob/main/examples/change_address.py). This sketch changes the I2C address at a software level on the Module's microcontroller. + +- Connect the module to your board via I2C, ensuring no other modules are in the chain. +- Run the script in a MicroPython environment. +- Follow the on-screen instructions (REPL) to select the device and enter a new address. Valid I²C addresses range from 0x08 to 0x77 (7-bit values in hexadecimal format, e.g., 0x42). +- The script will attempt to change the address and confirm success. + +To keep track of the address in use, the module has a white rectangle on the back. Feel free to use this to write the address that was chosen. + +When using a custom address in your MicroPython sketch, you'll need to specify this address when creating the module object. For example: + +```python +pixels_module = ModulinoPixels(address=0x45) # Replace 0x45 with your specific address +``` + +## Troubleshooting + +### LEDs Not Lighting + +If your Modulino's power LED isn't on or the RGB LEDs aren't responsive, first check that the board is properly connected: + +- Ensure both the board and the Modulino are connected to your computer, and that the power LEDs on both are lit. +- If the issue persists, make sure the Qwiic cable is properly clicked into place. + +### Library Not Installed Properly + +If you encounter an issue with the `import ModulinoPixels"` command, verify that the Modulino library is correctly installed: + +- Check your IDE to ensure the library is installed and up-to-date. +- Re-install the library through the Library Manager. + +### Incorrect Colors or Flickering + +If the LED colors are incorrect or the LEDs are flickering unexpectedly, make sure: + +- The brightness values are within the appropriate range (typically 0-255). +- All exposed electronics are not touching any conductive surfaces, as this could interfere with the LED output. +- The power supply is stable and providing sufficient current for all LEDs at the desired brightness. + +## Conclusion + +The **Modulino Pixels** is a digital RGB LED control module that communicates over I²C and follows the Modulino form factor. It includes standard Qwiic connectors for quick, solderless connections and easy daisy-chaining with other modules. Paired with the Modulino library, it makes generating colorful light effects straightforward, allowing you to focus on experimenting or building your system logic. It's a small, reliable module suited for both visual feedback and creative lighting projects. + +## What Is Next? + +Now that you've learned how to use your Modulino Pixels, you're all set to integrate it into your projects! + +- Create an animated progress bar that visually displays status, or battery charge level using a gradient of colors. +- Build a live sound level indicator that responds to ambient noise. +- Design a pomodoro timer with color coded work and rest periods to boost your productivity. +- Program an interactive game where players must match patterns of colors in the correct sequence, with difficulty increasing as they progress. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/image.png b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/image.png new file mode 100644 index 0000000000..bceefec75d Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-pixels/tutorials/how-pixels-mp/image.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/compatibility.yml b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/compatibility.yml new file mode 100644 index 0000000000..f0008fc25d --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/compatibility.yml @@ -0,0 +1,17 @@ +software: + - arduino-ide + - arduino-cli + - web-editor +hardware: + boards: + - nano-33-iot + - nano-33-ble + - nano-33-ble-sense + - nano-rp2040-connect + - nano-esp32 + - nano-matter + - uno-r4-wifi + - uno-q + shields: ~ + carriers: + - nano-connector-carrier diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/GenMech.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/GenMech.png new file mode 100644 index 0000000000..809a8d6213 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/GenMech.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/I2CTag.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/I2CTag.png new file mode 100644 index 0000000000..5e290c908a Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/I2CTag.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/Modulino_Vibro_Block_Diagram.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/Modulino_Vibro_Block_Diagram.png new file mode 100644 index 0000000000..d501e73b3f Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/Modulino_Vibro_Block_Diagram.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/Modulino_Vibro_Power_Tree.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/Modulino_Vibro_Power_Tree.png new file mode 100644 index 0000000000..ad31ebc3a3 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/Modulino_Vibro_Power_Tree.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/ResistorsPullupGen.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/ResistorsPullupGen.png new file mode 100644 index 0000000000..7095581413 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/ResistorsPullupGen.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/VibroMec.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/VibroMec.png new file mode 100644 index 0000000000..10f9388699 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/VibroMec.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/VibroPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/VibroPinouts.png new file mode 100644 index 0000000000..62ee93ab74 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/VibroPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/featured.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/featured.png new file mode 100644 index 0000000000..5e189df4b3 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/assets/featured.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/datasheet.md b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/datasheet.md new file mode 100644 index 0000000000..8a8d743722 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/datasheet/datasheet.md @@ -0,0 +1,235 @@ +--- +identifier: ABX00130 +title: Arduino® Modulino® Vibro +type: maker +author: Pedro Sousa Lima +--- + +![](assets/featured.png) + +# Description + +The Arduino Modulino® Vibro, powered by an on-board STM32C011F4 microcontroller, features a compact vibration motor (VZ43FM1B8230001L) for haptic feedback and alert applications. This setup enables simple vibration control via I2C and provides tactile notifications for various interactive projects. + +# Target Areas + +Maker, beginner, education + +# Contents +## Application Examples + +- **Haptic Feedback** + Provide tactile notifications in wearable devices, gaming controllers, or interactive interfaces to enhance user experience. + +- **Alert Systems** + Create vibration-based alerts for notifications, alarms, or status indicators in IoT projects where audio alerts might not be suitable. + +- **Interactive Art** + Integrate tactile feedback into art installations, musical instruments, or sensory experiences to create engaging multi-modal interactions. + +
+ +## Features +- **Compact vibration motor** (VZ43FM1B8230001L) providing strong tactile feedback at 12,000 rpm. +- Integrated **STM32C011F4** microcontroller providing I2C interface by default. +- **N-channel MOSFET** (2N7002KT1G) for efficient motor control.. +- Designed for **3.3V** operation via the Qwiic connector (I2C). +- Ideal for **haptic feedback** and **vibration alerts** in interactive projects. + +### Contents +| **SKU** | **Name** | **Purpose** | **Quantity** | +| ---------- | --------------------- | -------------------------------------- | ------------ | +| ABX00130 | Modulino® Vibro | Vibration motor for haptic feedback | 1 | +| | I2C Qwiic cable | Compatible with the Qwiic standard | 1 | + +## Related Products +- *SKU: ASX00027* - [Arduino® Sensor Kit](https://store.arduino.cc/products/arduino-sensor-kit) +- *SKU: K000007* - [Arduino® Starter Kit](https://store.arduino.cc/products/arduino-starter-kit-multi-language) +- *SKU: AKX00026* - [Arduino® Oplà IoT Kit](https://store.arduino.cc/products/opla-iot-kit) +- *SKU: AKX00069* - [Arduino® Plug and Make Kit](https://store.arduino.cc/products/plug-and-make-kit) + +## Rating + +### Recommended Operating Conditions +- **Powered at 3.3 V** through the Qwiic interface (in accordance with the Qwiic standard) +- **Operating temperature:** -40 °C to +85 °C + +**Typical current consumption:** +- Microcontroller: ~3.4 mA +- Motor active: ~67 mA typical, 85 mA maximum + +## Power Tree +The power tree for the Modulino® Vibro can be consulted below: + +![Modulino® Vibro Power Tree](assets/Modulino_Vibro_Power_Tree.png) + +## Block Diagram +This node includes an STM32C011F4 microcontroller that controls a vibration motor through an N-channel MOSFET. It communicates via I2C by default, but can be reprogrammed via SWD for custom functionality. + +![Modulino® Vibro Block Diagram](assets/Modulino_Vibro_Block_Diagram.png) + +## Functional Overview +The Modulino® Vibro node receives vibration commands via I2C and controls the VZ43FM1B8230001L motor through a 2N7002KT1G N-channel MOSFET. The STM32C011F4 microcontroller manages PWM control for variable intensity vibration patterns. Advanced users can re-flash the microcontroller via SWD for custom vibration sequences or additional logic. + +### Technical Specifications (Module-Specific) +| **Specification** | **Details** | +| ----------------------- | ----------------------------------------------- | +| **Microcontroller** | STM32C011F4 | +| **Motor** | VZ43FM1B8230001L vibration motor | +| **Motor Speed** | 12,000 rpm rated | +| **Supply Voltage** | 3.3 V | +| **Power Consumption** | ~3.4 mA (MCU) + 67 mA typical (motor active) | +| **Motor Current** | 67 mA typical, 85 mA maximum | +| **Communication** | I2C (Qwiic), SWD (reprogramming), UART (option) | + +### Pinout + +**Qwiic / I2C (1×4 Header)** +| **Pin** | **Function** | +|---------|---------------------------| +| GND | Ground | +| 3.3 V | Power Supply (3.3 V) | +| SDA | I2C Data | +| SCL | I2C Clock | + +These pads and the Qwiic connectors share the same I2C bus at 3.3 V. + +**Additional 1×8 Header (Motor & MCU Signals)** +| **Pin** | **Function** | +|---------|----------------| +| GND | Ground | +| 3V3 | 3.3 V Power | +| PF2 | RESET (NRST) | +| SWCLK | SWD Clock (PA14) | +| SWDIO | SWD Data (PA13) | +| TX1 | USART Transmit (PA9) | +| RX1 | USART Receive (PA10) | +| PA2 | Motor Control (MOSFET gate) | + +**Note:** PA0 controls the N-channel MOSFET gate to switch the vibration motor on/off. You can also access additional microcontroller pins (PA1, PA2, PA3, PA5) via test pads for custom applications. + +![Pinout Overview](assets/VibroPinouts.png) + +### Power Specifications +- **Nominal operating voltage:** 3.3 V via Qwiic + +### Mechanical Information + +![Modulino® Vibro Mechanical Information](assets/VibroMec.png) + +- Board dimensions: 41 mm × 25.36 mm +- Thickness: 1.6 mm (±0.2 mm) +- Four mounting holes (⌀ 3.2 mm) + - Hole spacing: 16 mm vertically, 32 mm horizontally +- **Breadboard compatible:** 1×4 header and 1×8 header spaced by 900 mil (22.86 mm) + +![Modulino® Node Shape](assets/GenMech.png) + +### I2C Address Reference +| **Board Silk Name** | **Sensor/Actuator** | **Modulino® I2C Address (HEX)** | **Editable Addresses (HEX)** | **Hardware I2C Address (HEX)** | +|---------------------|-------------------------|--------------------------------|---------------------------------------------|--------------------------------| +| MODULINO VIBRO | Vibration Motor | 0x3A | Any custom address (via software config.) | 0x1D | + + **Note:** + - Default I2C address is **0x3A**. + - A white rectangle on the bottom silk allows users to write a new address after reconfiguration. + + ![Blank silk for identification](assets/I2CTag.png) + +#### Pull-up Resistors + +This module has pads for optional I2C pull-up mounting in both data lines. No resistors are mounted by default but in case the resistors are needed 4.7 K resistors in an SMD 0402 format are recommended. + +These are positioned near the Qwiic connector on the power LED side. +These are positioned near the Qwiic connector on the power LED side. + +![Generic pull-up resistor position](assets/ResistorsPullupGen.png) + +## Device Operation +By default, the board is an I2C target device. It manages motor control through integrated firmware via PWM signals to the MOSFET gate. Simply connect it to a 3.3 V Qwiic interface and send I2C commands for various vibration patterns. If needed, you can reprogram the STM32C011F4 via SWD to modify or extend functionality. + +### Getting Started +Use any standard Arduino workflow-desktop IDE or Arduino Cloud Editor. The official Modulino library provides simple commands for vibration control including intensity and duration settings. Ensure your power supply can handle the additional 67-85 mA current when the motor is active. + +# Certifications + +## Certifications Summary + +| **Certification** | **Status** | +|:-----------------:|:----------:| +| CE/RED (Europe) | Yes | +| UKCA (UK) | Yes | +| FCC (USA) | Yes | +| IC (Canada) | Yes | +| RoHS | Yes | +| REACH | Yes | +| WEEE | Yes | + +## Declaration of Conformity CE DoC (EU) + +

We declare under our sole responsibility that the products above are in conformity with the essential requirements of the following EU Directives and therefore qualify for free movement within markets comprising the European Union (EU) and European Economic Area (EEA).

+ +## Declaration of Conformity to EU RoHS & REACH 211 01/19/2021 + +

Arduino boards are in compliance with RoHS 2 Directive 2011/65/EU of the European Parliament and RoHS 3 Directive 2015/863/EU of the Council of 4 June 2015 on the restriction of the use of certain hazardous substances in electrical and electronic equipment.

+ +| Substance | **Maximum limit (ppm)** | +|----------------------------------------|-------------------------| +| Lead (Pb) | 1000 | +| Cadmium (Cd) | 100 | +| Mercury (Hg) | 1000 | +| Hexavalent Chromium (Cr6+) | 1000 | +| Poly Brominated Biphenyls (PBB) | 1000 | +| Poly Brominated Diphenyl ethers (PBDE) | 1000 | +| Bis(2-Ethylhexyl) phthalate (DEHP) | 1000 | +| Benzyl butyl phthalate (BBP) | 1000 | +| Dibutyl phthalate (DBP) | 1000 | +| Diisobutyl phthalate (DIBP) | 1000 | + +Exemptions: No exemptions are claimed. + +

Arduino Boards are fully compliant with the related requirements of European Union Regulation (EC) 1907 /2006 concerning the Registration, Evaluation, Authorization and Restriction of Chemicals (REACH). We declare none of the SVHCs (https://echa.europa.eu/web/guest/candidate-list-table), the Candidate List of Substances of Very High Concern for authorization currently released by ECHA, is present in all products (and also package) in quantities totaling in a concentration equal or above 0.1%. To the best of our knowledge, we also declare that our products do not contain any of the substances listed on the "Authorization List" (Annex XIV of the REACH regulations) and Substances of Very High Concern (SVHC) in any significant amounts as specified by the Annex XVII of Candidate list published by ECHA (European Chemical Agency) 1907 /2006/EC.

+ +## FCC WARNING + +This device complies with part 15 of the FCC Rules. + +Operation is subject to the following two conditions: + +(1) This device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. + +## IC Caution + +This device complies with Industry Canada licence-exempt RSS standard(s). + +Operation is subject to the following two conditions: + +(1) This device may not cause interference, and (2) this device must accept any interference, including interference that may cause undesired operation of the device. + +## Conflict Minerals Declaration + +

As a global supplier of electronic and electrical components, Arduino is aware of our obligations with regard to laws and regulations regarding Conflict Minerals, specifically the Dodd-Frank Wall Street Reform and Consumer Protection Act, Section 1502. Arduino does not directly source or process conflict minerals such as Tin, Tantalum, Tungsten, or Gold. Conflict minerals are contained in our products in the form of solder or as a component in metal alloys. As part of our reasonable due diligence, Arduino has contacted component suppliers within our supply chain to verify their continued compliance with the regulations. Based on the information received thus far we declare that our products contain Conflict Minerals sourced from conflict-free areas.

+ +# Company Information + +| Company name | Arduino SRL | +|-----------------|-----------------------------------------------| +| Company Address | Via Andrea Appiani, 25 - 20900 MONZA(Italy) | + +# Reference Documentation + +| Ref | Link | +| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Arduino IDE (Desktop) | [https://www.arduino.cc/en/software/](https://www.arduino.cc/en/software/) | +| Arduino Courses | [https://www.arduino.cc/education/courses](https://www.arduino.cc/education/courses) | +| Arduino Documentation | [https://docs.arduino.cc/](https://docs.arduino.cc/) | +| Arduino IDE (Cloud) | [https://create.arduino.cc/editor](https://create.arduino.cc/editor) | +| Cloud IDE Getting Started | [https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor](https://docs.arduino.cc/cloud/web-editor/tutorials/getting-started/getting-started-web-editor) | +| Project Hub | [https://projecthub.arduino.cc/](https://projecthub.arduino.cc/) | +| Library Reference | [https://github.com/arduino-libraries/](https://github.com/arduino-libraries/) | +| Online Store | [https://store.arduino.cc/](https://store.arduino.cc/) | + +# Revision History +| **Date** | **Revision** | **Changes** | +|------------|--------------|-----------------------------------| +| 14/10/2025 | 1 | First release | \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/essentials.md b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/essentials.md new file mode 100644 index 0000000000..c61bcb5a56 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/essentials.md @@ -0,0 +1,11 @@ + + + +This library allows you to communicate with the Arduino Modulino® nodes. + + + +This library allows you to communicate with the Arduino Modulino® nodes in MicroPython. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/features.md b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/features.md new file mode 100644 index 0000000000..7aeeb44dd6 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/features.md @@ -0,0 +1,14 @@ + +The Modulino® Vibro module features a compact vibration motor for adding haptic feedback and tactile alerts to your projects. It is designed to be used with any compatible board with Qwiic, allowing you to build wearables, gaming controllers, and notification systems without making complicated connections. The module also includes example projects for you to learn important programming concepts and get inspired. + + + + + +This module provides strong tactile feedback at 12,000 rpm with variable intensity control via PWM, perfect for wearable devices and interactive interfaces. + + +The Modulino® Vibro module connects to your UNO R4 WiFi with Qwiic cables, letting you focus on learning programming without building complex circuits. + + + diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/image.svg b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/image.svg new file mode 100644 index 0000000000..9098324955 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/image.svg @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/product.md b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/product.md new file mode 100644 index 0000000000..83569aba29 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/product.md @@ -0,0 +1,13 @@ +--- +title: Modulino Vibro +url_shop: https://store.arduino.cc/products/modulino-vibro +url_guide: https://courses.arduino.cc/plugandmake +primary_button_url: https://docs.arduino.cc/tutorials/modulino-vibro/how-vibro/ +primary_button_title: Get Started +secondary_button_url: https://docs.arduino.cc/tutorials/modulino-thermo/how-general/ +secondary_button_title: More on Modulino Nodes +forumCategorySlug: '/hardware/accessories/modulino-vibro/?!?!' +sku: [ABX00130] +--- + +A compact vibration motor module for adding haptic feedback and tactile alerts to your projects. Perfect for wearable devices, gaming controllers, notification systems, or interactive art installations. Compatible with Arduino UNO R4 WiFi or any Qwiic-enabled board, with simple I2C control for variable intensity vibration patterns. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tech-specs.md b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tech-specs.md new file mode 100644 index 0000000000..89d1453f79 --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tech-specs.md @@ -0,0 +1 @@ +Here you will find the technical specifications for the Modulino® Vibro. diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tech-specs.yml b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tech-specs.yml new file mode 100644 index 0000000000..8e75e6f31b --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tech-specs.yml @@ -0,0 +1,11 @@ +Node: + Name: Modulino Vibro + SKU: ABX00130 + Board recommended: Arduino® UNO R4 WiFi (ABX00087) and Arduino® UNO Q (ABX00162) + Communications: I2C (over Qwiic connector or solderable pin) + Operational voltage: 3.3V + Sensor: + Vibration Motor (VZ43FM1B8230001L) with STM32C011F4: 0x3A (address can change via software) + +Other accessories: + Qwiic cables: 1x diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/assets/VibraOverview.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/assets/VibraOverview.png new file mode 100644 index 0000000000..5e189df4b3 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/assets/VibraOverview.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/assets/VibroPinouts.png b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/assets/VibroPinouts.png new file mode 100644 index 0000000000..62ee93ab74 Binary files /dev/null and b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/assets/VibroPinouts.png differ diff --git a/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/how-vibro.md b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/how-vibro.md new file mode 100644 index 0000000000..d8caffbe3e --- /dev/null +++ b/content/hardware/11.modulino/modulino-nodes/modulino-vibro/tutorials/how-vibro/how-vibro.md @@ -0,0 +1,298 @@ +--- +title: "Getting Started with Modulino Vibra" +description: "Complete guide for the Modulino Vibra haptic feedback module and programming with Arduino and MicroPython." +tags: + - Modulino + - Vibration + - Haptic + - Feedback + - QWIIC + - I2C +author: 'Pedro Sousa Lima' +hardware: + - hardware/11.modulinos/modulinos/modulino-vibra +software: + - ide-v2 + - web-editor + - micropython +--- + +![Vibra Overview](assets/VibraOverview.png) + +The Modulino Vibra is a modular haptic feedback device that provides tactile notifications through vibration, making it perfect to add physical feedback to your projects! It uses the standardised Modulino form factor with QWIIC connectors for easy integration. + +## Hardware Overview + +### General Characteristics + +The Modulino Vibra is based on the VZ43FM1B8230001L vibration motor, capable of generating different vibration patterns for haptic feedback. + +| Parameter | Condition | Minimum | Typical | Maximum | Unit | +|------------|-----------|---------|---------|---------|------| +| Speed | - | - | 12,000 | - | rpm | +| Voltage | Motor | 2.3 | 3.3 | 3.6 | V | +| Current | Motor | - | 67 | 85 | mA | + +### Sensor Details + +The **Modulino Vibra** module uses the **VZ43FM1B8230001L** vibration motor, which does not have native I²C capabilities. Instead, the motor is controlled by the Modulino's onboard microcontroller (STM32C011F4), which drives the motor through an N-channel MOSFET. This microcontroller provides I²C communication, allowing for flexible control of vibration intensity and duration. + +One unique feature of this setup is the ability to change the I²C address via software, making it adaptable to different system configurations. + +The default I²C address for the **Modulino Vibra** module is: + +| Modulino I²C Address | Hardware I²C Address | Editable Addresses (HEX) | +|----------------------|----------------------|--------------------------------------------------| +| 0x3A | 0x1D | Any custom address (via software configuration) | + +### Pinout + +![Modulino Vibra Pinout](assets/VibroPinouts.png) + +**Qwiic / I2C (1×4 Header)** +| **Pin** | **Function** | +|---------|---------------------------| +| GND | Ground | +| 3.3 V | Power Supply (3.3 V) | +| SDA | I2C Data | +| SCL | I2C Clock | + +These pads and the Qwiic connectors share the same I2C bus at 3.3 V. + +**Additional 1×8 Header (Motor & MCU Signals)** +| **Pin** | **Function** | +|---------|----------------| +| GND | Ground | +| 3V3 | 3.3 V Power | +| PF2 | RESET (NRST) | +| SWCLK | SWD Clock (PA14) | +| SWDIO | SWD Data (PA13) | +| TX1 | USART Transmit (PA9) | +| RX1 | USART Receive (PA10) | +| PA2 | Motor Control (MOSFET gate) | + +**Note:** PA0 controls the N-channel MOSFET gate to switch the vibration motor on/off. You can also access additional microcontroller pins (PA1, PA2, PA3, PA5) via test pads for custom applications. + +### Power Specifications + +| Parameter | Condition | Typical | Unit | +|---------------------|---------------|---------|------| +| Operating Voltage | - | 3.3 | V | +| Current Consumption | Idle | ~3.4 | mA | +| Current Consumption | Motor Active | 67 | mA | +| Current Consumption | Motor Maximum | 85 | mA | + +The module includes a power LED that draws 1 mA and turns on as soon as it is powered. + +### Schematic + +The Modulino Vibra features a simple yet effective circuit design for haptic feedback. + +The main components are the **VZ43FM1B8230001L** vibration motor and the **STM32C011F4** microcontroller (U1), which handles motor control via PWM signals to the MOSFET gate as well as I²C communication. + +You can connect to the I²C pins (SDA and SCL) using either the **QWIIC connectors** (J1 and J2, this is the recommended method) or the **solderable pins** (J4). The board runs on **3.3V**, which comes from the QWIIC cable or the **3V3 pin** on J4. + +There's also a small power LED indicator that lights up when the board is on. + +You can grab the full schematic and PCB files from the [Modulino Vibra page](https://docs.arduino.cc/hardware/modulinos/modulino-vibra). + +## Programming with Arduino + +The Modulino Vibra is fully compatible with the Arduino IDE and the official Modulino library. The following examples showcase how to generate vibration patterns and add haptic feedback to your Arduino projects. + +### Prerequisites + +- Install the Modulino library via the Arduino IDE Library Manager +- Connect your Modulino Vibra via QWIIC or solderable headers + +For detailed instructions on setting up your Arduino environment and installing libraries, please refer to the [Getting Started with Modulinos guide](../how-general). + +Library repository available [here](https://github.com/arduino-libraries/Arduino_Modulino). + +### Basic Example + +```arduino +#include + +ModulinoVibro vibro; + +void setup() { + Modulino.begin(); + vibro.begin(); +} + +void loop() { + // Vibrate for 1000 milliseconds (1 second) + vibro.on(1000); + delay(1000); + + // Turn off vibration + vibro.off(); + delay(1000); +} +``` + +### Key Functions + +- `on(duration_ms)`: Activates vibration for specified duration in milliseconds +- `on(duration_ms, power)`: Activates vibration with custom power level +- `on(duration_ms, blocking, power)`: Activates vibration, optionally blocking execution +- `off()`: Stops vibration immediately + +**Power Levels:** `STOP`, `GENTLE`, `MODERATE`, `MEDIUM`, `INTENSE`, `POWERFUL`, `MAXIMUM` (default) + +### Advanced Example - Haptic Patterns + +```arduino +#include + +ModulinoVibro vibro; + +void setup() { + Serial.begin(9600); + Modulino.begin(); + vibro.begin(); + + Serial.println("Haptic Pattern Demo"); +} + +void loop() { + // Pattern 1: Quick double pulse + Serial.println("Double Pulse"); + vibro.on(100, INTENSE); + delay(150); + vibro.on(100, INTENSE); + delay(1000); + + // Pattern 2: Escalating intensity + Serial.println("Escalating"); + vibro.on(200, GENTLE); + delay(250); + vibro.on(200, MODERATE); + delay(250); + vibro.on(200, POWERFUL); + delay(1000); + + // Pattern 3: Long gentle pulse + Serial.println("Gentle Wave"); + vibro.on(500, GENTLE); + delay(1000); + + // Pattern 4: Alert pattern + Serial.println("Alert"); + for (int i = 0; i < 3; i++) { + vibro.on(150, MAXIMUM); + delay(200); + } + delay(2000); +} +``` + +## Programming with MicroPython + +The Modulino Vibra is fully compatible with MicroPython through the official Modulino MicroPython library. The following examples demonstrate how to generate vibration patterns and implement haptic feedback in your MicroPython projects. + +### Prerequisites + +- Install the Modulino MicroPython library (see [Getting Started with Modulinos](./how-general) for detailed instructions) +- Ensure Arduino Lab for MicroPython is installed + +### Basic Example + +```python +from modulino import ModulinoVibro +from time import sleep + +vibro = ModulinoVibro() + +while True: + # Vibrate for 1 second + vibro.on(duration=1000) + sleep(1) + + # Turn off + vibro.off() + sleep(1) +``` + +### Key Methods + +- `.on(duration=ms, power=level)`: Activates vibration for specified duration and power +- `.off()`: Stops vibration immediately + +**Power Levels:** Available as constants: `GENTLE`, `MODERATE`, `MEDIUM`, `INTENSE`, `POWERFUL`, `MAXIMUM` + +### Advanced Example - Notification System + +```python +from modulino import ModulinoVibro +from time import sleep + +vibro = ModulinoVibro() + +def double_pulse(): + """Quick double pulse pattern""" + vibro.on(duration=100, power=40) + sleep(0.15) + vibro.on(duration=100, power=40) + +def escalating(): + """Escalating intensity pattern""" + for power in [25, 35, 45]: + vibro.on(duration=200, power=power) + sleep(0.25) + +def alert_pattern(): + """Emergency alert pattern""" + for _ in range(3): + vibro.on(duration=150, power=50) + sleep(0.2) + +print("📳 Haptic Feedback Demo") + +while True: + print("Double Pulse") + double_pulse() + sleep(1) + + print("Escalating") + escalating() + sleep(1) + + print("Alert") + alert_pattern() + sleep(2) +``` + +## Troubleshooting + +### Sensor Not Reachable + +If your Modulino's power LED isn't on or the sensor isn't responsive: +- Ensure both the board and the Modulino are connected to your computer +- Verify that the power LEDs on both are lit +- Check that the QWIIC cable is properly clicked into place + +### Weak Vibration + +If the vibration feels weak: +- Ensure your power supply can provide sufficient current (85 mA peak) +- Try increasing the power level parameter +- Check that all connections are secure + +### Library Issues + +See the [Getting Started with Modulinos](./how-general) guide for library installation troubleshooting. + +## Project Ideas + +Now that you've learned how to use your Modulino Vibra, try these projects: + +- **Notification Device**: Create haptic alerts for incoming messages or calls +- **Game Controller**: Add force feedback to gaming projects +- **Wearable Alert**: Build a silent alarm or reminder system +- **Assistive Device**: Create tactile feedback for accessibility applications +- **Timer Notification**: Add haptic alerts to countdown timers +- **Proximity Alert**: Vibrate when sensors detect obstacles +- **Fitness Tracker**: Provide haptic feedback for workout milestones +- **Musical Metronome**: Feel the beat through vibration patterns