Friday, September 5, 2025

ATS Control Card with PIC16F88 (Prototype 2)

Terminal blocks: as you can seen in the pictures, i would like to start from terminal blocks as the right most terminal block with three screws on it, is being used for sensing the presence of 220V supplies from the mains and the GENSET. The middle screw is for neutral wires which are jumped together from both power sources. Whereas the side screws are for phase wires from both power sources. It is labelled on the board which screw is for mains and which one is for GENSET. Second terminal block from the right is for providing any 5V logic input to the controller from any outside device which may be required for any other function. The third terminal from right is being used to provide power to the circuit board it is usually 12VDC and comes from the battery of GENSET. Next terminals consisting of two screws are respectively for switch RELAY, crank RELAY and changeover RELAY driven by microcontroller's selected GPIOs.

Transformers: In this prototype we used 220V to 12V step down transformers for shifting down the level of input signal, suitable for PIC16F88 microcontroller sensing.

Rectifiers: we used two rectifiers of 1Amp to convert the signal from 12VAC to 12VDC for further conditioning, each line has a separate rectifier on it after transformer.

Regulators: after rectifiers input signal is further passed through 7805 voltage regulators and 5V signal is then applied to the selected GPIOs of PIC16F88 supported with 10K pull-down resistors. These input power sensing lines also have 470uf capacitor on each line for signal stability.

Microcontroller: in this prototype we used PIC16F88 microcontroller which senses the presence of mains or GENSET power signal on its selected input GPIOs and performs the following functions.

--> If mains is present and GENSET is not present just make sure to keep all output RELAYS in off position.

--> If mains is off and GENSET is also off, controller waits for 30 seconds and then energizes the switch RELAY, waits for another 2 seconds and then energizes the crank RELAY for 4 seconds, looks for input power signal from GENSET if it is not present for 10 consecutive seconds, controller again energizes the crank RELAY for 4 seconds and repeats the same check and do process for 6 times if it senses the power signal input from GENSET is present then keeps the switch RELAY on, keeps the crank RELAY off and energizes the changeover RELAY for shifting the utility load to the GENSET.

--> in third case when mains supply is restored, the controller senses its presence via one of its selected input GPIO and waits for 10 seconds then turns off the changeover RELAY then waits for 3 seconds and then turns off the switch RELAY which causes the GENSET to turn off.

--> if both supplies are off the controller tries to start the GENSET via same process described above in case two.

🔶 Relay 1 (Switch Relay) 🔶 Relay 2 (Cranking Relay) 🔶 Relay 3 (Transfer Relay)

LED indicators: in this prototype, we also added the LEDs for separate functions, Red LED indicates the mains power and one of the Green is for GENSET power. While the other Green LED is for switch RELAY. Orange LED indicates for the crank RELAY and the white LED is for changeover RELAY.

IC sockets: a UlN2003 i.c is also present between the outputs of PIC16F88 and output RELAYS, which helps driving the 12VDC relays with the 5V logic signal from the microcontroller's output pins.

Note: Specifically in this prototype more effort were put in improving the PCB design of the circuit









Read More

Thursday, September 4, 2025

Automatic Changeover Controller (ATS) Control Card with PIC16F88 (Version 1)


🔌 Automatic Changeover Controller (Prototype V1)

1. Terminal Blocks

  • 12V DC Input Block (2 screws):

    Supplies regulated 12VDC to the circuit, typically from the GENSET battery, to power the controller.

  • AC Sensing Block (3 screws):

    Used for sensing 220V AC signals from both mains and GENSET.
    • Middle screw → Neutral line (common for both supplies).
    • Side screws → Phase line of mains and phase line of GENSET.
    • Each screw is clearly labeled on the PCB.
  • Relay Control Blocks (2 screws each):

    Connected to:
    1. Switch Relay

    2. Crank Relay

    3. Changeover Relay Driven by microcontroller GPIOs.

2. Transformers

  • Step-down Transformers (220V → 12V):

    Used to reduce mains and GENSET phase signals to a safe level for the microcontroller.


3. Rectifiers

  • Two rectifiers (1A rating):

    Each phase signal passes through a separate rectifier, converting 12VAC → 12VDC for conditioning.


4. Voltage Regulators

  • 7805 Regulators:
    Convert rectified 12VDC signals to 5VDC.

  • Signal Conditioning:
    • Each sensing line includes a 10kΩ pull-down resistor (ensures clean logic levels).
    • 470µF capacitors are used on each line for stability and noise suppression.

5. Microcontroller (PIC16F88)

The PIC16F88 monitors input signals and controls relays accordingly.

Controller Logic:

  1. Case 1 – Mains Present, GENSET Off

    → Keep all relays OFF.

  2. Case 2 – Mains Off, GENSET Off

    • Wait 30s, energize Switch Relay.
    • After 2s, energize Crank Relay for 4s.
    • Check GENSET signal for 10s.

      • If not detected, repeat crank cycle (up to 6 attempts).
    • Once GENSET detected →

      • Keep Switch Relay ON, Crank Relay OFF.
      • Energize Changeover Relay → Load shifts to GENSET.
  3. Case 3 – Mains Restored

    • Detect mains presence.
    • Wait 10s, then turn OFF Changeover Relay (load back to mains).
    • After 3s, turn OFF Switch Relay → GENSET turns off.
  4. Case 4 – Both Supplies Off

    • Retry GENSET startup process (same as Case 2).

6. Relays

  • Relay 1 – Switch Relay: Turns ON GENSET.
  • Relay 2 – Cranking Relay: Engages GENSET starter motor.
  • Relay 3 – Transfer (Changeover) Relay: Switches load between mains and GENSET.

7. Relay Driver IC

  • ULN2003:
    Acts as an interface between 5V microcontroller outputs and 12V relay coils.
    Provides current amplification and safe isolation.













Read More

Sunday, June 1, 2025

PCB and Schematic Designer using Altium


I am a professional in Schematic and PCB designing by using Altium.

I am a Professional in 

I am selling my services to develop your projects.









Contact me by Email:

elektrogarage18@gmail.com

Read More

Thursday, December 7, 2023

What is NOT Logic Gate



What is logic?

In digital we define some conditions of anything in two states that are 0 and 1 for example switch conditions possibly open and close so in digital it will be 0 and 1 respectively Same as down up, left-right, off ON and false true, etc.

Due to the electronics field, we deal with current and voltages so according to the voltages we have two levels as shown in the following.


Now here we will discuss the NOT Logic.

NOT Logic Gate

NOT Gate performs the function to invert the logic. If the input is 0 then the output will be 1 and if the input is 1 then the output will be 0.

Symbol of NOT Logic Gate


Truth Table

we can understand the NOT (inverter) function by a simple electrical circuit.

 
S1 close LED will be OFF
S1 open LED will be ON

RTL of NOT Gate 

Resistor Transistor Logic (based circuit)

by using the switching mode of the transistor to understand the

working of RTL NOT gate.

working of RTL NOT gate.

Input 0: Q1 will be in off condition and current flow toward output through R1 means output 1.

Input 1: Q1 will be ON and current flow through Q1 and R1 and ground. Max voltage drop across R1. (VCE = VCC – ICRC) and the output will be 0.

CMOS (basic circuit is) NOT gate 

CMOS is Complementary to MOS which means in this logic NMOS and PMOS twice are used. CMOS basic circuit is NOT gate.

If input A=0:

When input A=0 then PMOS will be ON and NMOS will be OFF and the current flows through output so output logic = 1.

If input A=1:

When input A = 1 then PMOS will be OFF and NMOS will be off Now current flow through PMOS and output so the output is 0.

Read More

Wednesday, December 6, 2023

Water Level Indicator Digital Logic Design based with Alarm

 

Water Level Indicator Digital Logic Design based with Alarm

What is a Water level Indicator?

A water level indicator is a device used for an indication of the water level in the water tank. So that the operator of the water pump knows the level and operates the motor to fill it again or take any particular required action.

Application of Water Level Indicator

Mostly this device is used as an assignment for Digital Logic Design students to complete. But this is very useful at the domestic level as well as for small industry for to automate the water level of water tanks.

Water level indicator circuit story

Here we have used only the logic gates game to complete this Project. It was very complicated to make the logic in the scenario of the water tank.

look at the scene here

Water level sensor

Water Level Sensor

we have used PVC pipe in the tank and adjusted wires according to the diagram of the tank. all wire connections are terminated at PNP Transistor 3906 Q1, Q2,Q3 and Q4 base terminal through resistor.

Water level sensor principle 

GND wire is in the bottom of the tank and other wires are at different water levels. when any level wire connects with GND through water then that PNP transistor switches ON and current flow through the emitter to the collector Max voltage drop across the 1k ohm resistor at the collector. 
when the water level drops from the wire approximately 0 voltage appears across a 1k ohm resistor.
So now it's simple to make the logic that could be in the form of DLD, any Microcontroller, Arduino, etc.
So here we are making the logic of the water tank.

Truth Table

When the Tank is at 0% (empty) the Motor will start using NAND Logic and stop when the tank will touch 100% (Full).

DLD based Water level Indicator with an alarm

The motor is not only dependent on the NAND gate because if the level drops from 100% then again motor will start but we want to ON the motor again at 0%. So we apply NAND output at the input of D Flip Flop. Now the rising edge is required to pass the logic.

For the D-FF clock signal we use the AND gate and NOR gate at the same inputs (Table of all Gates is given above Table) 
see the working
At 0% NAND gate sends logic 1 at D and at the same time, XOR will send an enable rising signal to D-FF So the output of D-FF will be high due to which the motor starts by the motor driver circuit. The motor will remain ON until the status of D-FF is changed. 
So Now when the tank reaches 100% of the level the NAND gate sends 0 at D-FF and again XOR gate will send the rising signal at the clock and D-FF will transfer 0 at output and the motor will stop until again status of D-FF changes. The status of D-FF will change at 0% or at 100%.

ALARM: The alarm will start by NOR Gate Output because here water tank is at 0%.

Motor Driver Circuit

Motor Driver Circuit


D-FF output terminated at R5. An NPN transistor 3904 uses BJT as a Switch to operate the SPDT relay to drive the motor. 

Water Level Indicator 

Water level Indicator

LEDs are used to indicate the percentage level of the water. All LEDs are connected with respective water-level transistors through 220 ohms resistors. 

Now here is the full Circuit of DLD based Water level Indicator with an alarm 

DLD based Water level Indicator with an alarm

 
Read More

Important Artical

Popular Articals

Total Page views in This Month

© 2019-20 Electronics Garage. Designed by Uzma 0101 & Distributed by elektronicsgarage1.blogspot.com