Arduino Measures Current from Constant Current Source
Open above schematic. Schematic Arduino Current Measurement.
This is a continuing series on Arduino projects. This circuit enables Arduino to measure current from the constant current source projects below.
Also see Arduino Controlled Power Constant Current Source.
I used two parallel 0.5 Ohm resistors for 0.25 Ohms. The small voltage from resistors is amplified by an LM358 op-amp. Gain is set by R2 / R1.
An RC filter of 4.7K resistor and 10uF capacitor enable measurement of DC current or pule-width-modulated current from Arduino PWM from digital pin 9.The test program for an I2C LCD display and serial monitor.
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 16, 2); //set the LCD address to 0x27 for a 16 chars and 2 line display #define pwmPin 9 #define pot 0 #define analog1 1 int analogValue = 0; // variable to hold the analog value int total, average; float volts; void setup() { // open the serial port at 9600 bps: Serial.begin(9600); lcd.init(); lcd.backlight(); } void loop() { // read the analog input on pin 0: analogValue = analogRead(0) ; Serial.print("Pot value = "); Serial.print(analogValue); Serial.print("\n"); analogWrite(pwmPin, analogValue / 4); analogValue = analogRead(pot); lcd.setCursor(0, 0); lcd.print("POT = "); lcd.setCursor(6, 0); lcd.print(analogValue); analogValue = analogRead(analog1); lcd.setCursor(0, 1); lcd.print("AMPs = "); lcd.setCursor(11, 1); lcd.print(analogValue * .00467 ); Serial.print("AMPs = "); Serial.print(analogValue * .00475); Serial.print("\n"); delay(500); }
New for 2021
Date: 7-11-2021
In the process of publishing new gadgets and circuit ideas. Plus new tutorials and videos. They will be published here on this site.
- List of Electronic Projects by Lewis Loflin
- Constant Current Source Theory Testing
- Arduino Measures Current from Constant Current Source
- Review Ohm's Law for Trouble-Shooting CCS Circuits
- Arduino Power Magnetic Driver Board for Stepper Motors
- Arduino Controlled Power Constant Current Source
- Theory and Operation of Capacitors
Related video to above:
- Constant Current Source Multimeter Trouble Shooting
- Ohm's Law Review for Constant Current Source
- Arduino Unipolar Stepper Motor Driver Board with Arduino Code
- Arduino Controlled Constant Current Source
- Related to above:
- Using a Unipolar Stepper Motor with a Arduino
- ULN2003A Darlington Transistor Array with Circuit Examples
- Tutorial Using TIP120 and TIP125 Power Darlington Transistors
- YouTube
- ULN2003A Transistor Array with Arduino
- Arduino Stepper Motor Control
- Using the TIP120 & TIP125 Darlington Transistors with Arduino
Other Circuits
- Hall Effect Magnetic Switches and Sensors
- Transistor-Zener Diode Regulator Circuits
- Build an Adjustable 0-34 volt power supply with the LM317
- Coils for Highly Selective Crystal Radio
- Neon (NE-2) Circuits You Can Build
- Understanding Xenon Flashtubes and Circuits
- Arduino
- Arduino PWM to Analog Conversion
- Arduino Analog Digital Conversion Voltmeter
- Better Arduino Rotary Encoder Sensor
- Simple 3-Wire MAX6675 Thermocouple ADC Arduino Interface
- YouTube:
- 3-Wire MAX6675 Thermocouple ADC Arduino Interface
- Opto-Coupler SCR and Triac Circuits:
- Improved AC Zero Crossing Detectors for Arduino
- Zero-Crossing Detectors Circuits and Applications
- Simple Triac-SCR Test Lab
- Light Activated SCR Based Optocouplers Circuit Examples
- Comparing Photo Triac, Photo SCR Opto-Couplers
- Silicon Controlled Rectifier Review and Circuits
- Silicon Controlled Rectifiers Connected as Power Triacs
- Using Zero-Crossing Detectors with Arduino
- Hardware Interrupts Demo and Tutorial for Arduino
- In Depth Look at AC Power Control with Arduino
- Micro-controller AC Power Control Using Interrupts
- Light Activated SCR Based Optocouplers Circuit Examples
- Solid State AC Relays with Triacs
- YouTube
- Zero-Crossing Detectors Circuits and Applications
- Zero-Crossing Circuits for AC Power Control
- In Depth Look at AC Power Control with Arduino
- Micro-controller AC Power Control Using Interrupts
- YouTube Video for Arduino AC Power Control