Skip to content

Commit 0d699da

Browse files
committed
Content update (Qwiic connector information)
1 parent 3de222a commit 0d699da

File tree

2 files changed

+148
-0
lines changed

2 files changed

+148
-0
lines changed
1010 KB
Loading

content/hardware/03.nano/boards/nano-r4/tutorials/01.user-manual/content.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,6 +2290,154 @@ When working with HID on the Nano R4, there are several key points to keep in mi
22902290
- The Nano R4 can function as both a keyboard and mouse simultaneously, allowing for complex automation sequences that combine typing, shortcuts and mouse control.
22912291
- Remember that different operating systems may have slightly different keyboard layouts and shortcuts, so test your HID projects on your target platform to ensure compatibility.
22922292

2293+
## Qwiic Connector
2294+
2295+
The Nano R4 board features an onboard Qwiic connector that provides a simple, tool-free solution for connecting I²C devices. The Qwiic ecosystem, developed by SparkFun Electronics, has become an industry standard for rapid prototyping with I²C devices, allowing you to connect sensors, displays, and other peripherals without soldering or complex wiring. This makes it perfect for quickly building sensor networks, adding displays, or expanding your project's capabilities with minimal effort.
2296+
2297+
![Qwiic connector of the Nano R4 board](assets/qwiic-connector.png)
2298+
2299+
The Qwiic connector enhances the Nano R4's versatility by providing a dedicated interface for the extensive ecosystem of +3.3 VDC I²C modules. While the Nano R4's native +5 VDC operation ensures compatibility with classic Arduino shields and components, the Qwiic interface adds seamless integration with modern sensors and modules. The board includes built-in level translation between the +5 VDC microcontroller and the +3.3 VDC Qwiic bus, giving you the best of both worlds: full compatibility with traditional Arduino hardware on the main pins, plus instant access to the latest Qwiic-compatible devices.
2300+
2301+
### Qwiic Specifications
2302+
2303+
The Nano R4's Qwiic connector offers the following specifications:
2304+
2305+
| **Parameter** | **Value** | **Notes** |
2306+
|:-----------------:|:--------------------------:|:----------------------------------------------:|
2307+
| Connector Type | JST SH 4-pin 1mm | Industry standard Qwiic |
2308+
| Operating Voltage | +3.3 VDC | Powered by onboard regulator |
2309+
| I²C Interface | `Wire1` | Secondary I²C bus (not `Wire`) |
2310+
| Level Shifting | Built-in | Automatic +5 VDC to +3.3 VDC level translation |
2311+
| Pin Order | `GND`, `VCC`, `SDA`, `SCL` | Standard Qwiic pinout |
2312+
2313+
The Qwiic connector is a small 4-pin connector with a 1.00 mm pitch. The mechanical details of the connector can be found in the connector's [datasheet](https://www.jst-mfg.com/product/pdf/eng/eSH.pdf).
2314+
2315+
The pin layout of the Qwiic connector is the following:
2316+
2317+
- `GND`: Ground
2318+
- `VCC`: +3.3 VDC power supply
2319+
- `SDA`: I²C data line
2320+
- `SCL`: I²C clock line
2321+
2322+
The `VCC` pin provides a stable +3.3 VDC output from the onboard regulator when the board is powered. The manufacturer part number of the Qwiic connector is [SM04B-SRSS-TB](https://www.jst-mfg.com/product/pdf/eng/eSH.pdf), and its matching cable assemblies use the [SHR-04V-S-B](https://www.jst-mfg.com/product/pdf/eng/eSH.pdf) receptacle.
2323+
2324+
### Understanding the Dual I²C Architecture
2325+
2326+
The Nano R4 implements a dual I²C bus architecture that separates +5 VDC and +3.3 VDC devices:
2327+
2328+
| **I²C Bus** | **Arduino Object** | **Physical Connection** | **Voltage** | **Level Shifter** | **Use Case** |
2329+
|:-----------:|:------------------:|:-----------------------:|:-----------:|:-----------------:|:-----------------------------:|
2330+
| Primary | `Wire` | Pins `A4/A5` | +5 VDC | None | +5V sensors, Arduino shields |
2331+
| Secondary | `Wire1` | Qwiic Connector | +3.3 VDC | Built-in | Modern sensors, Qwiic devices |
2332+
2333+
***__Important note__: The Qwiic connector uses `Wire1` object, not the standard `Wire` object. This is different from boards with a single I²C bus. Always use `Wire1.begin()` and related `Wire1` functions when communicating with Qwiic devices.***
2334+
2335+
### Connecting Qwiic Devices
2336+
2337+
Connecting Qwiic devices to your Nano R4 board is straightforward. Simply get a standard Qwiic cable (available in various lengths) and plug one end into the Nano R4's Qwiic connector and the other into your Qwiic device. Most Qwiic devices have two connectors, allowing you to daisy-chain multiple devices without any soldering or breadboarding. The polarized connectors prevent incorrect connections, making the setup process foolproof.
2338+
2339+
The Qwiic system's key advantages include:
2340+
2341+
- **Plug-and-play connectivity**: No breadboards, jumper wires, or soldering required
2342+
- **Polarized connectors**: Prevents accidental reverse connections
2343+
- **Daisy-chain capability**: Connect multiple devices in series
2344+
- **Built-in pull-up resistors**: No external resistors needed
2345+
- **Standard pinout**: Compatible across all Qwiic ecosystem devices
2346+
2347+
### Working with Qwiic Devices
2348+
2349+
The following example demonstrates how to use the Arduino Modulino Movement sensor via the Qwiic connector:
2350+
2351+
```arduino
2352+
/**
2353+
Modulino Movement Example for the Arduino Nano R4 Board
2354+
Name: nano_r4_modulino_movement.ino
2355+
Purpose: This sketch demonstrates reading motion data from the
2356+
Modulino Movement sensor via the Qwiic connector.
2357+
2358+
@author Arduino Product Experience Team
2359+
@version 1.0 01/06/25
2360+
*/
2361+
2362+
#include <Modulino.h>
2363+
#include <Wire.h>
2364+
2365+
// Create Modulino Movement object
2366+
ModulinoMovement movement;
2367+
2368+
void setup() {
2369+
// Initialize serial communication and wait up to 2.5 seconds for a connection
2370+
Serial.begin(115200);
2371+
for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500));
2372+
2373+
Serial.println("- Arduino Nano R4 - Modulino Movement Example started...");
2374+
2375+
// Initialize Wire1 for Qwiic connector
2376+
Wire1.begin();
2377+
2378+
// Initialize Modulino system
2379+
Modulino.begin();
2380+
2381+
// Initialize Movement sensor
2382+
if (!movement.begin()) {
2383+
Serial.println("- Error: Modulino Movement not found!");
2384+
Serial.println("- Please check Qwiic connection and reset");
2385+
while (1) delay(10);
2386+
}
2387+
2388+
Serial.println("- Modulino Movement connected successfully!");
2389+
Serial.println("- Reading motion data...\n");
2390+
}
2391+
2392+
void loop() {
2393+
// Variables for sensor data
2394+
float ax, ay, az; // Acceleration in g
2395+
float gx, gy, gz; // Gyroscope in degrees/second
2396+
2397+
// Read sensor data
2398+
movement.getAcceleration(ax, ay, az);
2399+
movement.getGyroscope(gx, gy, gz);
2400+
2401+
// Display acceleration
2402+
Serial.print("- Accel (g): X=");
2403+
Serial.print(ax, 2);
2404+
Serial.print(" Y=");
2405+
Serial.print(ay, 2);
2406+
Serial.print(" Z=");
2407+
Serial.print(az, 2);
2408+
2409+
// Display gyroscope
2410+
Serial.print(" | Gyro (dps): X=");
2411+
Serial.print(gx, 1);
2412+
Serial.print(" Y=");
2413+
Serial.print(gy, 1);
2414+
Serial.print(" Z=");
2415+
Serial.print(gz, 1);
2416+
2417+
// Detect significant motion
2418+
float totalAccel = sqrt(ax*ax + ay*ay + az*az);
2419+
if (abs(totalAccel - 1.0) > 0.3) {
2420+
Serial.print(" <- Motion!");
2421+
}
2422+
2423+
Serial.println();
2424+
2425+
// Update at 10Hz
2426+
delay(100);
2427+
}
2428+
```
2429+
2430+
***To test this example, you need an [Arduino Modulino Movement](https://store.arduino.cc/collections/modulino/products/modulino-movement) connected to the Nano R4's Qwiic connector via a Qwiic cable. Install the Modulino library from the Arduino IDE Library Manager (Tools > Manage Libraries > Search "Modulino").***
2431+
2432+
You can open the Arduino IDE's Serial Monitor (Tools > Serial Monitor) to see the real-time acceleration and gyroscope data. Try moving or rotating the sensor to see the values change.
2433+
2434+
This example demonstrates the key aspects of using Qwiic devices with the Nano R4:
2435+
2436+
- Using `Wire1.begin()` instead of `Wire.begin()` for the Qwiic connector
2437+
- Direct plug-and-play connection without additional wiring
2438+
- Automatic +3.3 VDC power and level translation
2439+
- Access to Arduino's ecosystem of Modulino sensors
2440+
22932441
## Bootloader
22942442

22952443
The Nano R4 board features a built-in bootloader that enables sketch uploading directly from the Arduino IDE without requiring external programming hardware. The bootloader is a small program stored in a protected area of the RA4M1 microcontroller's flash memory that runs each time the board powers on or resets. It manages the critical communication between your computer and the board during sketch uploads, making the development process simple and accessible.

0 commit comments

Comments
 (0)