Shahariar
Published © GPL3+

Solid State Protection System for various AC/DC Applications

CoolMOS based isolated AC or DC load controller with ZVS switching and short circuit, overload, over/under voltage & frequency protections

IntermediateFull instructions provided5 days3,590

Things used in this project

Hardware components

0.96 inch 1306 OLED
×1
Microchip Atmega32A
×1
Infineon CoolMOS C7 Gold SJ MOSFET
×2
ACS712T Current Sensor
×1
4N35 Optocoupler
×1
Octonion B1212S-1WR2
×1
1.5KE100A TVS Diode
×10
MOV-07D271K Bourns Varistors
×4
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
ATmega328
Microchip ATmega328
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×3
Resistor 0.05 ohm
Resistor 0.05 ohm
×20
DC-DC Boost Converter XL6009
×1
1N4148 – General Purpose Fast Switching
1N4148 – General Purpose Fast Switching
×5
Capacitor 100 µF
Capacitor 100 µF
×1
Capacitor 10 µF
Capacitor 10 µF
×1
Capacitor 100 nF
Capacitor 100 nF
×3
Capacitor 220 µF
Capacitor 220 µF
×1
Capacitor 4.7 µF
Capacitor 4.7 µF
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Resistor 100k ohm
Resistor 100k ohm
×1
Resistor 220k
×2
Protoboards
×1
Coin Cell Battery CR2032
Coin Cell Battery CR2032
×1
Coin Cell Battery Holder
Coin Cell Battery Holder
×1
Buzzer
Buzzer
×1
3 mm LED: Yellow
3 mm LED: Yellow
×1
SparkFun 10k Digipot MCP4131
×1
General Purpose Quad Op-Amp
Texas Instruments General Purpose Quad Op-Amp
×1
CoolMOS C7 Gold SJ MOSFET
Infineon CoolMOS C7 Gold SJ MOSFET
×2

Software apps and online services

EasyEDA Sch & PCB design
Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

CoolMOS SSR

CoolMOS sch final: https://easyeda.com/suntop/coolmos-ssr-for-ac-dc

board layout

Code

Coolmos SSR AC DC

C/C++
ver 0.1
////////////////////////////////////////////
///////////// Header Files /////////////////

#include <Wire.h>
#include "RTClib.h"
#include "U8glib.h"
#include "infineon_logo.h"
#include <avr/pgmspace.h>
#include <avr/interrupt.h>

////////////  control & sense i/o   //////////////

#define CS_PIN 14            // sspi <> digippot SS
#define CLK_PIN 13           // sspi <> digipot CLK
#define DATA_PIN 12          // sspi <> digipot MISO

#define TRIP_LED 23          // dout <> Red LED
#define GATE_ON_LED 1        // dout <> Green LED

#define GATE_DRIVE 0         // dout <> TLP250 Anode
#define GATE_DRIVE_PWM 3     // pwm  <> TLP250 Anode

#define ZV_FREQ_SENSE 2      // int2 <> 4N35 Opto
#define MENU_BUTTON_RED 10   // int0 <> Red Push Button
#define TRIP_BUTTON_WHITE 11 // int1 <> White Push Button & LM339 Output


#define UP_BUTTON_BLACK 28   // adc5 <> Black Push Button
#define DOWN_BUTTON_BLUE 27  // adc6 <> Blue Push Button

#define VBOOST_SENSE 29      // adc7 <> 100k||10k voltage divider
#define CURRENT_SENSE 30     // adc0 <> Vout ACS712T20A
#define VOLTAGE_SENSE 31     // adc1  <> 100k||6k8 voltage divider
#define TRIP_LEVEL_SENSE 25  // adc3 <> Digipot W0 pin

///////////// OLED Display Control Pins ////////////////////////
//SSD1306 oled waveshare(clk,din,cs,d/c,res); -> 21,22,20,19,18
U8GLIB_SSD1306_128X64 u8g(21,22,20,19,18); 

///////////// RTC chip Control Pins //////////////////////////
// 1307 I2C RTC(scl,sda) -> 16,17
RTC_DS1307 rtc;

////////////////////// Variables //////////////////////////////

volatile boolean menu_mode = 0;
float v_boost = 0;

int blue = 0;
int black = 0;
int current = 0;
int voltage = 0;
int triplevel = 0;

int yr = 0;
int mo = 0;
int dy = 0;
int hr = 0;
int mi = 0;
int se = 0;






void setup(void) 
{

  u8g.setRot180();
  //draw_logo();
  SW_Interrupt_Init();
  Digipot_Init();
  pinMode(GATE_DRIVE,OUTPUT);
  pinMode(TRIP_LED,OUTPUT);
  pinMode(GATE_ON_LED,OUTPUT);
  rtc.begin();
  delay(100);
 
  // sets the RTC with an  date & time
  // dec 19, 2018 at 6am :
  if(rtc.isrunning()!=1) 
  {
    // remove 3v batt and wait 2 min, then reprogram  
    // with current time and put batt to keep the time
  rtc.adjust(DateTime(2018, 12, 19, 18, 53, 00));
  }
}                                  

void loop(void) 

{
 

  
while (menu_mode)
{
  scan_adc();
  draw_adc();
  increment_digipot();
  digitalWrite(GATE_DRIVE,LOW);
  digitalWrite(GATE_ON_LED,LOW);
  digitalWrite(TRIP_LED,HIGH);
  
}
   delay(200);
   scan_time();
   draw_time();
  digitalWrite(GATE_DRIVE,HIGH);
  digitalWrite(GATE_ON_LED,HIGH);
  digitalWrite(TRIP_LED,LOW);
   decrement_digipot();
}

////////////////////////////////////////////
//////// Atmega32A to Arduino Pinout////////
////////////////////////////////////////////
// pin num - pin name - Ardu pin --  Func //
//    1        PB0          0        D IO //   
//    2        PB1          1        D IO //           
//    3        PB2          2        INT2 //           
//    4        PB3          3        PWM  //          
//    5        PB4          4        SS   //         
//    6        PB5          5        MOSI //           
//    7        PB6          6        MISO //          
//    8        PB7          7        SCLK //        
//    9        RST                   RST  //                       
//    10       VCC                   VCC  //         
//    11       GND                   GND  //         
//    12       XTL                   XTAL //           
//    13       XTL                   XTAL //           
//    14       PD0          8        RX 0 //           
//    15       PD1          9        TX 0 //          
//    16       PD2          10       INT0 //           
//    17       PD3          11       INT1 //           
//    18       PD4          12       PWM  //          
//    19       PD5          13       PWM  //          
//    20       PD6          14       PWM  //         
//    21       PD7          15       PWM  //          
//    22       PC0          16       SCL  //        
//    23       PC1          17       SDA  //          
//    24       PC2          18       D IO //           
//    25       PC3          19       D IO //           
//    26       PC4          20       D IO //           
//    27       PC5          21       D IO //           
//    28       PC6          22       D IO //           
//    29       PC7          23       D IO //           
//    30       VCC                   VCC  //          
//    31       GND                   GND  //          
//    32       REF                   AREF //           
//    33       PA7          29       ADC7 //          
//    34       PA6          27       ADC6 //           
//    35       PA5          28       ADC5 //           
//    36       PA4          26       ADC4 //           
//    37       PA3          25       ADC3 //           
//    38       PA2          24       ADC2 //           
//    39       PA1          31       ADC1 //           
//    40       PA0          30       ADC0 //           
////////////////////////////////////////////
///// CODE ACCEPTS ARDUINO PIN NUMBER //////

Electronic_Contactor.zip

C/C++
AC SSR with Soft Switching, Frequency & Current Sensing, Fault Protection
No preview (download only).

AuxSmartFuse.zip

C/C++
Automotive Auxiliary System Configurable Smart Fuse with Self Resetting Timer
No preview (download only).

CBforDCHome.zip

C/C++
DC Home Configurable Circuit Breaker with Overload, Short Circuit, Over Voltage, Under voltage protection and Energy Meter
No preview (download only).

Credits

Shahariar

Shahariar

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

Comments