Pentru cei interesati de măsurarea tensiunii si curentului cu placa INA219 am realizat un montaj simplu de test. În imaginile de mai jos se văd legăturile. Totul este foarte simplificat de SENZORul BIDIRECTIONAL DE CURENT SI TENSIUNE I2C INA219. Acest senzor o sa-l folosesc mai departe la monitorizarea bateriei pentru drona.
Montajul în ansamblu:
Conexiunile la Arduino Mega2560
Conexiunile la breadboard:
Pe monitor se vad valorile măsurate:
Schemele in Eagle ale senzorului le găsiți pe acest site: Adafruit-INA219-Current-Sensor-PCB
Codul de test:
M-am inspirat de pe următoarele site-uri:
Weekend plăcut tuturor!
Conexiunile la Arduino Mega2560
Conexiunile la breadboard:
Pe monitor se vad valorile măsurate:
Schemele in Eagle ale senzorului le găsiți pe acest site: Adafruit-INA219-Current-Sensor-PCB
Codul de test:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Florin Simedru | |
Complete project details at https://automatic-house.blogspot.com | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files. | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
*/ | |
#include "Wire.h" | |
#include "Adafruit_INA219.h" // You will need to download this library | |
Adafruit_INA219 sensor219(0x40); // Declare and instance of INA219 | |
void setup(void) | |
{ | |
Serial.begin(9600); | |
sensor219.begin(); | |
} | |
void loop(void) | |
{ | |
float busVoltage = 0; | |
float current = 0; // Measure in milli amps | |
float power = 0; | |
busVoltage = sensor219.getBusVoltage_V(); | |
current = sensor219.getCurrent_mA(); | |
power = busVoltage * (current/1000); // Calculate the Power | |
Serial.print("Bus Voltage: "); | |
Serial.print(busVoltage); | |
Serial.println(" V"); | |
Serial.print("Current: "); | |
Serial.print(current); | |
Serial.println(" mA"); | |
Serial.print("Power: "); | |
Serial.print(power); | |
Serial.println(" W"); | |
Serial.println(""); | |
delay(2000); | |
} |
Weekend plăcut tuturor!