meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sensor:ina219 [2026/02/13 15:34] vamsansensor:ina219 [2026/02/13 15:58] (current) – [I²C topics on lamaPLC] vamsan
Line 16: Line 16:
   * **Multi-Function Reporting:** It calculates and reports bus voltage, shunt voltage drop, current, and total power (W) directly.   * **Multi-Function Reporting:** It calculates and reports bus voltage, shunt voltage drop, current, and total power (W) directly.
   * **Programmability:** Supports software-programmable calibration, filtering (averaging up to 128 samples), and conversion times.   * **Programmability:** Supports software-programmable calibration, filtering (averaging up to 128 samples), and conversion times.
-  * **Daisy-Chaining:** Supports up to 16 programmable I2C addresses, allowing multiple modules to run on the same bus. +  * **Daisy-Chaining:** Supports up to 16 programmable I²C addresses, allowing multiple modules to run on the same bus. 
  
 **Safety & Limitations** **Safety & Limitations**
Line 23: Line 23:
   * **Inductive Loads:** Users should be cautious with large motors, as //"flyback"// voltage spikes can exceed the 26V threshold and destroy the sensor.    * **Inductive Loads:** Users should be cautious with large motors, as //"flyback"// voltage spikes can exceed the 26V threshold and destroy the sensor. 
  
 +====== CJMCU-219 Pinout ======
 +{{ :sensor:ina219_1.png?400|CJMCU-219 Pinout}}
 +**Logic and Power Pins**
 +
 +These pins connect to your microcontroller (e.g., Arduino or Raspberry Pi) to power the sensor and transmit data. 
 +
 +  * **VCC:** Supply voltage for the module (**3.0V to 5.5V**).
 +  * **GND:** Common ground for both power and logic.
 +  * **SCL:** I²C serial clock line.
 +  * **SDA:** I²C serial data line.
 + 
 +**Measurement (Load) Pins**
 +
 +These pins are placed in series with the positive side (high-side) of the circuit you want to monitor. 
 +
 +  * **Vin+:** Connect to the positive terminal of your power source (e.g., battery).
 +  * **Vin-:** Connect to the positive terminal of your load (the device being powered). 
 +
 +**I²C addressing Pins (A0 & A1)**
 +
 +Some versions of the CJMCU-219 include solder pads labeled **A0** and **A1**. By default, these are connected to GND, setting the I2C address to **0x40**. 
 +
 +Bridging these pads to VCC allows you to set the address to any of 16 values (**0x4F**), enabling multiple sensors on the same I²C bus. 
 +
 +<color red>Caution: The maximum bus voltage the Vin pins can safely handle is 26V DC.</color>
 ==== Arduino wiring ==== ==== Arduino wiring ====
   * VCC → Arduino 5V (o 3.3V).   * VCC → Arduino 5V (o 3.3V).
Line 32: Line 57:
  
 ==== Arduino code ==== ==== Arduino code ====
-To begin using the CJMCU-219 with Arduino, the easiest method is to utilize the **Adafruit INA219** library.+To begin using the CJMCU-219 with Arduino, the easiest approach is to use the **Adafruit INA219** library.
  
-This example code sets up the sensor and outputs voltage, current, and power readings to the Serial Monitor at 115200 baud.+This example code sets up the sensor and outputs voltage, current, and power readings to the Serial Monitor at **115200 baud**.
  
 A simple example with the Adafruit_INA219 library involves initializing the sensor and repeatedly reading and displaying bus voltage, shunt voltage, load voltage, current, and power. The complete code is available in the provided source document. A simple example with the Adafruit_INA219 library involves initializing the sensor and repeatedly reading and displaying bus voltage, shunt voltage, load voltage, current, and power. The complete code is available in the provided source document.
Line 102: Line 127:
   * **setCalibration_16V_400mA():** Highest precision for low-voltage, low-current projects.    * **setCalibration_16V_400mA():** Highest precision for low-voltage, low-current projects. 
  
-==== Example codes ==== 
-none 
 ===== I²C topics on lamaPLC ===== ===== I²C topics on lamaPLC =====
 {{topic>i2c}} {{topic>i2c}}
Line 110: Line 133:
 \\ \\
  
-{{tag>ENS160 ScioSense gas-quality i2c communication sensor arduino code}}+{{tag>CJMCU-219 INA-219 INA219 breakout_board i2c communication sensor voltage current arduino code CJMCU}}
  
 This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}} This page has been accessed for: Today: {{counter|today}}, Until now: {{counter|total}}