Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano Multiwatt Charger with OLED Display and Keypad Control

View and Edit Project In Cirkit DesignerImage of Arduino Nano Multiwatt Charger with OLED Display and Keypad Control

Circuit Documentation

Summary

This circuit is a multiwatt charger that utilizes an Arduino Nano to control and monitor the charging process. The system includes a 0.96" OLED display for visual feedback, a 4x4 membrane matrix keypad for user input, an Adafruit DS3502 digital potentiometer for voltage adjustment, and various resistors for voltage and current sensing. The circuit is powered by a 12V battery, regulated by an XL6009 voltage regulator.

Component List

  1. Arduino Nano

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. 0.96" OLED

    • Description: OLED display module.
    • Pins: GND, VDD, SCK, SDA
  3. XL6009 Voltage Regulator

    • Description: DC-DC step-up (boost) converter.
    • Pins: OUT +, OUT -, IN +, IN -
  4. Battery 12V

    • Description: 12V power source.
    • Pins: +, -
  5. Adafruit DS3502

    • Description: I2C digital potentiometer.
    • Pins: RL, RW, RH, V+, VCC, GND, SCL, SDA, A0, A1
  6. 4X4 Membrane Matrix Keypad

    • Description: Keypad for user input.
    • Pins: R1, R2, R3, R4, C1, C2, C3, C4
  7. Resistors

    • Description: Various resistors used for voltage and current sensing.
    • Instances:
      • 5000 Ohms
      • 7000 Ohms
      • 0.05 Ohms
      • 10000 Ohms
      • 330 Ohms
      • 470 Ohms
  8. USB Power

    • Description: USB power source.
    • Pins: +, -
  9. IRFZ44N

    • Description: N-channel MOSFET.
    • Pins: Gate, Drain, Source

Wiring Details

Arduino Nano

0.96" OLED

XL6009 Voltage Regulator

Battery 12V

Adafruit DS3502

4X4 Membrane Matrix Keypad

Resistors

USB Power

IRFZ44N

Code Documentation

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Keypad.h>
#include <Adafruit_DS3502.h>

// Pin definitions
#define VOLTAGE_SENSOR_PIN A0
#define CURRENT_SENSOR_PIN A1
#define OLED_RESET -1

// OLED display dimensions
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

// Define the I2C address for the OLED display
#define SSD1306_I2C_ADDRESS 0x3C

// Keypad setup
const byte ROWS = 4; // 4 rows
const byte COLS = 4; // 4 columns
char keys[ROWS][COLS] = {
  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);

// DS3502 potentiometer
Adafruit_DS3502 pot = Adafruit_DS3502();

// OLED display
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// Constants
const float VOLTAGE_DIVIDER