12 V Battery Charger
อุปกรณ์
- Transformer 12V 1Amp
- IC LM317 (2)
- Diode Bridge W005
- Connector Terminal Block (2)
- Capacitor 1000uF, 1uF
- Capacitor 0.1uF (5)
- Variable resistor 100R
- Resistor 1k (5)
- Resistor 10k
- Diode- Nn007 (3)
- LM358 – Opamp
- 0.05R - Shunt Resistor/wire
- LCD-16*2 (optional)
- Arduino Nano (optional)
Diagram
Code
#include <LiquidCrystal.h>// ประกาศเมื่อใช้LCD
LiquidCrystal lcd(11, 12, 10, 9, 8, 7);
float voltage,current;
void setup()
{
Serial.begin(9600);
//ตั้งค่าLCD
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0, 0);
lcd.print("12V Charger");
lcd.setCursor(0, 1);
lcd.print("-Circuit Digest");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Voltage = ");
lcd.setCursor(0, 1);
lcd.print("Current = ");
}
{
Serial.begin(9600);
//ตั้งค่าLCD
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.setCursor(0, 0);
lcd.print("12V Charger");
lcd.setCursor(0, 1);
lcd.print("-Circuit Digest");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Voltage = ");
lcd.setCursor(0, 1);
lcd.print("Current = ");
}
void loop()
{
voltage = (analogRead(A0)) * 0.0140625;
current = (analogRead(A1)) * 0.35;
lcd.setCursor(10,0);
lcd.print(voltage);
lcd.setCursor(10,1);
lcd.print(current);
delay(1000);
}
{
voltage = (analogRead(A0)) * 0.0140625;
current = (analogRead(A1)) * 0.35;
lcd.setCursor(10,0);
lcd.print(voltage);
lcd.setCursor(10,1);
lcd.print(current);
delay(1000);
}
Credit By : https://circuitdigest.com/microcontroller-projects/12v-battery-charger-circuit-diagram-using-lm317
ความคิดเห็น
แสดงความคิดเห็น