Interfacing of Arduino with 74HC595 & 74HC165
Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you How to Interface Arduino with 74HC595 & 74HC165. I have already interfaced these shift registers separately with Arduino. In the first tutorial we have seen
Arduino 74HC595 Interfacing in which I have discussed How to increase the output pins of Arduino using 74HC595. After that in second tutorial we have seen
Arduino 74HC165 Interfacing where we have increased the input pins of Arduino.
So, now we are gonna interface both of these shift registers with
Arduino UNO and will increase both input and output pins of Arduino. I have also given the Proteus simulations for download at the end of this tutorial along with Arduino code. So, lets get started with Interfacing of Arduino with
74HC595 & 74HC165:
Interfacing of Arduino with 74HC595 & 74HC165
- As you can see in above figure, I have used 74HC165 & 74HC595 and interfaced its pins with Arduino UNO.
- I could use same clock for these shift registers but it would have made the code quite complex.
- That's why I have used separate clock pins and I have used the below code to reflect the input on output.
#define NUMBER_OF_SHIFT_CHIPS 1
#define DATA_WIDTH NUMBER_OF_SHIFT_CHIPS * 8
#define TotalIC 2
#define TotalICPins TotalIC * 8
int LoadPin = 8;
int EnablePin = 9;
int DataPin = 11;
int ClockPin = 12;
int RCLK = 5;
int SER = 6;
int SRCLK = 7;
unsigned long pinValues;
unsigned long oldPinValues;
boolean Data[TotalICPins];
void setup()
{
Serial.begin(9600);
pinMode(LoadPin, OUTPUT);
pinMode(EnablePin, OUTPUT);
pinMode(ClockPin, OUTPUT);
pinMode(DataPin, INPUT);
digitalWrite(ClockPin, LOW);
digitalWrite(LoadPin, HIGH);
Serial.println("Visit us at www.TheEngineeringProjects.com");
Serial.println();
pinMode(SER, OUTPUT);
pinMode(RCLK, OUTPUT);
pinMode(SRCLK, OUTPUT);
ClearBuffer();
pinValues = read_shift_regs();
print_byte();
oldPinValues = pinValues;
}
void loop()
{
pinValues = read_shift_regs();
if(pinValues != oldPinValues)
{
print_byte();
oldPinValues = pinValues;
}
}
unsigned long read_shift_regs()
{
long bitVal;
unsigned long bytesVal = 0;
digitalWrite(EnablePin, HIGH);
digitalWrite(LoadPin, LOW);
delayMicroseconds(5);
digitalWrite(LoadPin, HIGH);
digitalWrite(EnablePin, LOW);
for(int i = 0; i < DATA_WIDTH; i++)
{
bitVal = digitalRead(DataPin);
bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));
digitalWrite(ClockPin, HIGH);
delayMicroseconds(5);
digitalWrite(ClockPin, LOW);
}
return(bytesVal);
}
void print_byte() {
byte i;
Serial.println("*Shift Register Values:*\r\n");
for(byte i=0; i<=DATA_WIDTH-1; i++)
{
Serial.print("P");
Serial.print(i+1);
Serial.print(" ");
}
Serial.println();
for(byte i=0; i<=DATA_WIDTH-1; i++)
{
Serial.print(pinValues >> i & 1, BIN);
Data[i] = pinValues >> i & 1, BIN;
//if(BinaryValue == 1){Data[i] = HIGH;}
//if(BinaryValue == 0){Data[i] = LOW;}
UpdateData();
if(i>8){Serial.print(" ");}
Serial.print(" ");
}
Serial.print("\n");
Serial.println();Serial.println();
}
void ClearBuffer()
{
for(int i = TotalICPins - 1; i >= 0; i--)
{
Data[i] = LOW;
}
UpdateData();
}
void UpdateData()
{
digitalWrite(RCLK, LOW);
for(int i = TotalICPins - 1; i >= 0; i--)
{
digitalWrite(SRCLK, LOW);
digitalWrite(SER, Data[i]);
digitalWrite(SRCLK, HIGH);
}
digitalWrite(RCLK, HIGH);
}
- In the above code, I have used Number_of_Shift_Chips 1 and it means I am using 1 chip each, so in total 2 chips.
- Now get hex file from Arduino software and upload it in your Proteus software.
- Run your simulation and if everything goes fine then you will get something as shown in below figure:
- You can see in above figure that all those LED outputs are ON which has HIGH inputs.
- I have also attached a Virtual Terminal with Arduino to have a look at the input bits.
- Now let's add 2 chips of 74HC165 and 74HC959, so design a simple simulation as shown in below figure:
- Now in your above code change the Number of Shift chips from 1 to 2, as now we are using 2 chips each.
- Upload your hex file and if everything goes fine then you will get similar results:
- So, that's how you can easily increase input and output pins of Arduino UNO.
- I have just designed a simple code but you can work on it and can control these inputs separately as well.
- You can interface different digital sensors on these input pins and can control motors, relays, solenoids etc. at output pins.
- You can download both of these Proteus Simulations along with Arduino code by clicking the below button, but I would suggest you to dwsign it on yoru own so that you could learn from mistakes.
[dt_default_button link="https://theengineeringprojects.com/ArduinoProjects/Interfacing%20of%20Arduino%20with%2074HC595%20&%2074HC165.zip" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Arduino Code [/dt_default_button]
So, that was all about Interfacing of Arduino with 74HC595 & 74HC165. I hope you can now easily simulate it. If you have any questions then ask in comments and I will try my best to resolve them. Thanks for reading. Take care !!! :)
Introduction to CR1220
Hi Fellas! Hope you are getting along with life pretty well. I am back to give you a daily dose of useful information. Today, I'll unlock the details on the
Introduction to CR1220. It is known as a lithium coin battery that comes with a high voltage around 3V and encompasses an ultra-compact design, helping you gid rid of the hassle of buying two or three extra traditional batteries, saving both cost and space required to adjust these cells in the relevant devices.
In this post, I'll try to cover each and everything related to CR1220, breaking down its details in simple steps you can get a hold what is this about and how it is used for. Let's dive in and explore everything you need to know about this battery.
Introduction to CR1220
- CR1220 is a button cell, also known as lithium coin battery, that is mainly used in high power devices such as keyless entry devices, glucose monitors, heart-rate monitors, and toys & games.
- It comes in cylindrical shape and can retain power for a maximum period of time. If it is spared alone for one year, it will discharge only 1% of the total battery capacity.
- This battery is slightly different from CR2032 in terms of battery capacity, weight and lithium content as former comes with 35mAh capacity with 0.8g weight and 0.006 grams lithium content while later contains 285mAh capacity, 3gram weight, and 0.109gram lithium content.
- It features small and compact shape, making it an ideal choice for hard to reach places.
- Prior precautions are required to keep this device safe and away from the kids. If swallowed, this device can cause a severe health damage or death in some cases due to the chemical composition it incorporates.
- The output voltage it can deliver is around 3V, enough to drive some small devices like wristwatches and glucose monitors.
- Both positive and negative electrodes are stainless steel SUS430 and Nickel plated.
- It is important to note that, no coatings or other foreign objects are required on the surface of terminals that can severely affect the real use or performance of this coin cell.
- Battery compartments work best to encapsulate this battery, making it safe and away from the kids. They can be designed using two methods: an extra mechanical tool like a screwdriver is required to unlock the battery compartment or you can apply two independent movements of the securing mechanism by a single hand.
- These battery compartments come with an ability to retain different cells where capacities will vary by size.
CR1220 Features
Features of any device can help you better understand major functions associated with it, helping you make a final decision before picking the device for your relevant project. Following are the main features of CR1220.
Classification |
Coin Cell Battery or Lithium Energizer |
Product Name |
CR1220 |
Output Voltage |
3V |
Chemical System |
Lithium / Manganese Dioxide (Li/MnO2) |
Capacity |
35 mAh |
Energy Density |
153 milliwatt hr/g |
Weight |
0.8 gram |
Lithium Content |
0.006 grams |
Self Discharge |
1% / year |
Type |
Non-Rechargeable |
Maximum Operating Temperature |
70 °C |
Minimum Operating Temperature |
-30 °C |
- Some cells are made from different chemical compositions, making them mechanically interchangeable which may directly service life voltage stability of the cell.
CR1220 Dimensions
Following figure shows the dimensions of CR1220.
- The dimensions are given in mm vs inches.
- Pay special heed while selecting the coin cell for a required device, the wrong pick can intensively affect the device performance, resulting in a sheer hindrance in the operating process.
CR1220 Applications
CR1220 comes with a wide range of applications that require temporary power on the fly. Following are some major applications of this coin cell.
- Keyless entry devices
- Glucose monitors
- Implantable cardiac defibrillators
- Heart-rate monitors
- Artificial cardiac pacemakers
- Toys & games
That's all for today. I hope you have found this read useful. If you are feeling skeptical or have any question you can approach me in the comment section below. I'd love to help you according to the best of my expertise. Feel free to keep us updated with your valuable feedback and suggestion, so we keep providing quality work and you keep visiting us for what we have to offer. Thanks for reading the article.
Arduino 74HC165 Interfacing: Increase Input Pins
Hello friends, I hope you all are doing great. In today's tutorial, I am going to do an
Arduino 74HC165 Interfacing and we will have a look at How to increase Input Pins of Arduino. 74HC165 is a shift register and works on the principal of Parallel In Serial Out. In my previous tutorial
Arduino 74HC595 Interfacing: Increase Output Pins, we have seen How to increase the output pins of Arduino and today we are gonna do exact the opposite and we will increase the input pins.
74HC165 will take 8 parallel inputs from different sensors or buttons etc and will send them to serial OUT Pin, which will be connected to
Arduino. So, if you are working on a project where you want to get data of 15 or 20 digital sensors then you can use this shift register and just using a single pin of Arduino you can read data of all those sensors. We can only get digital inputs, we can't get analog input through this shift register. So, let's get started with Arduino 74HC165 Interfacing:
Arduino 74HC165 Interfacing
- I will design a Proteus Simulation of Arduino 74HC165 Interfacing, I have given the files for download at the end of this tutorial, but I would recommend you to design it so that you could learn.
- I will connect simple Logic buttons with this shift register and will read their status on the Serial Port.
- So, first of all design a simple Proteus Simulation as shown in below figure.
- I have used Arduino UNO and have connected Virtual Terminal so that we could have a look at Serial data.
- As you can see in the above figure that I have connected four pins between Arduino and 74HC165, which are:
- Pin # 8 of Arduino ==> Shift (SH) of shift register.
- Pin # 9 of Arduino ==> Clock Enable (CE) of shift register.
- Pin # 11 of Arduino ==> Serial OUT (SO) of shift register.
- Pin # 12 of Arduino ==> Clock (CLK) of shift register.
- Now open you Arduino software and copy paste the below code in it:
#define NUMBER_OF_SHIFT_CHIPS 1
#define DATA_WIDTH NUMBER_OF_SHIFT_CHIPS * 8
int LoadPin = 8;
int EnablePin = 9;
int DataPin = 11;
int ClockPin = 12;
unsigned long pinValues;
unsigned long oldPinValues;
void setup()
{
Serial.begin(9600);
pinMode(LoadPin, OUTPUT);
pinMode(EnablePin, OUTPUT);
pinMode(ClockPin, OUTPUT);
pinMode(DataPin, INPUT);
digitalWrite(ClockPin, LOW);
digitalWrite(LoadPin, HIGH);
pinValues = read_shift_regs();
print_byte();
oldPinValues = pinValues;
}
void loop()
{
pinValues = read_shift_regs();
if(pinValues != oldPinValues)
{
print_byte();
oldPinValues = pinValues;
}
}
unsigned long read_shift_regs()
{
long bitVal;
unsigned long bytesVal = 0;
digitalWrite(EnablePin, HIGH);
digitalWrite(LoadPin, LOW);
delayMicroseconds(5);
digitalWrite(LoadPin, HIGH);
digitalWrite(EnablePin, LOW);
for(int i = 0; i < DATA_WIDTH; i++)
{
bitVal = digitalRead(DataPin);
bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));
digitalWrite(ClockPin, HIGH);
delayMicroseconds(5);
digitalWrite(ClockPin, LOW);
}
return(bytesVal);
}
void print_byte() {
byte i;
Serial.println("*Shift Register Values:*\r\n");
for(byte i=0; i<=DATA_WIDTH-1; i++)
{
Serial.print("P");
Serial.print(i+1);
Serial.print(" ");
}
Serial.println();
for(byte i=0; i<=DATA_WIDTH-1; i++)
{
Serial.print(pinValues >> i & 1, BIN);
if(i>8){Serial.print(" ");}
Serial.print(" ");
}
Serial.print("\n");
Serial.println();Serial.println();
}
- The code is quite simple but let me give you a quick explanation of it.
- First of all, I have assigned names to all 4 pins of 74HC165 connected with Arduino.
- Function read_shift_regs() is used to read the eight input pins of 74HC165 and print_byte() function is used to display that data on Serial Monitor.
- So get your hex file from Arduino software and upload it in Proteus software.
- Run your Proteus simulation and if everything goes fine then you will get results as shown in below figure:
- If you change any input of your shift register then you will get the new value on your Virtual Terminal.
- Now let's add another 74HC165 and increase our input pins by 16.
- So, design a simple circuit as shown in below figure:
- Now, in the above code, simply change the first line and make #define NUMBER_OF_SHIFT_CHIPS 2.
- Simply changes 1 to 2, as we are using 2 shift registers now.
- Now get your hex file and run the Proteus simulation.
- Here's the output of our 16 increased inputs:
- That's how you can easily interface multiple 74HC165 chips with your Arduino board and can increase the input options.
- You can download these Proteus simulations and code for Arduino 74HC165 Interfacing by clicking the below button:
[dt_default_button link="https://www.theengineeringprojects.com/ArduinoProjects/Arduino 74HC165 Interfacing.rar" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Code[/dt_default_button]
- You should also have a look at this video in which I have shown How to run these simulations:
So, that was all for today. In my coming tutorial, I will interface both 74HC165 and
74HC595 with Arduino UNO and will show you How to increase both input and output pins at the same time. Thanks for reading. Take care!!! :)
Arduino 74HC595 Interfacing: Increase Output Pins
Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you
Arduino 74HC595 Interfacing and we will have a loook at How to
Increase Arduino Output Pins with 74HC595. Suppose you are working on some project where you need to control 20 LEDs with
Arduino UNO and you know we will 12 digital Pins so we can't control all of these 20 LEDs with Arduino UNO. We can use Arduino Mega as well but if we wanna stick to Arduino UNO then we need to increase its Output Pins and we will use 74HC595 for that purpose.
You should read this basic
Introduction to 74HC595, it will help you to better understand this shift register. It's a Serial In Parallel Out Shift register and we will give it value serially from single Pin of Arduino and it will output that data to 8 output pins. Moreover, we can also connect these registers in parallel to increase the output pins even further. So, let's have a look at Arduino 74HC595 Interfacing:
Arduino 74HC595 Interfacing
- As I told earlier 74HC595 is a serial In Parallel Out Shift Register and is used to increase the output pins of Arduino.
- I am gonna use Proteus software and we will design its simulation and then will check out How it works.
- So, design a simple circuit as shown in below figure:
- As you can see in above figure, I have done the following connections between Arduino and HC595:
- Pin # 5 of Arduino ==> ST_CP
- Pin # 6 of Arduino ==> DS
- Pin # 7 of Arduino ==> SH_CP
- All output pins of 74HC595 are connected to LEDs.
- Now upload the below Arduino code and get your hex file.
int RCLK = 5;
int SER = 6;
int SRCLK = 7;
#define TotalIC 1
#define TotalICPins TotalIC * 8
boolean Data[TotalICPins];
void setup()
{
pinMode(SER, OUTPUT);
pinMode(RCLK, OUTPUT);
pinMode(SRCLK, OUTPUT);
ClearBuffer();
}
void loop()
{
for(int i = TotalICPins - 1; i >= 0; i--)
{
Data[i] = HIGH;
UpdateData();
delay(300);
ClearBuffer();
}
for(int i = 1;i < TotalICPins - 1; i++)
{
Data[i] = HIGH;
UpdateData();
delay(300);
ClearBuffer();
}
}
void ClearBuffer()
{
for(int i = TotalICPins - 1; i >= 0; i--)
{
Data[i] = LOW;
}
UpdateData();
}
void UpdateData()
{
digitalWrite(RCLK, LOW);
for(int i = TotalICPins - 1; i >= 0; i--)
{
digitalWrite(SRCLK, LOW);
digitalWrite(SER, Data[i]);
digitalWrite(SRCLK, HIGH);
}
digitalWrite(RCLK, HIGH);
}
- The code is quite simple but let me explain it a bit.
- First of all we have given names to our 3 Pins connected to Arduino UNO.
- After that we have made all those 3 Pins as OUTPUT as we are gonna send the data.
- We are using single chip of 74HC595 that's why I have made it 1.
- In the UpdateData function, you can see we have to make RCLK Low and after that we have sent our data.
- But for sending each bit of Data we have to make SRCLK from LOW to High.
- SER is our Serial IN from Arduino to 74HC595.
- So, in loop section, I am simply sending HIGH from first Pin to Last and then from last Pin to first and we are getting below results:
- Now let's have a look at How to connect two 74HC595 chips in parallel to increase the output pins to 16.
- I have also given these Proteus simulations for download at the end of this tutorial but I would recommend you to design them on your own so that you got better understanding of this shift register.
Arduino 74HC595 Interfacing: 2 Chips in Parallel
- Now we are gonna place two shift registers in parallel and we will be able to control 16 outputs from single Arduino Pin.
- Although we are using 3 Arduino Pins but the data is sent through Pin # 6 of Arduino and Pin # 5 and 7 are CLK Pins.
- Now design a circuit as shown in below figure:
- Now in Arduino Code, you just need to change the TotalIC to 2 and as you have seen we have already multiplied it with 8 so now our for loop will move from 0 to 15.
- Pin # 5 and 7 will simply connected to same pins of second shift register but DS will be connected to Q7' of first shift register.
- Now get your hex file from Arduino software and if everything goes fine then you will get something as shown in below figure:
- Now let's make it a bit more complex by adding 4 shift registers in parallel.
- So, design a Proteus Simulation as shown in below figure:
- We have followed the same principal, Q7' of second chip is connected to DS to 3rd chip and goes on.
- I have placed these default Pins instead of connecting the wires, it works the same.
- If this image is not clear then open it in new tab and zoom out to check the connections.
- Now in your Arduino code, you need to change the TotalIC to 4, as now we are using four chips.
- Get your Hex File and run Proteus simulation and if everything goes fine then you will get similar results:
- So, that's How you can quite easily do the Arduino 74HC595 Interfacing and can increase Arduino outputs as much as you want.
- You can download these Proteus Simulations along with code by clicking the below button:
[dt_default_button link="https://www.theengineeringprojects.com/ArduinoProjects/Arduino 74HC595 Interfacing.rar" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Arduino Code[/dt_default_button]
- I have also designed this YouTube video to give you a better understanding of Arduino 74HC595 Interfacing:
So, that was all for today. I hope you have enjoyed this Arduino 74Hc595 Interfacing. If you have any questions, then ask in comments and I will try my best to resolve them. In my coming tutorial, I will show you How to increase the Arduino Input Pins. So stay tuned and have fun. :)
Introduction to S8050
Hey Guys! Hope you are doing well. I always strive to keep your technical needs and requirements quite in line with valuable information that helps you excel and thrive in engineering and technology. Today, I'll unlock the detailed
Introduction to S8050 that is an NPN Epitaxial Silicon Transistor mainly used for push-pull amplification and general purpose switching applications.
It is a low voltage and high current transistor, featuring collector current up to 700 mA and Collector-Emitter voltage around 25 V.
I'll try to cover each and everything related to S8050, so you don't have to scratch your head browsing the whole internet and find all the information in one place. Let's dive in and kick off the nitty-gritty of this transistor.
Introduction to S8050
S8050 is an
NPN Epitaxial Silicon Transistor that comes with low voltage and high current capabilities. It proves to be a bright spot for push-pull amplification and general purpose switching applications.
- This transistor mainly contains three terminals known as an emitter, base, and collector that are used for the external connection with the electronic circuits.
These terminals are different in terms of doping concentration where emitter terminal is highly doped as compared to base and collector terminals.
- The base terminal is lightly doped and the collector terminal is moderately doped where former controls the number of electrons and later collects the number of electrons from the base terminal. The small current at one terminal at one terminal is used to control large current at other terminals.
This transistor incorporates three layers where one P-doped semiconductor layer is encapsulated between the other two N-doped layers. The P-doped layer represents the base terminal while other two layers represent emitter and collector respectively.
- There are two types of transistors known as Unipolar Transistor and Bipolar Junction Transistors. The S8050 falls under the category of Bipolar Junction Transistor - as the name suggests it comes with two charge carriers: electrons and holes, however, electrons are the major charge carriers.
This transistor features two PN junctions: emitter-base junction that is forward biased and the collector-base junction that is reverse biased.
- It is important to note that, S8050 must be operating in a forward biased mode for a better performance. If a transistor is not forward biased, there will be no collector current, no matter how much voltage is applied at the base terminal.
The amplification is carried out a simple way when a voltage is applied at the base terminal,
transistor draws small current which is then used to control large current at other terminals.
S8050 Pinout
S8050 mainly consists of three terminals.
1. Emitter
2. Base
3. Collector
Following shows the pinout of this transistor.
The electron movement is mainly triggered by the voltage applied at the base terminal, resulting in the diffusion of electrons from the base to collector terminal.
- As the voltage is applied the electron from emitter terminal triggers and enters the base terminal, combining with the hole already present in the base terminal and the resulting pair disappears.
The number of electrons entering the base terminal from the emitter is greater than the number of holes diffusing into the emitter region that's why electrons are major charge carriers in case of NPN transistor.
- The base terminal is unable to handle all electrons entering it, subsequently, electrons move from the base to collector terminal.
S8050 Circuit Diagram
Following figure shows the circuit diagram of the S8050.
In this NPN transistor, electrons are main charge carriers, unlike PNP transistor where holes are major charge carriers.
- The base is more positive with respect to the emitter and the voltage on the collector must also be more positive than the base.
The collector is made physically larger than the base for two reasons: allowing a collector to deal with more heat without damage and increasing the chance of carriers that enter the collector terminal.
- Two current gain factors: common-emitter current gain and common-base current gain play a vital role to determine the characteristic of the transistor.
The common-emitter current gain is a ratio between collector current and base current. This is called Beta, denoted by ß, and more often than not ranges between 20 to 1000, however, the standard value is taken as 200.
- Similarly common-base current gain is a ratio between collector current and emitter current. It is called alpha, denoted by a, and its value mainly ranges between 0.95 to 0.99, however, most of the time its value is taken as unity.
S8050 Absolute Maximum Ratings
Following figure shows the absolute maximum ratings of S8050.
- These are the stress ratings which if exceed from the absolute maximum ratings, can damage the device at large, which ultimately affect the project performance.
These ratings are determined on the basis of the maximum junction temperature of 150 °C.
- Additionally, if ratings are applied for a maximum period of time above normal operating conditions, they can affect the device reliability.
Applications
- This NPN transistor is mainly used for push-pull amplification.
- Some general purpose switching applications feature this transistor, aiming to control large current with a small current.
That’s all for now. I hope I have given you everything you needed to know about S8050. If you are unsure or have any question, you can ask me in the comment section below. I’d love to help you the best way I can. You are most welcome to keep us updated with your valuable suggestions, they help us provide you quality work. Thanks for reading the article.
Introduction to USB
Hey Everyone! Hope you are getting along with life pretty well. I always strive to keep your technical appetite filled with the recent and valuable development in engineering and technology. Today, I'll unravel the detailed
Introduction to USB.
The USB stands for Universal Serial Bus which is an industry standard mainly developed for laying out the communication between a computer and peripheral devices. The first USB was developed in 1996 by the collaborative effort of seven companies - DEC, Microsoft, Compaq, Nortel, IBM, Intel, and NEC
- The USB device not only helps in establishing a flawless communication but also assists to power up the connected peripheral devices, setting you free from the parallel ports and the external power chargers that turn out to be costly and cover more space.
The lastest USB 3.2 is introduced in 2017 with the maximum speed capability for communication - around 20 GBits/s which is quite adequate to transfer the data from the peripheral device to the computer with some remarkable pace.
In this post, I'll cover each and everything related to USB, its main features, need of use, advantages and main applications. Let's dive right in.
Introduction to USB
The USB is an industry standard mainly developed for laying out the communication between a computer and peripheral devices.
- Additionally, unlike some traditional connector, USB doesn't require any user adjustable interface setting, it serves more like a plug and play device. You just need to connect the one end of the USB cable with a peripheral device and another end to the computer and start playing and controlling the peripheral device.
Communication between the devices is an essential part of the electronics. More often than not, the computer serves as a host with which the peripheral devices are connected.
It is important to note that, it is impossible to connect the two peripheral devices using USB unless there is a separate host available that controls the communication and serves as the main handling device in the whole arrangement of communication between the peripheral devices.
- The USB is unable to handle multi-master arrangement and can support one host per bus. However, the "USB on the GO" is designed with the purpose, if there is no host available, two devices collaborate with each other to define, which one is appropriate to serve as a host in the whole protocol.
USB Pinout
Following figure shows the pinout of the Universal Serial Bus.
A number of USB connectors are available. The connector attached with the host (computer) or device is called male port or receptacle, and the connector coupled with the cable is called female jack or plug.
There are 7 USB connectors introduced until now
- Standard-A Type
- Standard-B Type
- Mini-A
- Mini-B
- Micro-A
- Micro-B,
- Type-C
Standard A and B type come with 4 pins while Mini and Micro-USB interface is incorporated with total five pins where four pins work similar to the standard USB connectors and the additional pin is nothing but a device indicator.
Following figure shows the pinout of USB Type C connector.
Type C connector is a new connector that stands out in terms of power capabilities as it comes with an ability to deliver 100 W which far larger than its standard predecessors that can deliver in a range between 2.5 to 5 W.
- It comes very handy in a variety of fast charging applications, as it features power delivery, video, audio, and data capability in a single package.
Pin Description
As mentioned above USB is a serial bus that is housed with 4 shielded wires where two are reserved for power (+5v & GND) while the other two are used for carrying differential data signals. They are marked as D+ and D- on the pinout given above and are transmitted on a twisted pair.
- The NRZI (Non-Return to Zero Invert) encoding scheme is mainly employed to send data with a sync field while ultimately helps in synchronizing the host and receiver clocks.
Note: The half-duplex differential signaling is used to brush off the effects of electromagnetic noise where long lines are a major concern.
Capability
A single USB bus can handle around 127 devices at a time. If you plan to connect more devices, you need to add another host to the arrangement.
- The earlier USB hosts came with two ports that were enough to control the peripherals devices at that time. However, with the invention of new devices and as all workload was shifted to computer technology, it ultimately put the burden and erupted the need for more ports incorporated into the USB hosts.
Recently the USB host comes with 4 or ports on a single interface, giving you the flexibility to connect more devices on the fly.
At the start, the hosts were featured with only one USB controller, where both ports sharing the same bandwidth. However, as there came a surge in the requirement of bandwidth, multiple port cards were coupled with two controllers, giving you the ease of handling individual channels.
- The USB 1.1 comes with a maximum cable length of 5 meters that can easily support peripheral devices running at speed around 12 Mbit/s, however, it varies as the cable length differs i.e. cable length of around 3 meters is a good fit for devices running at a low speed of around 1.5 Mbit/s.
Similarly, USB 2.0 is an improvised version of the USB 1.1, supporting a maximum cable length of 5 meters with devices running at high speed 480 Mbit/s.
- The USB 3.0 is not reserved for specific cable length, however, the cables used under this standard must meet some electrical specifications i.e. the maximum practical length is 3 meters for copper cabling with AWG 26 wires.
USB Versions
A number of USB versions have been released until now with every new version disguising the features of its predecessors with some added speed and connection capability.
Following table shows the list of USB versions introduced till date.
You can see from the table, how USB speed capability has been modified over the years ranging from 1.5 Mbits/s to 20 Gbits/s. This is a huge shift indeed.
Architecture
The USB architecture is mainly based on tiered star topology that is identical to 10BASE-T Ethernet. The topology interface supports the need of hub as per requirements.
Recently, some devices like Keyboard come with a USB hub and instead of directly connecting the mouse or any digital camera with a computer, you can connect them with the hub incorporated on the keyboard and use them similar as you connect them with the computer, as eventually the keyboard will be connected to the computer at the other end.
The tiered star topology comes with a number of advantages that put it ahead of using a daisy-chaining connection for the peripheral devices.
- It is incorporated with built-in protection interface that disconnects the connected device immediately in case it comes under the radar of sheer current - more than it can handle. You can use other devices as usual with the disconnection as it won't be affecting other devices in the whole arrangement.
The USB hub comes with an ability to support both low speed and high-speed devices. As the low-speed device is connected with the hub, it will automatically block the full speed transactions, making sure low-speed device doesn't come under the influence of the high-speed signals.
How does it Work
As the peripheral device is connected to a USB host, the enumeration process is activated which is nothing but the process of detecting, identifying and loading drivers for a USB device.
- It all gets triggered by sending a reset signal to the USB device. Once the connected device is reset, it is assigned a unique 7-bit address by the host.
The reset signaling plays a vital role in determining the data rate of the connected device. No or minimal operator action is involved during this whole process as the configuration starts immediately as you connect the peripheral device, automatically loading the required drivers for the communication between USB host and device.
Advantages
The USB comes with a number of advantages that make it an ideal choice for communication purpose. Yes, parallel and serial ports come handy in some PLC programming and computational purpose, but where communication is required with a decent pace that involves no human interference, USB grooves its way brilliantly.
Following are some major advantages of USB over other means of communication.
- It is a user-friendly and common person with no technical skills can easily get benefit from the sheer advantages of USB protocol. And the flexible interface of USB sets you free from the hassle of using a plethora of connector and wires at the back of your PC, that may turn your working space into a lot of mess.
As you connect the USB peripheral device with the USB hub on the computer, it starts configuration automatically and strives to keep the device quite in line with the working environment of the host, giving you the prompt signal your connected device is ready to use for the required operation.
----- For example, when you connect your phone with the computer, it gets configured automatically. And some phones which don't get connected will give you the option, indicating you need to install the specific driver in order to control the cell phone from your computer.
- Recent computers come with USB hubs that can easily support 4,5 ports as per your needs. In case your requirements surpass the given ports, you can add external USB hubs to incorporate more ports into the computer.
Low cost and power consumption are remarkable features that make USB stay ahead of its counterparts. It mainly works on 5V with little power consumption around 500 mA for USB 2.0 and 2.5 mA for USB 3.0.
- As mentioned earlier, the USB comes with a built-in current protection interface that saves the host from going over current that can ultimately put the host in a total stall. The current protection feature blocks the current that gets beyond the recommended ratings.
Limitations
There are some limitations involving the use of USB in terms of bigger perspective. The USB cables are limited in length, making them vulnerable for their use in distant areas.
- You can benefit USB protocol on the same surface, covering less distance where whole arrangement for communication between the peripheral devices and computer is laid out in a single tabletop surface.
Similarly, the USB converters may not be working as expected with they are connected with some external devices for the transformation of bi-directional data.
- For example, the USB to parallel port converter supports connection with a printer, but it doesn't work properly with the scanner due to the absence of bi-directional data pins.
That's all for now. I hope I have given you everything you needed to know about USB. If you are unsure or have any question, you can comment me in the section below. I'd love to help you the best way I can. You are most welcome to keep us updated with your valuable suggestions, we shape our content strategy based on them, so keep them coming. Thanks for reading the article.
Introduction to CD4046
Hey Guys! Hope you are doing well. Welcome you onboard. Today, I'll discuss the detailed
Introduction to CD4046 which is a Micropower Phase-Locked Loop (PLL) that comes with a common comparator input and a common signal input amplifier between a low-power linear voltage-controlled oscillator (VCO) and two different phase comparators.
The phase locked loop, as the name suggests, is a loop where the phase of the output signal is compared with the phase of the input signal using a phase detector between two signals.
- Phase detector operates with the aim to adjust the two signal and make them quite in line with each other so they generate signals with the same magnitude.
In this tutorial, I'll walk you through the main details related to CD4046 by breaking down the whole nitty-gritty in simple steps, making it easy for you to grab the main concept. Let's jump right in.
Introduction to CD4046
CD4046 is a Micropower Phase-Locked Loop (PLL) that comes with a phase detector for comparing the phase of the output signal with the input signal and adjust them in order to make the matching signals from both ends.
- It comes with a common comparator input and a common signal input amplifier between a low-power linear voltage-controlled oscillator (VCO) and two different phase comparators.
The input signal can be operated in two ways: capacitively layered with a self-biasing amplifier for creating a small voltage signal or directly coupled for a large voltage signal.
- The VCO (Voltage Controlled Oscillator) is an integral part of the IC that mainly generates oscillated frequency based on the applied input. The generated frequency is then used for phase modulation.
The chip features two phase comparators i.e. Phase Comparator I and Phase Comparator II. They are also known as Phase Detectors.
Phase comparator I is nothing but an exclusive OR gate that produces a digital, maintaining 90° phase shifts at the VCO.
- It is important to note that both signal input and comparator input are set at 50% duty cycle where Phase Comparator I can lock the input frequencies that match with the magnitude of the VCO center frequency.
Similarly, Phase comparator II is known as an edge-controlled digital memory network and maintains a 0° phase shift between signal input and comparator input, providing a lock-in and digital error signal.
CD4046 Features
Following table shows the main features of CD4046.
Number of Pins |
16 |
Min Supply Voltage |
3 V |
Max Supply Voltage |
18 V |
Number of Phase Comparators |
2 |
VCO linearity |
1% |
Power consumption |
70 µW at VCO Frequency= 10 kHz and VDD = 5 V |
Technology |
CMOS Phase Locked Loop |
Operating Temperature Range |
-55 to 125 ºC |
- These ratings will help you make a final decision before you intend to incorporate this device into the relevant project.
CD4046 Pinout
Following figure shows the pinout of CD4046.
- VSS represents the ground voltage while VDD represents the supply voltage.
- A 5.2-V Zener diode is added with the aim to supply regulation if required.
CD4046 Pin Configuration
Following table shows the pin configuration of each pin.
Pin# |
Pin Name |
Pin Description |
1 |
Phase Pulse |
Phase pulse applied to the IC |
2 |
Phase Comp I Out |
An output of Phase Comparator I |
3 |
Comparator IN |
Input at the Comparator |
4 |
VCO OUT |
Output Signal at VCO |
5 |
INHIBIT |
Allows to electronically turn on or off the output voltage power supply |
6 |
C1A |
Capacitor 1 connected to VCO |
7 |
C1B |
Capacitor 2 connected to VCO |
8 |
VSS |
Ground Pin |
9 |
VCO IN |
Input Signal at VCO |
10 |
Demodulator OUT |
Extracting the original signal |
11 |
R1 |
Resistor 1 connected between VCO and Supply Voltage |
12 |
R2 |
Resistor 2 connected between VCO and Supply Voltage |
13 |
Phase Comp II OUT |
Generated oscillated output at Phase II Comparator |
14 |
Signal IN |
Input Signal applied to the Phase Comparator I |
15 |
Zener |
5.2 V Zener diode for voltage regulation |
16 |
VDD |
Voltage supply pin |
- I hope this configuration will help you understand the major functions associated with each pin on the chip.
Absolute Maximum Ratings
Following figure shows the absolute maximum ratings of CD4046.
- These are the stress ratings above which the device may stop working. Before you start your project, make sure your technical requirements match with the ratings of the device otherwise it may cause more damage than good.
- As mentioned above DC supply voltage ranges between -0.5 to 18, however it is advised to keep the DC supply between 3 to 15 V for better results, similarly recommended operating temperature range lies from -55 to 125 ºC.
- The ground voltage is zero unless specifically recommended by the manufacturer.
CD4046 Dimensions
Following figure shows the dimension of CD4046.
- The dimensions in the numerator are given in inches and dimensions appearing in the denominator are given in millimeters.
- It is a low weight tiny chip that can easily stand fit in the hard to reach places.
Applications
CD4046 comes with a variety of applications aiming to compare the output signals with the input signals and produce them with the same frequencies. Following are the major applications of CD4047.
- FSK modulation
- Voltage-to-frequency conversion
- Motor speed control
- FM demodulator and modulator
- Frequency discrimination
- Frequency synthesis and multiplication
- Tone decoding
- Data synchronization and conditioning
That's all for now. I'll be writing more tutorials on some basic components mainly used in engineering and technology. If you are unsure or have any question, you are most welcome to approach me in the section below. I'd love to help you the best way I can. Feel free to feed us with your valuable feedback and suggestion, so we keep producing quality content and you keep coming back for what we have to offer. Thanks for reading the article.
Introduction to 2n5415
Hi Friends! Hope you are getting along with life pretty well. Today, I'll uncover the detailed
Introduction to 2n5415 which is a PNP transistor mainly used for general purpose low-power amplifying and switching applications.
It comes with three layers: two P semiconductor layers and one doped N-layer where later is encapsulated between other two P-layers.
There are two major types of transistor:
Bipolar Junction Transistor and Unipolar Transistor. This transistor falls under the category of Bipolar Junction Transistor as it comes with two charge carriers i.e. electrons and holes where later are the major charge carriers in PNP transistors.
In this post, I'll try to nail down everything related to 2n5415: its main features, working, and applications. Let's dive in and explore the nitty-gritty of this electronic component.
Introduction to 2n5415
2n5415 is a
PNP transistor that is mainly used for general purpose low-power amplifying and switching applications.
- It operates on a general amplification principle where small current at one terminal is used to control large current at other two terminals.
The 2n5415 is incorporated with three terminals known as an emitter, base, and collector which are used for external connection with the electronic circuits.
- These terminals are different in terms of doping concentration and size where a base is lightly doped and is responsible for the transistor action as it controls the number of holes flowing from emitter to collector.
The emitter is highly doped and contains 100% transistor current which then distributes between base and collector.
- The collector terminal is moderately doped and comes in a bigger size as compared to the other two terminals. It is mainly used to collect the holes emitted from the base terminal.
As the voltage is applied at the base terminal, it gets biased and starts drawing little current which plays a vital role to control large current at the emitter and collector terminals.
- The base terminal voltage has a large influence on the output current obtained at the collector terminal. This process is used for amplification purpose.
The PNP transistor is a current controlled device, also known as
sinking device, where it sinks current into its base terminal and current flows out of the collector.
2n5415 Pinout
Following figure shows the pinout of 2n5415.
There are three main parts of the component
1. Emitter
2. Base
3. Collector
- Holes control the conductivity in this PNP transistor similar to electrons that control the conductivity in NPN transistors.
- In PNP transistor base is more negative as compared to emitter and collector.
2n5415 Circuit Diagram
Following figure shows the circuit diagram of 2n5415.
- As mentioned earlier, the emitter terminal is highly doped and comes with 100% transistor current i.e. emitter current is a sum of current at collector and base terminals.
- When the voltage is applied, holes are diffused through the base from the emitter in this PNP transistor which eventually collected by the collector.
- Most of the professionals prefer NPN transistor over PNP transistor for amplification purpose because they consider conduction carried out by the movement of electrons is more effective and suitable than conduction carried out by the movement of holes.
2n5415 Absolute Maximum Ratings
Following figure shows the absolute maximum ratings of 2n5415.
- These are the stress ratings which directly affect the execution of electronic circuit. If these stress ratings are exceeded from absolute maximum ratings, they can damage the device at large, ultimately affecting the overall nature and performance of the project.
Similarly, if these ratings are applied for the maximum period of time above normal operating conditions they can affect the reliability of the device.
- It is preferred to examine these ratings before placing the device in the circuit and make sure the device follows the same stress ratings as defined by the manufacturer.
Applications
- It is widely used in general purpose low-power amplifying circuits.
- Many switching applications are incorporated with this transistor.
That’s all for now. I hope I have given you valuable information regarding this PNP transistor. If you are unsure or have any question, you can ask me in the comment section below. I’d love to help you in any way I can. You are most welcome to keep us updated with your valuable feedback and suggestions, so we keep producing quality content and you keep coming back for what we have to offer. Thanks for reading the article.
Introduction to 1n4738a
Hi Guys! Hope you are doing well. I am back to give you nuggets of valuable information related to engineering and technology so you can excel and grow in your relevant field. Today, I'll unlock the detailed
Introduction to 1n4738a. It is a zener
diode that comes with high power rating and is mainly used in stabilizing and clipping circuits.
The zener diode is slightly different from regular diode as former can conduct in both directions while later conducts in one direction only. It is available in double slug construction with corrosion resistant surfaces, helping to operate it under high temperature and pressure.
I'll try to cover each and everything related to this diode, so you don't have to grapple your mind surfing the whole internet and find all the information in one place. Let's jump right in and get down to the nitty-gritty of 1n4738a.
Introduction to 1n4738a
1n4738a is a zener diode that comes with an ability to conduct in both directions. It is a high power device mainly used in stabilizing and clipping circuits.
- This zener diode features maximum lead temperature for soldering around 230 C. It comes with a zener voltage around 8.2 V and external leads are attached with the body, helping thru-hole mounting.
This zener diode is nothing but a p-n junction diode with current capability conducting in both directions i.e. forward direction and reverse direction, featuring very effective working characteristic with a power dissipation of around1300 mW.
- You can not make it work in a reverse biased condition unless reverse breakdown voltage is achieved before the normal device operation.
It is important to note that the voltage drop across the zener diode doesn’t change over a wide range of voltages, which makes it a valuable pick for voltage regulation applications.
1n4738a Working
This zener diode is similar to a normal diode when it operates in a forward biased condition. However, working in a reverse biased condition is a totally different story that will only take place when the reverse voltage reaches the breakdown voltage, making diode flow current from cathode to anode.
- When a wide range of applied voltage is applied, the corresponding current reaches to a maximum point and strive to stabilize itself after some time. This process will make the diode working as a voltage stabilizer.
The Voltage Breakdown state can be achieved in two ways: using Zener Breakdown Effect or Impact Ionization. These mechanisms start to happen at 5.5 V and don’t require different circuitry for a flawless working process.
- However, the temperature coefficient sets them apart from each other as Zener effect comes with a negative temperature coefficient while the impact ionization features a positive temperature coefficient. And both effects cancel each other at 5.5 V, helping zener diode to gain the stable and reliable state over a wide range of temperatures.
1n4738a Absolute Maximum Ratings
Following figure shows the absolute maximum ratings of 1n4738a.
- If stresses are exceeded above these absolute maximum ratings, they can damage the device.
- Similarly, if stresses are applied for the extended period of time, they can affect the device reliability.
Applications
This zener diode is widely used in consumer electronics. Following are the major applications it can be used for.
As a Waveform Clipper
Zener diode serves as a waveform clipper when connected in series. In this case, it will clip the waveform from both ends of the cycle i.e. positive end and a negative end of the cycle.
In zener diode, the signal we get at the output comes with some major voltage spikes. However, if diodes are connected in series, they impede the diode from producing spikes, eventually modifying the output signal with a smooth waveform.
As a Voltage Shifter
- Zener diode is widely used as a Voltage shifting device.
- As a voltage shifter, it strives to make both output and breakdown voltage equal in magnitude.
That’s all for now. I hope I have given you everything you needed to known about 1n4738a. If you are unsure or have any question, you can approach me in the comment section below. I’d love to help you the best way I can. You are most welcome to feed us with your valuable suggestions, they help us provide you quality work. Thanks for reading the article.
Introduction to 2sa1265
Hi Guys! Hope you are doing well. Welcome you onboard. Today, I'll unlock the detailed
Introduction to 2sa1265 which is a PNP transistor mainly used for power amplifier applications and proves to be an ideal choice for 70W high fidelity audio frequency amplifier output stage applications.
This PNP transistor falls under the category of
Bipolar Junction Transistors where two charge carriers i.e. electrons and holes take part in the conduction process, however, holes are major charge carriers in the PNP transistors, unlike NPN transistors where electrons are the major charge carriers.
- BJTs are different than that unipolar transistors like JFETs as former is the current controlled device and later is a voltage controlled device. Both are used in different areas ranging from consumer electronics, industrial to commercial applications.
In this post, I'll try to cover some basic details related to 2sa1265, its main features, pinout, working, and applications. Let's jump right in.
Introduction to 2sa1265
2sa1265 is a PNP transistor mainly used for power amplifier applications. It is composed of three layers: two P doped layers and one N-doped layer which is sandwiched between the other two layers.
- This transistor contains three terminals known as an emitter, base, and collector. The base terminal is more negative than the rest of the terminals.
These terminals come in different size and doping concentration. The emitter terminal is highly doped and features 100% of the transistor current while the base terminal is lightly doped and controls the conduction inside the transistor. The collector terminal is moderately doped and is bigger in size than other terminals.
- The PNP transistor won't be conducting if there is no supply voltage at the base terminal, however, when a voltage is applied at the base terminal it draws current which is then used to control large current at other terminals.
It is important to note that, both
NPN and PNP are used for amplification purpose but voltage polarities and current directions are reversed in both transistors i.e. in NPN transistor current flows from collector to emitter and in PNP transistor current flows from emitter to collector.
- The 2sa1265 PNP transistor comes with two PN junctions i.e. emitter-base junction and the collector-base junction where former is forward biased and later is reverse biased.
Under normal conditions, the PNP transistor comes with voltage drop out of 0.7 V, so the voltage at the base side must be 0.7 V less than the voltage at the emitter side for making emitter-base junction a forward biased.
2sa1265 Pinout
Following figure shows the pinout diagram of 2sa1265.
- In the case of PNP transistor, emitter voltage is much larger than collector voltage which is necessary for the transistor to conduct.
- The transistor turns on as a small current starts flowing from emitter to base terminal.
2sa1265 Circuit Diagram and Working
Following figure shows the circuit diagram of 2sa1265.
When a voltage is applied at the base terminal, the majority of holes move from the emitter and get diffused into the base terminal, combining with the electrons.
- As the base is very thin and lightly doped it cannot hold the number of electrons for a maximum period of time, ultimately allowing the electrons flow from base to collector terminal.
In many amplification applications, NPN transistors are preferred over PNP transistors because conduction carried out by the movement of electrons is preferable over the conduction carried out by the movement of holes.
- Combination of PNP transistor with NPN transistor is widely employed for the development of the power amplifier circuits. Power B amplifiers are a great example of this amplifier circuits where both PNP and NPN transistors are joined together to produce a high amplification cycle.
2sa1265 Absolute Maximum Ratings
Following figure shows the absolute maximum ratings of 2sa1265.
- These are the stress ratings defined by the manufacturer. If you want the device to be running properly without any damage and undergoes a longer life, you must follow these operating conditions.
- If these ratings are provided for the larger amount of time than the normal operating condition, they can affect the device reliability which may cause more damage in the later stage once your electronic project has been executed.
Applications
- It is used in power amplifier applications.
- An ideal choice for 70W high fidelity audio frequency amplifier output stage applications.
That's all for now. I hope I have given you everything you needed to know about 2sa1265. If you are unsure or have any question, you can ask me in the comment section below. I'd love to help you according to the best of my knowledge. Thanks for reading the article.