[Mise à jour le 4/5/2024]
Un courant électrique est un mouvement d'ensemble de porteurs de charges électriques, généralement des électrons, au sein d'un matériau conducteur. Ces déplacements sont imposés par l'action de la force électromagnétique, dont l'interaction avec la matière est le fondement de l'électricité. Wikipédia
/*############################################################################## Author: * Mirko Prosseda (06-2013) * email: mirko.prosseda@gmail.com Description: * 5A Linear Current Sensor test sketch v1.0 * Read current value from the sensor and print its value on the Serial Monitor Connections: * BOARD -> ARDUINO * Vcc -> 5V * GND -> GND * OUT -> PIN A0 ##############################################################################*/ // Define constants and variables const int analogInPin = A0; // Analog input pin that the current sensor is attached to int sensorValue = 0; // value read from the sensor float outputValue = 0; // converted value of the sensor reading // Initialization void setup() { Serial.begin(9600); // Serial Port initialization } // main loop void loop() { sensorValue = analogRead(analogInPin); // reads the sensor value and convert it outputValue = ((float)(sensorValue - 338) * 5 / 0.11) / 1024; // A vérifier pour un ACS714 Serial.print("Current Sensor value= " ); // print results Serial.print(outputValue); Serial.println("A"); delay(200); }
/*############################################################################## Author: * Mirko Prosseda (06-2014) * email: mirko.prosseda@gmail.com Description: * 12A Linear Current Sensor test sketch v1.0 * Read current value from the sensor and print its value on the Serial Monitor Connections: * BOARD -> ARDUINO * Vcc -> 3.3V * GND -> GND * OUT -> PIN A0 ##############################################################################*/ // Define constants and variables const int analogInPin = A0; // Analog input pin that the current sensor is attached to int sensorValue = 0; // value read from the sensor float outputValue = 0; // converted value of the sensor reading // Initialization void setup() { Serial.begin(9600); // Serial Port initialization } // main loop void loop() { sensorValue = analogRead(analogInPin); // reads the sensor value and convert it outputValue = ((float)(sensorValue - 512) * 5 / 0.110) / 1024; // A vérifier pour un ACS711 Serial.print("Current Sensor value= " ); // print results Serial.print(outputValue); Serial.println("A"); delay(200); }