아두이노 보드를 전압계와 전류계로 사용할 수 있다는 사실을 알고 계셨나요?
이것이 바로 오늘 저희가 여러분께 제안하는 프로젝트입니다. LCD 화면을 사용하여 전압과 전류 값을 표시할 것입니다.
이 프로젝트의 장점은 멀티미터를 쉽게 만들 수 있고 매우 정확하며 5V보다 훨씬 높은 전압을 측정할 수 있다는 것입니다.
이 프로젝트의 두 번째 장점은 부품이 거의 필요하지 않다는 점입니다.
프로젝트에 필요한 재료:
다음은 시뮬레이션된 프로젝트의 다이어그램으로, 아두이노 보드에서 읽은 전압과 전류가 전압 발생기에서 제공한 전압과 거의 동일하다는 것을 확인할 수 있습니다:
#include <LiquidCrystal.h> // Library used for the LCD display
LiquidCrystal lcd(12, 11, 4, 5, 6, 7); // Initialize the LCD with the pins used
// Initialize voltage and current values
float input_voltage = 0.0;
float measured_voltage = 0.0;
float measured_current = 0.0;
// The two resistors used for voltage and current measurement
float resistor_A = 15000.0;
float resistor_B = 1500.0;
void setup(){
lcd.begin(16, 2); // Initialize the LCD
lcd.clear();
}
void loop () {
// Position on first line for voltage
lcd.setCursor(0,0);
lcd.print("Voltage:");
lcd.setCursor(8, 0);
lcd.print(measured_voltage); // Display voltage
lcd.setCursor(14, 0);
lcd.print("V");
// Position on second line for current
lcd.setCursor(0,1);
lcd.print("Current: ");
lcd.setCursor(8, 1);
lcd.print(measured_current); // Display current
lcd.setCursor(14, 1);
lcd.print("mA");
input_voltage = (analogRead(A0)*5.0)/1023.0; // Read input voltage
measured_voltage = input_voltage/(resistor_B/(resistor_A + resistor_B)); // Adjust voltage based on resistor values
measured_current = 1000*(measured_voltage/(resistor_A+resistor_B)); // Calculate current based on resistor values
}
프로그램을 보드에 설치하려면 Arduino Ide 소프트웨어가 필요합니다. 코드를 가져와 소프트웨어에 복사한 다음 컴파일하여 보드에 업로드하면 됩니다.
프로그램 업로드에 문제가 있는 경우 관련 강좌를 시청할 수 있습니다!
모든 프로젝트에 멀티미터를 독립적으로 사용하려면 아두이노 보드에 4개의 배터리 팩과 에너지 절약 스위치를 추가하기만 하면 됩니다.
골판지나 3D 프린터로 상자를 만들어 충격이나 전선이 뽑히지 않도록 회로를 보호할 수도 있습니다.
멀티미터에 25V 및 0.5A 이상을 넣지 않는 것이 좋습니다. 실제로 그 이상이면 단락이 발생하면 위험할 수 있습니다. 멀티미터 프로젝트로 인한 부상 발생 시 아두이노 팩토리는 모든 책임을 지지 않습니다.