Wednesday 24 January 2024

How to Make Bench Power Supply and Battery Charger with Switching Mode Power Supply

 


This is about how to make a bench power supply and a battery charger using a switch mode power supply. The important part is, the most of bench power supplies are with 5 amperes or 10 amperes. Bu you can build your own one with 30 amperes for a low cost.

Since this project is built on the same power supply casing, you will not need an extra casing to use.  

You will need the following parts to build this,


Accessories


1. Switching Mode Power supply unit : Click Here


2.Volt Meter : Click Here


3.Battery Overcharge Protector : Click Here


4.Banana Jack base : Click Here



5.Potentiometer


6.Wire Code


7.Power Switch


8.DPDT Switch


9.Wires, connectors, leads

Equipment

1.Soldering Iron
2.Multimeter
3.Wire cutters
4.Pliers
5.Drilling machine
6.Cutting machine, etc



STEP 01.

You have to find the voltage adjusting variable resistor of the power supply unit. Then remove it and replace the same value of a potentiometer.




STEP 02

Cut the necessary holes to mount the volt meter, power switch, banana jack base, DPDT switch as shown in the video.

STEP 03

Use the following wiring diagram to wire the accessories.




The reason for using a DPDT switch to change the mode from bench power supply to battery charging unit. Since this battery overcharging unit need 6 volts minimum to run the unit, you can not use the batteries lower than that voltage to charge.

Make sure you have used a power code with earth wire connection. Because this PSU casing is made of metal.


Watch the following video for more details















Monday 31 July 2023

3.7v to 1.5v Power Supply for Wall Clock

 


As you aware that normally wall
clocks are powered by 1.5v battery. However, those batteries are dried out
within couple of weeks. Therefore, I planned to use a battery with 3.7 volts
for the wall clocks converting the voltage in to 1.5v.



My intention was to use Voltage
Divider theory. The following circuit is used for voltage divider.

Accordingly,
I used 1k resistor for R1 and 1.5k resistor for R2. Since the supplied power is
3.7v, the formula is as follows.


You
can see the power output is around 1.5v. But this did not worked for alarm
clock. However, I added 10uf capacitor for the power outside.


Follow the video instructions and you also can use this project for you wall clock as well.




Wednesday 7 December 2022

8 x  8 LED mattrix with arduino- Scrolling Texts

 


This project is about making 8x8 LED metrix display with arduino. The base of this project is the 8x8 LED matrix.

This module is powered by MAX 7219 IC. And you can connect single modules each together you can make a big display.

In this project you can find how to display texts with scrolling on LED metrix.

Connect the wires as follows




VCC --------- Arduino 5v
GND --------- GND
DIN ---------  Pin No 11
CS --------- Pin No 10
CLK ---------  Pin No 13

When the wiring part is completed, you have to download the following arduino libraries.
01. MD_Parola
02.MD_MAX72XX




You can download those libraries from the following link.


Having added those libraries you can upload the code to the project.

The code is given below



// Use the Parola library to scroll text on the display
//
// Demonstrates the use of the scrolling function to display text received
// from the serial interface
//
// User can enter text on the serial monitor and this will display as a
// scrolling message on the display.
// Speed for the display is controlled by a pot on SPEED_IN analog in.
// Scrolling direction is controlled by a switch on DIRECTION_SET digital in.
// Invert ON/OFF is set by a switch on INVERT_SET digital in.
//
// UISwitch library can be found at https://github.com/MajicDesigns/MD_UISwitch
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
//


#include //Download this library
#include //Download this Library
#include
// set to 1 if we are implementing the user interface pot, switch, etc
#define USE_UI_CONTROL 0

#if USE_UI_CONTROL
#include
#endif


// Turn on debug statements to the serial output
#define DEBUG 0

#if DEBUG
#define PRINT(s, x) { Serial.print(F(s)); Serial.print(x); }
#define PRINTS(x) Serial.print(F(x))
#define PRINTX(x) Serial.println(x, HEX)
#else
#define PRINT(s, x)
#define PRINTS(x)
#define PRINTX(x)
#endif

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 5
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

String str;
// HARDWARE SPI
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// SOFTWARE SPI
//MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

// Scrolling parameters
#if USE_UI_CONTROL
const uint8_t SPEED_IN = A5;
const uint8_t DIRECTION_SET = 8; // change the effect
const uint8_t INVERT_SET = 9; // change the invert

const uint8_t SPEED_DEADBAND = 5;
#endif // USE_UI_CONTROL

uint8_t scrollSpeed = 50; // Running Speed
textEffect_t scrollEffect = PA_SCROLL_LEFT;
textPosition_t scrollAlign = PA_LEFT;
uint16_t scrollPause = 75; // in milliseconds // Change this amount to delay to start next round :-)




// Global message buffers shared by Serial and Scrolling functions
#define BUF_SIZE 50

char curMessage[BUF_SIZE] = { "Welcome" };
char newMessage[BUF_SIZE] = {"SETNFIX™"}; //Type the word you want to display on LED matrix
bool newMessageAvailable = true;

#if USE_UI_CONTROL

MD_UISwitch_Digital uiDirection(DIRECTION_SET);
MD_UISwitch_Digital uiInvert(INVERT_SET);

void doUI(void)
{
// set the speed if it has changed
{
int16_t speed = map(analogRead(SPEED_IN), 0, 1023, 10, 150);

if ((speed >= ((int16_t)P.getSpeed() + SPEED_DEADBAND)) ||
(speed <= ((int16_t)P.getSpeed() - SPEED_DEADBAND)))
{
P.setSpeed(speed);
scrollSpeed = speed;
PRINT("\nChanged speed to ", P.getSpeed());
}
}

if (uiDirection.read() == MD_UISwitch::KEY_PRESS) // SCROLL DIRECTION
{
PRINTS("\nChanging scroll direction");
scrollEffect = (scrollEffect == PA_SCROLL_LEFT ? PA_SCROLL_RIGHT : PA_SCROLL_LEFT);
P.setTextEffect(scrollEffect, scrollEffect);
P.displayClear();
P.displayReset();
}

if (uiInvert.read() == MD_UISwitch::KEY_PRESS) // INVERT MODE
{
PRINTS("\nChanging invert mode");
P.setInvert(!P.getInvert());
}
}
#endif // USE_UI_CONTROL

void readSerial(void)
{
static char *cp = newMessage;

while (Serial.available())
{
*cp = (char)Serial.read();
if ((*cp == '\n') || (cp - newMessage >= BUF_SIZE-2)) // end of message character or full buffer
{
*cp = '\0'; // end the string
// restart the index for next filling spree and flag we have a message waiting
cp = newMessage;
newMessageAvailable = true;
}
else // move char pointer to next position
cp++;
}
}

void setup()
{
Serial.begin(57600);
Serial.print("\n[Parola Scrolling Display]\nType a message for the scrolling display\nEnd message line with a newline");

#if USE_UI_CONTROL
uiDirection.begin();
uiInvert.begin();
pinMode(SPEED_IN, INPUT);

doUI();
#endif // USE_UI_CONTROL

P.begin();
P.displayText(curMessage, scrollAlign, scrollSpeed, scrollPause, scrollEffect, scrollEffect);

//Testing purpose only :-)
}

void loop()
{



#if USE_UI_CONTROL
doUI();
#endif // USE_UI_CONTROL

if (P.displayAnimate())
{
if (newMessageAvailable)
{
strcpy(curMessage, newMessage);
newMessageAvailable = false;
}
P.displayReset();
}
readSerial();
}


Saturday 2 July 2022

Arduino LED CLOCK with DS 3231 RTC module

 


This is an LED clock with SD 323 RTC module. This module is able to give the time accurately and it is very easy to code without hard coding.


 RTC Module


 Rotary Encoder

 D400 transistor




I hope you have watched my previous project made to create arduino LED clock with setnfix. The wiring for SSDs are as same as that project.



www.setnfix.com/2020/02/arduino-led-rtc-clock-with-seconds-and.html

However, I have made some changes by doing some experiments. Specially I have used only NPN transistors instead of using both NPN and PNP transistors.

2. There is a Rotary encoder to set the time and change the time as well.

3.A switch is fixed to change the 12h mode to 24 hours mode.

Operation
Main part of this project is atmega 328 programming IC and it is connected RTC module DS 3231. The RTC module has a battery cell and it can be sored the current time. Therefore, even the device power is down, once the power came the correct time will be displayed.


Time display using DIY SSDs with LED bulbs. those are powered by NPN transistors (D400). In order to display the time multiplex method is used.

Adjustment
Just the programme is uploaded, the computer time will be displayed.

1. Press one time the rotary encoder to change the minutes : you can up and down the minutes by rotating the rotary encoder.

2. Press one more time the rotary encoder to change the Hours: you can up and down the hours by rotating the rotary encoder. after the 12 noon, it will show 13,14,15 etc up to 23 and the 24 will be displayed as0.

3.Press again to save the time. As press the 3rd time, the seconds will be "00" with saving the time.

24/12 hour mode
** You can change the mode from 24 hour to 12 hour by pressing the button switch.


List of Items

Atmega 328p :
https://s.click.aliexpress.com/e/_Ar9cvT

DS3231 RTC module : https://s.click.aliexpress.com/e/_9HuQMt

D400/2n2222 transistors : https://s.click.aliexpress.com/e/_9jYHU9

Red LED bulbs : https://s.click.aliexpress.com/e/_A2rVtR

Rotary Encoder : https://s.click.aliexpress.com/e/_AaU7Kh




Circuit Diagram


The code is as follows;


  
  /*
This is programmed by BMIAK Basnayaka for SETNFIX youtube channel.
www.setnfix.com
youtube.com/setnfix
Date June 6th 2022

***************************************************************************
Operation
Main part of this project is atmega 328 programming IC and it is connected RTC module DS 3231. The RTC module has a battery cell and it can be sored the current time. Therefore, even the device power is down, once the power came the correct time will be displayed.
Time display using DIY SSDs with LED bulbs. those are powered by NPN transistors (D400). In order to display the time multiplex method is used.

Adjustment
Just the programme is uploaded, the computer time will be displayed. 

1. Press one time the rotary encoder to change the minutes : you can up and down the minutes by rotating the rotary encoder.
2. Press one more time the rotary encoder to change the Hours: you can up and down the hours by rotating the rotary encoder. after the 12 noon, it will show 13,14,15 etc up to 23 and the 24 will be displayed as0.
3.Press again to save the time. As press the 3rd time, the seconds will be "00" with saving the time.
24/12 hour mode
** You can change the mode from 24 hour to 12 hour by pressing the button switch.

List of Items

Atmega 328p :  https://s.click.aliexpress.com/e/_Ar9cvT
DS3231 RTC module : https://s.click.aliexpress.com/e/_9HuQMt
D400/2n2222 transistors : https://s.click.aliexpress.com/e/_9jYHU9
Red LED bulbs : https://s.click.aliexpress.com/e/_A2rVtR
Rotary Encoder : https://s.click.aliexpress.com/e/_AaU7Kh

The circuit diagram and the codes cab be seen in the youtube posts.


*/
// modified connexion by niq_ro from http://nicuflorica.blogspot.com
// dataseet: http://www.tme.eu/ro/Document/dfc2efde2e22005fd28615e298ea2655/KW4-563XSA.pdf

#include 
#include "RTClib.h"
RTC_DS3231 rtc;
int sH;
int sM;
byte minutes1 = 0;
byte hours1 = 0;
byte minutes = 0;
byte hours = 0;
int OldScnd=0;

int digit1 = 3; // 15
int digit2 = 5;//12
int digit3 = 6; //11
int digit4 = 9;//5
int digit5 = 10; //3
int digit6 = 11; //2

int segA = 0; //Display pin 18
int segB = 1; //Display pin 17
int segC = 2; //Display pin 16
int segD = 4; //Display pin 14
int segE = 7; //Display pin 13
int segF = 8; //Display pin 6
int segG = 12; //Display pin 4


int hPin = A0;
int segDP = A1; // AM/PM LED

int encoder0PinA = A2;
int encoder0PinB = A3;
int encoder0Pos = 0;
int encoder0PinALast = LOW;
int n = LOW;
const int buttonPin = 13;
// Variables will change:
int ledState = HIGH;         // the current state of the output pin
int buttonState;             // the current reading from the input pin
int lastButtonState = LOW;   // the previous reading from the input pin
int reading = 0;
int dUP = 0;

// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0;  // the last time the output pin was toggled
unsigned long debounceDelay = 50;    // the debounce time; increase if the output flickers


int clickPin = 0;
int clickNow = 0;

/*
  // Date and time functions using a DS1307 RTC connected via I2C and Wire lib
  // original sketck from http://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/
  // add part with SQW=1Hz from http://tronixstuff.wordpress.com/2010/10/20/tutorial-arduino-and-the-i2c-bus/
  // add part with manual adjust http://www.bristolwatch.com/arduino/arduino_ds1307.htm

*/

// use for hexa in zecimal conversion
int zh, uh, ore;
int zm, um, miniti;

void setup() {


  {
    //Serial.begin(9600);
    delay(3000); // wait for console opening

    if (! rtc.begin()) {
      Serial.println("Couldn't find RTC");
      while (1);
    }

    if (rtc.lostPower()) {
      Serial.println("RTC lost power, lets set the time!");

      // Comment out below lines once you set the date & time.
      // Following line sets the RTC to the date & time this sketch was compiled
      rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));

      // Following line sets the RTC with an explicit date & time
      // for example to set January 27 2017 at 12:56 you would call:
      //rtc.adjust(DateTime(2017, 1, 27, 12, 56, 0));
    }
  }

  pinMode(segA, OUTPUT);
  pinMode(segB, OUTPUT);
  pinMode(segC, OUTPUT);
  pinMode(segD, OUTPUT);
  pinMode(segE, OUTPUT);
  pinMode(segF, OUTPUT);
  pinMode(segG, OUTPUT);
  pinMode(segDP, OUTPUT);
  pinMode(hPin,INPUT_PULLUP);

  pinMode(digit1, OUTPUT);
  pinMode(digit2, OUTPUT);
  pinMode(digit3, OUTPUT);
  pinMode(digit4, OUTPUT);
  pinMode(digit5, OUTPUT);
  pinMode(digit6, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode (encoder0PinA, INPUT);
  pinMode (encoder0PinB, INPUT);

}




void loop() {

  //DateTime now = Myset.now();
  DateTime now = rtc.now();

  reading = digitalRead(buttonPin);

  if (reading != lastButtonState) {
    // reset the debouncing timer
    lastDebounceTime = millis();
  }

  if ((millis() - lastDebounceTime) > debounceDelay) {
    // whatever the reading is at, it's been there for longer than the debounce
    // delay, so take it as the actual current state:

    // if the button state has changed:
    if (reading != buttonState) {
      buttonState = reading;

      // only toggle the LED if the new button state is HIGH
      if (buttonState == LOW) {
        clickPin = clickPin + 1;
        delay(500);
      }
    }
  }

  //if (clickPin > 3) {clickPin =0;}
  // save the reading. Next time through the loop, it'll be the lastButtonState:
  lastButtonState = reading;

  if (clickPin==0){//*********************************************************

  DateTime future (now + TimeSpan(0, 0, 0, 0));

  long timp = future.hour() * 10000UL + future.minute() * 100 + future.second();
  Serial.println(" timp : ");
  Serial.print(timp);
sM = future.minute(); // load current minute for adjustment
sH = future.hour(); // load current hours for adjustment

//*************************************************************************************
//24 details code 
//*************************************************************************************

int hData = digitalRead(hPin);
if (hData ==0){

  if (timp > 130000){
    timp = timp - 120000;
  }

}

//*************************************************************************************
//24 details code END
//*************************************************************************************

//----------------------------------------------------------------------------

  for (int i = 10 ; i > 0  ; i--) {
    if (timp >= 100000) displayNumber01(timp);
    else displayNumber02(timp);
  }

  }//*********************************************************



  
Serial.println(clickPin);

//*************************************************************************************
// Code for Segment LEDS
//*************************************************************************************
int Scnd = now.second();

if (Scnd != OldScnd){
          if (Scnd % 2==0){
            digitalWrite(segDP,HIGH);} else{digitalWrite(segDP,LOW);}
          }

 OldScnd = Scnd;
 //*************************************************************************************
 // Code for Segment LEDS END
 //*************************************************************************************

//*************************************************************************************
if (clickPin > 0){ // Editing Mode Started---------------------------------------------
//*************************************************************************************
  
n = digitalRead(encoder0PinA);
   if ((encoder0PinALast == LOW) && (n == HIGH)) {
     if (digitalRead(encoder0PinB) == LOW) {

            if (clickPin==1){sM = sM-1;delay(5); if (sM < 0)sM =59;delay(5);}
            if (clickPin==2){sH=sH-1; delay(5);if (sH < 0)sH =23;delay(5);}
            delay(100);
       
     } else {

            if (clickPin==1){sM = sM +1;delay(5); if (sM > 59)sM =0; delay(5);}
            if (clickPin==2){sH=sH+1;delay(5); if (sH > 23)sH =0;delay(5);}
           delay(100);
     }
     }
encoder0PinALast = n;
//DateTime now = rtc.now();
//Serial.println("H : ");
//Serial.println(future.hour(),DEC);

long timp = sH * 10000UL + sM *100;

  for (int i = 20 ; i > 0  ; i--) {
    if (timp >= 100000) displayNumber01(timp);
    else displayNumber02(timp);
  }

if (clickPin > 2){
   //DateTime future (now + TimeSpan(0, sH, sM, 0));
rtc.adjust(DateTime(1985, 4, 7, sH,sM, 0));
//rtc.adjust(DateTime(2017, 1, 27, 12, 56, 0));
delay(500);
sH=0;
sM=0;


clickPin=0; // reset the pin after saving time
  
}

//*************************************************************************************  
  }// Editing Mode END````````````````````````````````````````````````````````````````
//*************************************************************************************
  

}//===========================VOID LOOP END==============================================



void displayNumber01(long toDisplay) {
#define DISPLAY_BRIGHTNESS  25

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  for (int digit = 6 ; digit > 0 ; digit--) {

    //Turn on a digit for a short amount of time
    switch (digit) {
      case 1:
        digitalWrite(digit1, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 2:
        digitalWrite(digit2, DIGIT_ON);
        //digitalWrite(segDP, LOW);
        break;
      case 3:
        digitalWrite(digit3, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 4:
        digitalWrite(digit4, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 5:
        digitalWrite(digit5, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 6:
        digitalWrite(digit6, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;

    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;
    delayMicroseconds(DISPLAY_BRIGHTNESS);

    //Turn off all segments
    lightNumber(10);

    //Turn off all digits
    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
    digitalWrite(digit5, DIGIT_OFF);
    digitalWrite(digit6, DIGIT_OFF);
  }
}

void displayNumber02(long toDisplay) {
#define DISPLAY_BRIGHTNESS  25

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  for (int digit = 6 ; digit > 0 ; digit--) {

    //Turn on a digit for a short amount of time
    switch (digit) {
      case 1:
        lightNumber(10);
        //digitalWrite(segDP, HIGH);
        break;
      case 2:
        digitalWrite(digit2, DIGIT_ON);
        //digitalWrite(segDP, LOW);
        break;
      case 3:
        digitalWrite(digit3, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 4:
        digitalWrite(digit4, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 5:
        digitalWrite(digit5, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 6:
        digitalWrite(digit6, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;
    delayMicroseconds(DISPLAY_BRIGHTNESS);

    //Turn off all segments
    lightNumber(10);

    //Turn off all digits
    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
    digitalWrite(digit5, DIGIT_OFF);
    digitalWrite(digit6, DIGIT_OFF);
  }
}

void displayNumber03(long toDisplay) {
#define DISPLAY_BRIGHTNESS  25

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  for (int digit = 6 ; digit > 0 ; digit--) {

    //Turn on a digit for a short amount of time
    switch (digit) {
      case 1:
        digitalWrite(digit1, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 2:
        digitalWrite(digit2, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 3:
        digitalWrite(digit3, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 4:
        digitalWrite(digit4, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 5:
        digitalWrite(digit5, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 6:
        digitalWrite(digit6, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;
    delayMicroseconds(DISPLAY_BRIGHTNESS);

    //Turn off all segments
    lightNumber(10);

    //Turn off all digits
    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
    digitalWrite(digit5, DIGIT_OFF);
    digitalWrite(digit6, DIGIT_OFF);
  }
}

void displayNumber04(long toDisplay) {
#define DISPLAY_BRIGHTNESS  25

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  for (int digit = 4 ; digit > 0 ; digit--) {

    //Turn on a digit for a short amount of time
    switch (digit) {
      case 1:
        lightNumber(10);
        //digitalWrite(segDP, HIGH);
        break;
      case 2:
        digitalWrite(digit2, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 3:
        digitalWrite(digit3, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 4:
        digitalWrite(digit4, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 5:
        digitalWrite(digit5, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 6:
        digitalWrite(digit6, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;
    delayMicroseconds(DISPLAY_BRIGHTNESS);

    //Turn off all segments
    lightNumber(10);

    //Turn off all digits
    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
    digitalWrite(digit5, DIGIT_OFF);
    digitalWrite(digit6, DIGIT_OFF);
  }
}

void displayNumber05(long toDisplay) {
#define DISPLAY_BRIGHTNESS  25

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  for (int digit = 6 ; digit > 0 ; digit--) {

    //Turn on a digit for a short amount of time
    switch (digit) {
      case 1:
        digitalWrite(digit1, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 2:
        digitalWrite(digit2, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 3:
        digitalWrite(digit3, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 4:
        digitalWrite(digit4, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 5:
        digitalWrite(digit5, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
      case 6:
        digitalWrite(digit6, DIGIT_ON);
        //digitalWrite(segDP, HIGH);
        break;
    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;
    delayMicroseconds(DISPLAY_BRIGHTNESS);

    //Turn off all segments
    lightNumber(10);

    //Turn off all digits
    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
    digitalWrite(digit5, DIGIT_OFF);
    digitalWrite(digit6, DIGIT_OFF);
  }
}

void displayNumber06(long toDisplay) {
#define DISPLAY_BRIGHTNESS  25

#define DIGIT_ON  HIGH
#define DIGIT_OFF  LOW

  for (int digit = 6 ; digit > 0 ; digit--) {

    //Turn on a digit for a short amount of time
    switch (digit) {
      case 1:
        digitalWrite(digit1, DIGIT_ON);
       // //digitalWrite(segDP, HIGH);
        break;
      case 2:
        digitalWrite(digit2, DIGIT_ON);
        ////digitalWrite(segDP, HIGH);
        break;
      case 3:
        digitalWrite(digit3, DIGIT_ON);
        ////digitalWrite(segDP, HIGH);
        break;
      case 4:
        digitalWrite(digit4, DIGIT_ON);
        ////digitalWrite(segDP, HIGH);
        break;
      case 5:
        digitalWrite(digit5, DIGIT_ON);
        ////digitalWrite(segDP, HIGH);
        break;
      case 6:
        digitalWrite(digit6, DIGIT_ON);
        ////digitalWrite(segDP, HIGH);
        break;
    }
    lightNumber(toDisplay % 10);
    toDisplay /= 10;
    delayMicroseconds(DISPLAY_BRIGHTNESS);

    //Turn off all segments
    lightNumber(10);

    //Turn off all digits
    digitalWrite(digit1, DIGIT_OFF);
    digitalWrite(digit2, DIGIT_OFF);
    digitalWrite(digit3, DIGIT_OFF);
    digitalWrite(digit4, DIGIT_OFF);
    digitalWrite(digit5, DIGIT_OFF);
    digitalWrite(digit6, DIGIT_OFF);
  }
}
//Given a number, turns on those segments
//If number == 10, then turn off number
void lightNumber(int numberToDisplay) {

#define SEGMENT_ON  HIGH
#define SEGMENT_OFF LOW

  switch (numberToDisplay) {

    case 0:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_ON);
      digitalWrite(segF, SEGMENT_ON);
      digitalWrite(segG, SEGMENT_OFF);
      break;

    case 1:
      digitalWrite(segA, SEGMENT_OFF);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_OFF);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_OFF);
      digitalWrite(segG, SEGMENT_OFF);
      break;

    case 2:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_OFF);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_ON);
      digitalWrite(segF, SEGMENT_OFF);
      digitalWrite(segG, SEGMENT_ON);
      break;

    case 3:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_OFF);
      digitalWrite(segG, SEGMENT_ON);
      break;

    case 4:
      digitalWrite(segA, SEGMENT_OFF);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_OFF);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_ON);
      digitalWrite(segG, SEGMENT_ON);
      break;

    case 5:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_OFF);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_ON);
      digitalWrite(segG, SEGMENT_ON);
      break;

    case 6:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_OFF);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_ON);
      digitalWrite(segF, SEGMENT_ON);
      digitalWrite(segG, SEGMENT_ON);
      break;

    case 7:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_OFF);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_OFF);
      digitalWrite(segG, SEGMENT_OFF);
      break;

    case 8:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_ON);
      digitalWrite(segF, SEGMENT_ON);
      digitalWrite(segG, SEGMENT_ON);
      break;

    case 9:
      digitalWrite(segA, SEGMENT_ON);
      digitalWrite(segB, SEGMENT_ON);
      digitalWrite(segC, SEGMENT_ON);
      digitalWrite(segD, SEGMENT_ON);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_ON);
      digitalWrite(segG, SEGMENT_ON);
      break;

    // all segment are ON
    case 10:
      digitalWrite(segA, SEGMENT_OFF);
      digitalWrite(segB, SEGMENT_OFF);
      digitalWrite(segC, SEGMENT_OFF);
      digitalWrite(segD, SEGMENT_OFF);
      digitalWrite(segE, SEGMENT_OFF);
      digitalWrite(segF, SEGMENT_OFF);
      digitalWrite(segG, SEGMENT_OFF);
      break;

  }

} // ending the code
  

    

The circuit diagram can be seen in the youtube posts as well.
Download the Code : bit.ly/3HCpwWt


Saturday 22 January 2022

Programming DS 3231 RTC module with Arduino



DS3231 is a low-cost, extremely accurate I2C
real-time clock (RTC), with an integrated temperature-compensated crystal
oscillator (TCXO) and crystal. The device incorporates a battery input,
disconnect the main power supply and maintains accurate timekeeping. Integrated
oscillator improve long-term accuracy of the device and reduces the number of
components of the production line. The DS3231 is available in commercial and
industrial temperature ranges, using a 16-pin 300mil SO package.

Buy now the module with a discount DS3231 Module

RTC maintains seconds, minutes, hours, day, date,
month, and year information. Less than 31 days of the month, the end date will
be automatically adjusted, including corrections for leap year. The clock
operates in either the 24 hours or band / AM / PM indication of the 12-hour
format. Provides two configurable alarm clock and a calendar can be set to a
square wave output. Address and data are transferred serially through an I2C
bidirectional bus.



 



Module
parameters:



1. Size:
38mm (length) * 22mm (W) * 14mm (height)



2.
Weight: 8g



3.
Operating voltage :3.3 - 5 .5 V



4. Clock
chip: high-precision clock chip DS3231



5. Clock
Accuracy :0-40 range, the accuracy 2ppm, the error was about 1 minute



6.
Calendar alarm clock with two



7.
Programmable square-wave output



8. Real
time clock generator seconds, minutes, hours, day, date, month and year timing
and provide valid until the year 2100 leap year compensation



9. Chip
temperature sensor comes with an accuracy of ± 3



10.
Memory chips: AT24C32 (storage capacity 32K)



11. IIC
bus interface, the maximum transmission speed of 400KHz (working voltage of 5V)



12. Can
be cascaded with other IIC device, 24C32 addresses can be shorted A0/A1/A2
modify default address is 0x57



13. With
rechargeable battery LIR2032, to ensure the system after power failure, the
clock move any natural normal



14.
Packing: single anti-static packaging



 





Wiring
instructions ( for Arduino uno r3 for example):



SCL → A5



SDA → A4



VCC → 5V



GND → GND



 This is an introduction video about DS 3231 RTC module which
I am going to use in LED clock building. There are 6 pins, but I am using only
4 pins for this purpose.



Connect ground pin of the module to the ground of Arduino,
and connect VCC pin of the module to the arduino 5 volt pin. Then connect SDA
pin of the module to the arduino analog pin number 4 and the SCL pin of the
module to the arduino analog pin number 5.








Now the wiring part is over. You can test the module with
serial monitor. Before that, you have to download the DS 3231 library. The link
to download is given below.



Once the zip file is downloaded, open the arduino software
and go to 

Sketch > include Library > add Zip library.



From the opened window, navigate the location of the library
zip file is downloaded and select the file then ADD.




Library is now added.



Download the code from the link given below and upload to
the arduino.

After the code is uploaded, you can open the serial monitor
to check the time.





Study the programme as you need to work with this in future
as well.



I hope you understand the basics about the DS 3231 RTC
module.



Stay with setnfix. 


Monday 13 September 2021

Car Battery Faults indicator : Low/Charge/Good and Engine Start/Alternator Testing




Due to the travel restrictions, i was unable to start my car around one week.

However, a day, I had an important work and I tried to start the car. The car did not start.

Then I checked the battery and the battery level was 8.7 volts. It is impossible. then I checked an un usual power consumption even the car is stopped. There was a simple wire short.

That time, I thought that if there is a way to notify that the low battery, It would be a great help to avoid such difficulties.

Therefore, I decided to create this circuit and tested well.


You can build this on a vero board or on a PCB as follows.



Battery is Good, But need to be charged

Alternator is working well, Battery is good and the car engine started

Battery is low/bad





Watch the details.







Sunday 5 September 2021

How to activate any Microsoft Office Package for Free

Microsoft office package is the most of users are using for personal and official documents, calculations and data base requirements. However, it is more high risk to use a crack software as there may be virus harm to you device. Therefore, This tutorial will help you to solve that issue.

Follow these steps and activate your office package.


STEP 01 :

1st you have to find the Microsoft office package version. You can find it visiting Files > Account.


STEP 02 :

Then find the path of the software installed in your computer



STEP 03 :

Then Copy the path

STEP 04 :

Now, Open the File given in the following link and paste the path as follows



STEP 05 :

Then copy a serial key as suitable to your Ms Office package and paste as follows.


STEP 06 :

Now Search "CMD" and Run as Administrator the Command Prompt


STEP 07 :
Now Copy the 1st code in the text file and press on the command prompt and press enter.


STEP 08 :
Now Copy the 2nd code in the text file and press on the command prompt and press enter. Wait a while....



STEP 09 :
Now Copy the 3rd code in the text file and press on the command prompt and press enter. Wait a while....



STEP 10 :
Now Copy the 4th code in the text file and press on the command prompt and press enter. Wait a while....


Now you can see the activation is successful message.



Download the file


Watch For More