Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
Shahariar
Published © GPL3+

Programmable Pocket Power Supply with OLED Display

A programmable, portable, rechargeable power supply based on Arduino featuring an OLED display for viewing V.I.P. of projects/prototypes.

IntermediateFull instructions provided12 hours16,686
Programmable Pocket Power Supply with OLED Display

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Arduino Nano R3
Arduino Nano R3
×1
XL 6009 DC DC Boost
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
16 MHz Crystal
16 MHz Crystal
×1
Terminal Block Connector
×1
Linear Regulator with Adjustable Output
Linear Regulator with Adjustable Output
×1
Linear Regulator (7805)
Linear Regulator (7805)
×1
1N4007 – High Voltage, High Current Rated Diode
1N4007 – High Voltage, High Current Rated Diode
×1
USB-A to B Cable
USB-A to B Cable
×1
Multi-Turn Precision Potentiometer- 10k ohms (25 Turn)
Multi-Turn Precision Potentiometer- 10k ohms (25 Turn)
×1
OP07 Instrumentation OpAmp
×1
Generic Socket Box
×1
FR4 Proto Board
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Male Header 40 Position 1 Row (0.1")
Male Header 40 Position 1 Row (0.1")
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 22.1k ohm
Resistor 22.1k ohm
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Arduino Latching Relay 5v 2A
×1
SparkFun MCP 4131 Digital Potentiometer 10k
×1
Arduino Copper Tape
×1
Arduino LM358 Opamp
×1
Arduino 1306 OLED
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)
Mini Drill Motor

Story

Read more

Schematics

High Level Sch

Drawn on Whiteboard !

Check this link for full Sch

https://circuits.io/circuits/4762970-arduino-based-programmable-power-supply

Current Sense Module

Step Voltage & Adj Regulator Module

Multi Voltages of the System

Code

Arduino Programmable Portable Power Supply

Arduino
Ver 1.0.1 with Pin out info in comments
// Pin Reset, D0 & D1 for uploading Sketch

// Pin D9,D10,D11,D12,D13 for controlling OLED Display

// ADC A0 Pin for Sensing V_boost
// ADC A2 Pin for Sensing V_batt (LiPo)
// ADC A3 Pin for Sensing I_Output (Load)
// ADC A4 Pin for Sensing V_USB (Charging)
// ADC A5 Pin for Sensing V_Output (Load)


// Latch Relay's 2 Coils Driving Pin  D4 &D5
#define RC1 4
#define RC2 5

// User Input Switchs connected to Pin D2 & D3
#define SW1 2
#define SW2 3

// Pin D6,D7,D8 for Digital Pot Control Pins
#define CS_PIN 6
#define CLK_PIN 7
#define DATA_PIN 8



volatile uint8_t Switch1 = 1;
volatile uint8_t Switch2 = 1;

float V_Out = 0.0;
float I_Out = 0.0;
float V_Bat = 0.0;
float V_Bst = 0.0;
float V_Chg = 0.0;
uint32_t time = 0;


#include "U8glib.h"
// OLED Display Control Pins
//SSD1306 oled waveshare(clk,din,cs,d/c,res);
// THIS FOR WAVESHARE
U8GLIB_SSD1306_128X64 u8g(10, 9,11, 13,12); 


void setup(void) {

  // flip screen, if required
  analogReference(INTERNAL);
  u8g.setRot180();
  button_init();
  relay_init();
  init_timer1();
  digipot_init();
  


}

void loop(void) {
  
 update_display();
 calc_VI();
 if (Switch1==0)
 {
   rc1_latch();
   Switch1=1;
   increment_digipot();
 }
 if (Switch2==0)
 {
    rc2_latch();
   Switch2=1;
   decrement_digipot();
 }
 
delay(100); 
}

Code Ver 1.0.1 Beta

C/C++
No preview (download only).

Code Ver 1.0.2 Beta

C/C++
Bug Fix for Text/Box Alignments
Bug Fix for Overload Trip

Few more bugs will be fixed on next release
No preview (download only).

Code ver 1.0.3

C/C++
Bug fix output relay disable during power up
Bug fix auto set output voltage 5.00 v after power up
No preview (download only).

Credits

Shahariar
74 projects • 266 followers
"What Kills a 'Great life' is a 'Good Life', which is Living a Life Inside While Loop"

Comments