5 Common Used PCB You Should Know

The digital industry is evolving day by day. Today, computers and phones are no longer heavy. They are sleek, powerful, and very light. Actually, some smartphones are more powerful than laptops. All this is possible because of the miniaturization of the electronic gadgets' printed circuit boards (PCBs).

Printed Circuit Boards or PCBs are categorized into several types based on design specifications, manufacturing processes, and application requirements. They are used in various sectors such as automotive, medical, defense, and other areas, you can learn more information at PadPCB.

Before you select a PCB, there are several factors you need to consider. Moreover, it is essential to seek advice from professionals. Although there are several types of PCBs, the five standard PCBs are multilayer PCBs, Rigid PCBs, Flex PCBs, HDI PCBs, and Heavy Copper PCBs.

Common Types of PCBs

Let's have a look at the common types of PCBs:

1. Multilayer PCBs

One commonly used PCB is the multilayer PCB. The board has more than two copper layers and is designed in a sandwich fashion. Also, they have many double-sided conductive layers separated by several insulating material sheets.

All are laminated and bonded together through high temperatures to ensure no air gaps occur and ensure the final PCB assembly is stable.

Advantages of Multilayer PCBs

  1. Compact in size – one advantage of multilayer PCBs is compressed in size. This means they can be used on numerous devices.
  2. More robust – multilayer PCBs are strong and are suited for extreme environments and harsh conditions.
  3. Suitable for high-speed circuits – multilayer PCBs are the best for devices that require high-speed circuits.
  4. High level of design flexibility – PCBs can be used in various sectors.

What are the applications of Multilayer PCBs?

Multilayer PCBs are commonly used in laptops, computers, tablets, smartphones, medical equipment, GPS trackers, and many other complex gadgets and circuits.

2. Rigid PCBs

A Rigid Printed Circuit Board cannot be folded or twisted. The board base is made of a rigid substrate giving it strength and rigidity.

In addition, it is composed of many layers that include a copper layer, a substrate layer, a silkscreen layer, and a solder mask layer. They adhere together with heat and adhesive.

Depending on the needs, it is possible to find single-sided rigid PCBs, rigid double-sided PCBs, and rigid multilayer PCBs. Nevertheless, once a rigid PCB has been made cannot be changed or modified.

Advantages of Rigid PCBs

  1. Cost-effective
  2. Simplicity of diagnostics and repair
  3. Solid
  4. Lightweight
  5. Little electronic noise
  6. Capability of absorbing vibrations

What are the applications of Rigid PCBs?

Rigid PCBs are commonly used in laptops, GPS equipment, computers, mobile devices, tablets, CAT scans, X-rays, heart monitors, MRI systems, control towel instrumentation, and temperature sensors.

3. Flex PCBs

Flex PCBs or Flexible Printed Circuit Boards are designed with several printed components and circuits arranged on a flexible substrate. Flex PCBs are also known as flex circuit boards, flexible circuits, or versatile printed boards.

A flex PCB is mainly made from polyamide, transparent conductive polyester film, or polyether ether ketone.

They are made using the same elements as rigid printed boards. But with Flex circuits, the board can flex to your preferred form throughout the use. There are flex single-sided PCBs, flex double-sided PCBs, and flex multilayer PCBs.

Advantages of Flex PCBs

  1. Save space due to flexibility
  2. Eradicate connectors
  3. Increases repeatability and reliability
  4. Thermal management
  5. Suitable for various applications, especially where high signal trace density is required.
  6. Offer uniform electrical features for high-speed circuitry

What are the applications of Flex PCBs?

Flex PCBs are typically used in flex solar cells, LCD fabrication, cellular telephones, automotive industries, laptops, cameras, and many other devices.

4. HDI PCBs

HDI PCB or High-Density Interconnect is a PCB with several interconnections but minimal space. The components are placed nearer, and the board space is considerably reduced, but the functionality is not affected.

Advantages of HDI PCBs

  1. Compact design – the combination of buried vias, blind vias, and micro vias offers the board space requirements.
  2. Cost-effective – the tasks of a standard 8-layer PCB are reduced to a 6-layer HDI board without affecting the quality.
  3. Phenomenal versatility – the boards (HDI PCBs) are perfect where space, weight, reliability, and performance are the primary concerns.
  4. High reliability – HDI PCBs are reliable even against extreme environmental conditions.

What are the applications of HDI PCBs?

  • Medical devices - are involved in HDI PCBs because they can fit in smaller gadgets such as imaging equipment and implants.
  • Automotive – HDI PCBs are the most recommended to save space in automotive. This helps in providing a better driving experience.
  • Smartphones and tablets – modern smartphones are HDI PCBs. These PCBs are responsible for creating smaller and thinner electronic devices.
  • Military and Aerospace – HDI is integrated into most military communication gadgets such as defense systems and missiles. Moreover, HDI PCBs are suited for harsh environments and dangerous conditions.

5. Heavy Copper PCB

Heavy copper Printed Circuit Board is also known as a thick copper PCB. It features three ounces of copper. Hence, they are highly valued due to their thermal management capabilities. Due to the increased copper thickness, the board can carry more current.

Advantages of Heavy Copper PCBs

  1. Increased current carrying capacity, mechanical strength, and increased thermal endurance.
  2. Easy incorporation with high power circuits and control circuits
  3. Many copper weights on the same circuitry leads to a smaller product.
  4. Heavy copper PCBs can withstand high thermal cycling.
  5. Permit the use of exotic materials to their total capacity without causing a circuit failure.

What are the applications of Heavy Copper PCBs?

Some of the applications of heavy copper PCBs are overload relays, solar power converters, power converters, weapons control systems, nuclear power applications, HVAC systems, and safety and signal systems.

Summary

PCBs have modernized the electronic industry. Today, the boards are used in almost every electronic gadget you know. However, those mentioned above are the commonly used PCBs.

If you are not sure of the best PCB to consider for your applications, make sure you seek help from an expert. Moreover, it is essential to purchasing PCBs from reputed manufacturers for commercial or industrial use.

Interlock in Ladder Logic Programming

Hi friends and hope you are all very well. Today, we are going to deal with one of the most important and common problems that would be there in everyday tasks in industry and its solution. The problem is the safety of equipment and operators by preventing the machine from running under specific conditions for realizing the safety of equipment and human as well. Not only does it fulfill safety but also it is for performing the designed sequence of operation. If there is a problem, then it should be the solution for it. the solution is what so-called “Interlock”. So, what is interlock? And why do we need it? And how we can design a good interlock? Well! We may find such concerns exist in two aspects which are safety and operation sequence. In the first aspect, safety happens when we need to make the execution of one operation or process locked by some condition for realizing the safety of the operator or equipment. The second one is operation sequence for which we need to sort the operation into sequential and concurrent tasks according to the logic philosophy of the operation. That can be realized by preventing one task of execution until one other task is finished or letting one task wait until one or more conditions are fulfilled. I hope that makes the reason why we need interlock close comes to your mind. Now, how we can perform interlock? Well! It can be done in many approaches. However, we can say simply there is only and only one idea to do interlock. It is by putting the condition “contact” on which it will be decided if the process will go on or not, or based on it, one piece of equipment can go running or keep stopped. By completing this article, you will have known what is interlock, why we need it in industry daily life problems, its techniques, and for sure how to program interlock. Furthermore, types of interlock, real examples from industry, and how you can implement it using ladder logic programming in different ways will be ready for you to learn and practice in this tutorial.

What is interlock?

Interlock is how to prevent one process or equipment from running to satisfy safety requirements or fulfill the logic of the operation. A clear example of an interlock is to prevent cutting weapons from executing as long as the hands of the operator are away from the working area. In this case, there will be two push buttons on the left and right of the operator and out of the working space to make sure, when the operator requests the cutting machine to operate, his hands were pressing those two push buttons which are out of the working space. The previous example shows how to employ interlock for realizing safety purposes. Another instance that shows how Interlock can be used to satisfy the operation logic requirements is when we need to drive the motor in two directions. In that case, we commonly use two relays or contactors for forward and reverse directions. So, there should be an interlock of each contactor to each other meaning we cannot activate both at the same time because that will end up with a short circuit on the motor or the supply.

What are types of interlock?

There are two main types of interlock which are safety interlocks and machine or equipment interlocks. Safety interlocks for securing people from getting hurt while they operate the machine. And machine interlock concerns with securing the safety of machine parts and or realizing specific philosophy of logic. Figure 1 shows the different types and subcategories of interlock. The machine or equipment interlock can be classified into three types which are mechanical, electrical, and logical interlock types. And from their titles, the mechanical interlock can be physically satisfied by making mechanical connections between equipment to let or prevent them from running. An electrical interlock can be achieved by using electrical devices like relys’ coils, sensors, and switches. The first one which is relays’ coils is the most interesting electrical interlock technique as they can be utilized in creating a dependency between equipment so we can design flexibly dependence between two motors, for example, to not running simultaneously meaning one of two running scenarios. The last type is the logical interlock which is the most important here in this tutorial and I hope you get an astonishing start to master that type because that is the most frequently used in real life in the industry. Do you know why? Because it is done programmatically without the need for mechanical connections and setup or even electrical devices or hardwiring. Also, it is very flexible as you can change it when there is a need to change the logic at any time.

Fig.1: interlock types

Figure 2 shows the very example of a safety interlock to protect the operator from entering the zone of robot work to save him from the movable parts. Is that a mechanical or electrical interlock? Or maybe logical? What do you think? Well! Let’s move forward in the tutorial and come back to this question to see if you know the answer or not.

Fig. 2: the safety interlock

The non-safe interlock is designed for protecting equipment and lock specific processes from execution. The machinery interlock is classified into three main categories which are mechanical, electrical, and logic interlock. In mechanical interlock, a set of mechanical setups is designed to prevent equipment or operation from running at some operating conditions. Figure 3 shows a schematic of a mechanical interlock for a setup that makes the motor spin either forward or reverse direction and prevent enabling both at the same time. The dotted line represents the mechanical interlock between the two contactors for reverse and forward contactors for guaranteeing to enable only one of them at any given time.

Fig. 3 mechanical interlock example

Figure 4 shows the case of missing the mechanical interlock between the two contactors. It shows the possibility of activating bother of them at a given time. In that case, you can see the damaging effects on the motor and the short circuit possibility on the power lines.

Fig. 4: fault condition due to missing interlock

Another example of mechanical interlock is car steering interlock as shown in fig. 5. The steering wheel is interlocked mechanically and unlocked by inserting the key.

Fig. 5: car steering mechanical interlock

The mechanical interlock was commonly used in the past and my be exist nowadays but very rarely. On the other hand, the electrical interlock is the most commonly used in control systems currently. Similarly, the idea of electrical interlock can be achieved by preventing the flow of current between two devices at the same time. Typically two contactors or relays are used for achieving such electrical interlock. One of these contractors will be normally open and the other will be in a normally closed configuration as in Fig. 6. It is very clear that for energizing the lamp, CR2 will be energized when CR1 is de-energized.

Fig. 6: electrical interlock example 1

Another example of electrical interlock which is very common is the thermal overload shown in Fig 7. It shows two contactors are used in electrical interlock configuration. The main contractor is in a normally open configuration while the thermal overload contactor is in a normally closed configuration. When there the temperature is getting high to a specific value the thermal overload turns over from normally closed to normally open to disconnect the load.

Fig. 7: electrical interlock example 2

Now, let's move to the logical interlock which is our target in this tutorial. Logical interlock is applying the same concept of interlock programmatically. In this type, there is no mechanical or electrical physical connection for achieving interlock. Instead, programming is used to perform the interlock. This logical interlock saves the effort of commissioning including mechanical or electrical connections. In addition, it realizes reliability and flexibility.

Logical interlock in ladder logic programming

Figure 8 shows one example of logic interlock. You can notice the left part of the figure shows there are no mechanical or electrical hardwiring or connections between pumps 1 and 2. However, pump 2 is interlocked with pump 1 logically as shown in the most left part that shows the ladder logic code. To have pump 2 running, pump 1 should run first by the level switch. As shown on the right part of the figure below, when the level of the liquid reaches above the level switch, the switch is turned on and energized pump 1 which activates pump 2.

Fig. 8: logic interlock example 1

Figure 9 shows another logic interlock example in which a timer of type on delay is used to interlock equipment. As shown on the left the ladder logic code and on the right, an image shows the scenario of the logic with astonishing visualization. It shows that, when the operator presses the start pushbutton and keep pressing on it for the preset time value which is 3 second, the timer contact turns on and the coil of the contactor is energized. Now let us go to the lab and open our simulator to run those examples to validate their logic and verify their proper operations.

Fig. 9: logic interlock example 2

Logical interlock using ladder logic

Let’s get to experimental work, now open your simulator, the first example as shown in fig. 10, there are two pumps. And we need to run one pump at every given time. So, no one of them will work when the other does. The ladder logic code shown in Fig.1, uses the contact of each pump’s coil to lock the other pump. For instance, if the first pump is running, that will open the path to prevent energizing the second pump’s coil when it is requested to run. Similarly, the first pump’s coil is hindered from running while the second pump is running. It looks smart but let us test and see if the logic we designed matches the real-time environment or there is an issue to solve!

Fig. 10: The first example ladder logic program

Simulation example 1

Well! Now we have started our simulation. Figure 11 shows the initial case when no pumps are requested to run. So you can see each pump is all set to run once being requested.

Fig. 11: the initial case when no pumps were requested

Figure 12 shows the case when we requested the first pump to run. Because the stop button is not raised and the second pump is not running; The first pump goes running as shown in figure 12. So the question is that what is going to happen when requesting pump 2 to run?! Let’s see

Fig. 12: starting the first pump

Fig. 13 shows the case when we request pump 2 to run by hitting its start push button “start-pump2”. As expected, the second pump does not run for the interlock condition we designed for by putting a contact of the first pump’s coil as a condition to run the other pump. So let’s remove the hindering condition of interlock by stopping pump 1 and trying to run pump 2 and see.

Fig. 13: requesting one pump to run when the other is running

Figure 14 shows what happens when we remove the interlock condition. By hitting the stop push button of the first pump “stop-pump1”, the first pump has stopped. Consequently, the second pump went running once the interlock conditions has been removed. So now simulation verifies our design and proves our code of interlock is working great. Well done!

Fig. 14: remove the interlock condition by stopping the first pump

Interlock ladder logic example 2

As we aforementioned section earlier, the interlock could be done by sensors state or reading, running and stopping statuses of other equipment, or logical devices like timers or counters as well. Timers and counters can be used as an interlocking technique for creating a running condition based on some delay or specific counting. Figure 15 shows one example of a timer-based interlock in which the pump won’t run by hitting the start button until the operator holds the start push-button pressed for 3 seconds then the pump goes running.

Fig. 15: timer-based interlock ladder logic example

Figure 16 shows the simulation of the second example. My friends, please notice, despite the start pushbutton having been hit by the operator; the pump does not start because it waits for the timer to count 3 seconds, and then it can run.

Fig. 16: pump wait timer to start

Now after 3 seconds of holding start push-button pressed, fig. 17 shows the pump goes running because the interlock condition is no longer there. I am very happy you would get that!

Fig. 17: pump start running after 3 seconds

What’s next?

My friends, before talking about what we are going to practice next time; I just want to express my appreciation that you patiently follow up till this point and hope your experience moves forward and gets more and more every lesson. Next time we will navigate the mathematical functions and how to perform mathematical computations in your ladder logic programming. my friends I really can’t wait to see you very soon to practice mathematics in ladder logic programming.

Water Level Indicator using Arduino

Hello geeks, welcome to our new project. Here, we are going to make a very useful project which we can use for ourselves or we can use this as a product as well on an industry level.

In this project, we are going to make a water level indicator. We all know it is one of the most essential products because there are many water tanks in every house or office, and most of them are not easily accessible to check the level of water in it and I think most of us faced the problem such as shortage of water as we do not have anything to monitor the exact amount of water available in the tank and this causes many problems on our daily lives.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2Arduino UnoAmazonBuy Now

Software to install

As we are going to make this project in the simulation first, for that, we will use the Proteus simulation tool. It is a tool used for electronic projects in which, we can run the real-time simulation of any electronic project and we can debug it in real-time without making any damage to real components.

Proteus has a very big database for electronic components which comes in the installation package of Proteus, but still, sometimes we have to install packages or libraries for some modules which are not pre-installed in it.

As in this project, we are going to use Arduino which is not pre-installed in the Proteus software. So we can download the Arduino module package from the link given below:

Components Required

In this project, we will use the following components
  • Arduino UNO
  • LEDs
  • Water level indicator

Components details

Arduino UNO

  • Arduino UNO is an open-source microcontroller of the Arduino family.
  • We have used this as the main controller of this project.
  • Using this we can measure the readings of the water level sensor and indicate the user accordingly.
  • It has 14 digital input/output pins which can be used for controlling any digital components or can be used to read digital sensors.
  • It has 6 analog input /output pins which are used for analog read and write functions.
  • The ADC used for analog pins is 10 bits which range from 0-1023.

Note- While uploading the code on the Arduino UNO, disconnect any wire which is connected to Rx(D0) and Tx(D1) pins, otherwise it will give an error while uploading the code.

Water Level Sensor

  • The water level indicator works on the principle of the potentiometer.
  • It has three pins as Vcc, Gnd, and Signal.
  • There are two kinds of exposed copper strips on the sensor which are Vcc and sensor line.
  • When it emerges in the water tank, the conductivity increases and the resistance decreases due to that, it increases the output voltage on the sensor pin of the water level sensor.
  • The output value of the sensor changes with the height of the water level in the water tank.
  • And this gives the analog output so that we will use the analog pin of the Arduino UNO for reading the sensor value.
  • As this will have analog values, we have to calibrate the sensor before using it in the project.
  • We will talk about calibration later in the article.

LEDs

  • LED stands for light-emitting diode.
  • They are used for indication purposes in this project.
  • LEDs are like normal diodes, they will allow the current to pass from only one direction.
  • They come in different colors and the color of LEDs differs as per the used material in its manufacturing.
  • There are two terminals in the LEDs, the larger one is the cathode and another one is the anode.
  • Using the length of the terminals, we can figure out the polarity of the LED but if in case both terminals are the same size then there is a flat side on the LED, that side is the negative terminal and another is the positive terminal.

Project overview

The water level indicator works on the principle of change in the resistance of the water level sensor due to a change in the amount of water in the container.

Basically, there are two parallel strips in the water level sensor, one for the power supply and another is for the sensor strip. As we know, water is a conductor of electricity so when we increase the amount of water in the container then more length of the sensor emerges in the water and that will increase the conductivity between the strips therefore, it increases the voltage on the sensor pin as well. We will read that voltage on the Arduino UNO.

To get the exact amount of water level in the container, we have to calibrate the sensor with the water because we can not be assured that the output voltage will be the same for every water because we know that there are lots of materials dissolved in the water so it will vary for a different source of water, therefore, we have to calibrate it first.

For calibration of the sensor, we will take a container with the water and we will read the values from the sensor by changing the level of water in the container. We will perform this action till the container gets filled with water and we will note down all the reference values and mark them as thresholds for each level.

As in this project, we are making it in the simulation so it would not be possible for changing the values as per the water level therefore we have used the potentiometer and we have chosen the threshold values randomly.

No need to worry while making this project with the real components as the sensor values from the water level sensor will be in the same format as the output of the potentiometer.

Now that we know the working principle of the water level indicator let’s go for the circuit diagram of the project.

Circuit diagram

As we know the required components which we are going to use in this project.

  • First of all, start a new project in the Proteus simulation software.
  • Import all the listed components in the Proteus workspace.
  • For sensor simulation, we will import one potentiometer.
  • Connect the output pin of the potentiometer with the analog pin of the Arduino UNO. In this project, we are using the A0 pin.
  • And other pins with the ground and 5volt Vcc.
  • Now start connecting the LEDs, for controlling the LEDs, we will use the digital pins of Arduino and they are D2, D3, D4, D5 pins.
  • While connecting the LED pins, keep the sequence the same otherwise there will be an error in the indication of levels.
  • Connect the positive terminal of the LED with the digital pins of the Arduino and the negative pins with the ground.
  • Now we have completed the connection of our project. Let’s move to the coding side of this project.

Arduino code of water level indicator

For coding, we will use the Arduino IDE. It is a built-in IDE for Arduino developments.

Arduino code is divided into mainly three parts: declaration of function and variables, second is void setup section, and third is void loop.

First of all, declare the variables and pin number which we are going to use in this project.

  • Declare five variables for storing the pin numbers of LEDs and one variable for storing analog pins for reading the sensors.

Void Setup()

  • This is the most important function in Arduino programming because our code will not compile successfully without using this function in the code.
  • When Arduino code starts this is the first function that runs.
  • This function runs only once when the code restarts.
  • So here, we will write the code which requires only one time to run.
  • In this function, we will basically declare the pin modes of the pins which we will use in the project.
  • Declare the pin mode of LEDs as output mode and sensor pin as input mode. Because we want to control the LEDs so that they must be in output mode and to read data from the sensor as input then it should be declared as input mode.

Void loop()

  • This is the second most important function of Arduino code structure.
  • This function also must be in the code without it our code will not compile successfully.
  • In this function, we will write the main application code which we want to run continuously.
  • First of all, we will read the sensor value because we will make the decisions on the sensor values.
  • And for debugging purposes, we will print that value on the serial monitor.
  • As the sensor will give the analog output data, we will use the analogRead function for reading the sensor data.
  • After reading the sensor value, set the LEDs as per the threshold which we have calculated while calibrating the sensor for each level.
  • We will divide the values into five conditions for each level we set the LEDs accordingly.
  • First, we write the condition for when the container is full then, let’s assume the value will be more than 760. Then switch on all the LEDs.
  • After that, set the condition for the second level when the sensor value is lesser than 760 but greater than 720. Here we will set the 5th LED to low state and other LEDs to a high state.
  • Next check the condition for the third level when the sensor value is in the range of 615 to 720 and here we will set the 5th and 4th LED to low state and other LEDs to a high state.
  • Next check the condition for the fourth level when the sensor value lies in the range of 615 to 410. Here we will set the 3rd, 4th, 5th LEDs to low state and the rest two LEDs to a high state.
  • After that, check the condition for the fifth level when the sensor value lies in the range of 410 to 250, and here we will set 5th, 4th, 3rd, 2nd LED to low state and remaining one LED to a high state.
  • Last check the condition for when the container is almost empty when the sensor value lies in the range of 250 to 0. Here we will set all five LEDs to a low state.
  • After that give a delay of 1 second for settling of sensor values and calibration.

Results and working

Now we have completed our code and circuit, it's time to run the project.

  • To run the simulation, we have to include the hex file of the Arduino code.
  • We will generate the hex from the Arduino IDE.
  • To generate the hex file, go to the Sketch >> Export compiled binary, after that, it will compile the code and in the project folder, there will be two files one is binary and the other is hex file.
  • Now we have to include the hex file in the Arduino module in the Proteus software.
  • Click on the Arduino UNO module, then a window will pop up where you can add the hex file of the project.
  • Now we are all set to run the project, click on the Run button in the software to start the simulation.
  • To change the water level in the simulation, we will change the value on the potentiometer and as the values from the potentiometer change then the LEDs will also respond accordingly.
  • First check the condition when the water level is very low, mostly when the container is empty.
  • When the water level is very low then there will be very less conductivity or maybe no conductivity, in this case, the output voltage from the sensor will be very less.
  • So in this condition, all LEDs will be off.
  • In the image, we can see that the voltage at the analog pin is 0.5 volts.
  • Now when the water level increases then in that condition the conductivity will also increase so does the output voltage from the sensor.
  • So let’s increase the water level to the first level.
  • Here we can see the output voltage increased to 1.5 volts and the first led is glowing.
  • Now similarly increase the water level for next levels.
  • Check water for the second level. The output voltage is iincreased to 2 volts.
  • Now check for the next level.
  • Now check for when the container is filled. Then all LEDs will glow.

Conclusion

I hope we have covered all the points related to this project, and I think it will be very useful in daily life and it will give us ease of monitoring water in our water tanks. After this project, we don’t have to take the headache of how much water is available in our tank. And please let us know in the comment section if you have faced any issues while making it and also how you are going to use it in real life.

Thanks for reading this article. All the best for your projects.

 

Introduction to High-Speed PCB Design

Hello everyone and welcome to this article which will be a great introduction to high-speed PCB design. For sure it is going to be a very interesting class. Let me start by posing a question; Is this something that you have ever come across in your world of PCB design? Where you spent too much time doing the schematics, selecting the right components, doing the footprint addition, generating the netlists, doing the proper layout and routing and sending the end product of your design to the manufacturer? At this level you might probably be designing standard types of PCB boards and if someone was to introduce a project that talks about signal integrity, reflections or even crosstalk, very much believe you will feel like a lost person. It might be something new to you. The reason is that such kind of task is not what you have been handling in your day-to-day design activities.

In this field of PCB design, you might not guess what your clients want in the future and sooner or later, you might be slapped with a design that involves high-speed PCB design process and at this stage be assured of finding things so hard if you have never worked with the high-speed PCB designs. Today we are going to have a look at the high-speed PCB design and this article is best suited for people who want to go beyond the horizon when it comes to printed circuit board design.

What is a high-speed PCB design?

When we introduce a high-speed PCB design, signal integrity should be the first thing that runs in your mind. When your signal integrity starts to be affected by the physical properties of your printed circuit board like the schematic, layouts etc then the design of your board is a high-speed PCB design.

Signal integrity is a set of measures that define electrical signal quality.

  • When you complete the design of your PCB boards and you come across challenges such as attenuation, reflections, delays, crosstalk and so on, the feel at home and welcome to the field of high-speed PCB design.
  • The amount of attention paid to these arising challenges is what makes the High-speed PCB design very unique.
  • You might have been used to the design of easy boards where your focus is only on the placement of components and routing but sometimes you will come across a design that where you place your components is very important, the way you do the routing, the distance between different signals must be considered, where you place your traces and which type of components should be interconnected
  • If you take all these precautions then expect a very new different type of PCB design. You will be having a whole new experience in your design work.

Having introduced what high-speed PCB design is and making note that it is all about signal integrity, now let us have a look at the signal integrity to get a proper understanding;

How to place an order for High-Speed PCB?

There are many online PCB companies, that offer High-Speed PCB designing. For this tutorial, let's take the example of PCBWay, a China-based PCB Fabrication House, that offers competitive prices for PCB designing. So, let's take a look at how to place a High-Speed PCB order on PCBWay:
  • First, create a new account on the PCBWay official site.
  • Click on the PCB Instant Quote tab and a PCB Calculator will open up.
  • Here, click on the Advanced PCB Button at the top and you will get the calculator as shown below:
  • As you can see in the above figure, I have selected High Speed in the Materials section.
PCBWay has an excellent customer support team, so if are ordering for High-Speed PCB  design, then it would be recommended to discuss your requirements with their team first.

Brief on signal and signal integrity:

When doing a PCB design of any kind, it is obvious that you will be sending some sort of signal through copper traces from the input to your desired area of interest. The signal you will be sending can either be a digital signal or an analog signal.

Digital signals

  • Also referred to as the square signal and it is the output that you will always come across any digital signal that exist in this planet.
  • Unlike in the analog signal which has random numbers spread all over, the digital signal has a well-organized system of outcomes represented by a high and a low point or a 1 and a 0 or even some refer to them as an off and an on.
  • Let us look at the figure below which is an indication of a digital signal.

Analog signals

  • This type of signals has random points of output which are made up of both negative and positive values.
  • Unlike the digital signal that has on and off points, the analog signals have random results that are defined by there frequencies and the signal strength.
  • The following is the output you should expect when using the analog signals.

The main issue about these signals is that they are prone to interference and this is where we bring in signal integrity because anytime a signal is affected by the environment there are some issues that arise.

Let us have a look at the following example.

Let us say you have a circuit that is transmitting signal from point 1 to point 2 in your PCB board. The point 1 can be classified as the transmitter and point 2 can be classified as the receiver. As the signal moves from point 1 to point 2, there is a likelihood that the signal is affected by different factors like;

  1. Signal ringing; this occurs when there is unwanted shifting of current or voltage which will lead to the flowing of extra current in your trace hence delaying the arrival of the signal.
    1. Signal reflection; this is when your signal is flowing in your coper traces but the whole signal does not get to the destination since some of it is reflected back to the origin.
  • Signal noise; this occurs when there is a random fluctuation of signals in your board which in turn affects the signals that are close to it. The fluctuation may end up damaging the signal data being transferred in your board.
  • Signal timing; some times when you send your signal through your copper traces, they do not get to that destination in time so that it can match with the clock signals. When this happens the signal might be interpreted as a zero while in actual sence it wss one. This is called signal timing.
  • Signal crosstalk; this occurs when you place two copper traces too close to each other whle the traces carry different signals. The electromagnetic radiation that canoriginate from one signal might affect the other sisgnal hence corrucpting the data flowing in it.

Remember that the listed challenges above are just some of the challenges that you might come across during the design of the PCB. Otherwise, we have so many others that we have not mentioned above and all of them just have one thing in common which is causing of disturbance to the signal you are sending from point 1 to point 2.

  • Anytime the signal path is disturbed, the integrity of the data being send is corrupted and therefore, your work as a high speed PCB designer is to ensure that the integrity of the signals is protected at all cost.
  • The signal should leave point 1 with a particular wave form and it should arrive at the destination which is point 2 with the same wave form and all the data intact.

How to determine if the project is high speed.

In reality, there is no a specific way to determine if the project is a high speed PCB project or not but the evaluation should be done by case to case. As we have noted in our example above, the first thing that should indicate that your project is classified as a high speed project is when you come across some signal integrity challenges in your PCB layout process.

You can identify a high speed design PCB by;

  • Some specific device designs involve high speed PCB design. Some of them are designing of cell phone boards, motherboards and DSL routers are classified as high speed design projects. If you will be using specific technologies such as HDMI, SPI, UARTS, I2C and USB, just know that you will be dealing with the high speed projects.
  • When the digital frequency is equal or more that the 50MHz.
  • When the PCB board being designed has a very small size and the location of the components to be place creates a huge challenge to the designer.
  • The main circuit is made up of so many subcircuit that are connected to each other by the use of very high speed interfaces such as the DSI and the CSI.

High speed PCB design Big Three Problems.

When working on the high speed PCB design, there are a number of issues that you will come across while trying to transmit your signal from point 1 to pint 2 and the main three challenges that you are likely to encounter are;

Integrity

Here we have to look at our signal at the destination and ask ourselves if the signal looks exactly as it should look like. If the signal does not look like it should, then it must have faced some interferences along the way which might have ruined its integrity.

Noise

The issue here is if your signal came across any form of interference during the transmission. It is obvious that PCB signals have some sought of noise in their output, but if this noise exceeds a certain limit, it might corrupt the signals being transmitted.

Timing

We are looking at how the signals are arriving at the destination. Are they arriving at the expected time with respect to other signals? Remember that all the signals in a PCB board are controlled by the clock and if the transmitted signal does not match with the clock signal then the signal is corrupted.

Correcting the Big Three Problems

The big three problem can be rectified by involving the following three solutions;

Matching

If traces have a matched length, it will ensure that the signals arrive at the same time and sync with the rates of the clock. Matching is a must thing when working with HDMI, SATA, USB, PCI Express and the DDR.

Spacing

The close you place your traces to each other, the more they are prone to noise and other forms of interferences. Therefore, it is advisable to ensure that your traces are having proper standard spacing. By placing your traces where they should be, with proper spacing reduces the amount of noise affecting your trace.

Impedance

By ensuring that you have proper impedance between your receiver and the transmitter will create a direct effect on the quality od the signal and its integrity. This will also have an impact on how your signals are exposed to the noise challenge.

Design rules and challenges for high speed design.

As it is in any engineering design work, there are rules that have to be followed when we are handling the high speed PCB design. Let us have a look at some of these challenges in depth;

Tuning of the trace length

Here if you are using the high speed interface, you have to do a signal tuning of the length of your traces in order to synchronize your signal propagation. If you miss to do the synchronization, then expect your interface to fail at very high frequencies or even not to work at all. Therefore, the tuning aspects is a very important aspect when it comes to high speed designs.

  • In any high speed design, there shall be two types of interferences and that is the parallel and the serial interface.
  • The parallel interface will involve the length of the trace tunning only while for the serial interface signals are united into several differential pairs.
  • The tunned differential pair
  • Below is the tuned length of tracks;
  • Tuned parallel interfaces.

Shape of the truck

It is very rare to meet straight tracks from the source to the receiver on a PCB especially when the high speed design is involved because you have to keep bending the tracks while looking for track locations that will fine tune the trace. In real sense, tracks required smooth, rounded corners without sharp bending and you will need a lot of time to make that possible. What makes since task more time consuming is the fact that you will have to redo this so many times repeatedly until you get the optimized path.

Don’t bent tracks at 90 degrees because the width of the track changes affecting the impedance of the track. It is advised you do the bending at 45 degrees as shown in the figure below;

The impedance

Any time you are doing a PCB design, it is very important to make an observation of the single-end point ZO impedances and also as well as the differential impedances Zdiff.

Adherence to the correct impedance is one of the most important rules in the design of the PCB.

Given below are the parameters for the differential impedance calculations;

Location of the components

Component placement is one of the most important rules in process of high speed PCB design. Before you begin this process, you have to mark where you are going to place your component.

For example, you can place components according to their functions. If components do same functions or even related purpose, they should always be in the same location to each other.

Analog components should be placed in their locality, with their ground different from others to avoid the EMI.

During placement, remember that the tracks are not long and therefore you should ensure that you leave the space for tuning.

Termination

Most common type of termination is the parallel termination. This is where a resistor is placed in the track between the differential pair and as close to the receiver as possible.

The purpose of termination is for getting rid of the reflected signals in the truck and this leads to the upgrading of the data that is being transferred. When differential pairs are used, the resistor should be equal to the differential impedance or less than the differential impedance.

Grounding

In most occasion, it is very impossible to completely trace high speed interfaces in a single layer and this will require introduction of vias in order to move the traces from one layer to another.

Vias are just electroplated holes that allows you to move the tracks from one layer of the board to the other.

It is very important to ensure that you accompany the track via with a ground via. These vias are called stitching vias and they help in maintaining the use of a single reference point in the high speed PCB design.

Tips for high speed PCB design.

Start with a plan

This is a basic thing in PCB design and it is very important to have a plan to avoid so much errors and issues in the design process. So before doing any connections of the symbols or the net list you need a checklist at hand so that you can confirm what to do next to ensure that you have done everything accordingly. The plan will help in;

  1. Organization of the system
  2. The power supply
  3. The signal speed
  4. Sensitive signals identification.

This are not the only things that you will consider during planning but it is among the first things to do.

Every detail of your board stackup for manufacturing documentation.

After having the plan, the next thing is to ensure that your layer stackup are documented. This is where you have to contact your manufacturer in order to know which material you will use in the design and also and what type of constraints you should employ in those designs.

Expect to work with the following type of materials;

  • FR-4
  • Nelco
  • Rogers

Floor planning

Here you have to organize your board into logical sections. Remember high speed boards are organized into many subcircuits and it is your duty as a designer to determine where each subcircuit should be placed.

This is more so for the case of the analog and digital signals which require that they placed in separate places so that they cannot interfere with each other.

Your physical floor planning should have something like what is below;

Use of power and ground plane

Now that your plan and stackup is fully laid, it is time to get into important details that you will need in order to start the design.

The size of your land patterns should be kept at minimal.

I the previous design, you might have been using very large pads maybe for easier soldering and inspection. For the high speed design, the space you leave is the key for the success and therefore pads should be 0 to 5% of the size of the components. This drop in space will always help in improving the mechanical strength of the board.

Signal routing for maximum shielding benefits

The high frequency signals will be producing a lot of electromagnetic effects as they travel from the source to the sinking region. And this might lead to two signals having an interference on each other. To avoid this, consider each of the following;

  1. Minimize parallel signals
  2. Ensure you maintain us much distance between your signals as possible
  3. Signals between layers should be routed orthogonally.

Efficient path for current should be provided.

This will involve the use of vias so that to avoid the current path from crisscrossing each other or the ground and to make sure that the signal integrity is maintained.

Ensure that you employ the use of the 3W rules in order to minimize coupling between traces.

Use the 20H rule to ensure that the coupling is at minimal.

7 Tips for Selling an App

Selling an app to a buyer requires a careful approach to extract the most value from the digital asset. The marketplace for apps extends well beyond the iOS and Android market to ones for e-commerce platforms, Amazon’s Alexa, Salesforce, and many other places.

If you’re thinking ahead about the long-term prospect of selling your app that’s now in development or wanting to exit in the next year, these 5 tips for selling an app are for you.

Can You Sell The App?

You might believe it is time to cash out your app, but there could be a few problems in your immediate future. Apps developed for the Apple ecosystem can’t always be transferred from one developer to another. It is a good idea to check the latest criteria on app transfers before you look at selling your app. While developers can transfer an entire account to a buyer, it will limit the price you can ask for.

Apps Don’t All Sell the Same

Apps don’t all sell with similar multiples or attract the same level of interest.

It depends on how large the related app marketplace is, how many apps are for sale, and the pool of interested buyers too. The multiple of earnings for app sales reflects their long-term potential but also the demand in that particular marketplace.

If you discover that the app you’ve developed and built up over the years sits in a marketplace that isn’t much in demand, maybe choose differently next time?

Maximize Value by Marketing Better

It’s necessary to get the most value from your app before listing it for sale. Ideally, any boost in top-line revenues should have occurred months ago. This helps to confirm that it wasn’t a one-time bump and is sustainable.

So, when identifying profitable marketing channels, do it as early as you can. Avoid trying one and adding others incrementally over the years. It’ll make it harder to implement them all before you’re thinking about selling the app.

Ensure the Customer Reviews Are Positive

A buyer is purchasing the app’s code, an existing relationship with its customers, and the reputation of the app too. When there are negative reviews left and right, the listing will be avoided.

It might be impossible to not get any negative reviews – some people are overly critical – but deal with them pragmatically. Reply to them in an informative, helpful, and friendly manner. Even if the review was unfair, unbalanced, or rude, don’t reciprocate.

Also, if one or more points within the review were valid, update the app to address those. Then amend your response to reflect how the app has been updated based on their observations.

Reconsider the Pricing Model

Apps are typically sold for up to 36X the app’s monthly profit. So, that’s the money you make after all associated expenses have been deducted. Be clear on this figure from the get-go. Potential buyers will want to see evidence of your earnings. Even if an app is making good sales, if operational costs are high, profit margins are going to be lower.

You may have landed on the best pricing model that’s fine with the customers and extracts the most value for what’s offered. However, it might just be the first one you tried, and you never considered any others.

Before concluding that that’s all your app can realistically generate, reconsider all options. Do some market research with current customers to gauge their reaction to switching the monetization model. See if there’s any wriggle room to add a premium version, extra features, add-ons, or something else to increase the app’s earnings when selling it.

Remember, an app is only worth what someone will pay for it. Be realistic about how much you can charge for the app. If you overvalue the app, interest will be limited for obvious reasons and you may struggle to find any buyers willing to take things to the next level.

Ensure the App Doesn’t Flout Expected Standards

While an app might flout standards set for the marketplace, it can’t do so forever.

Any broker or prospective buyer who’s aware of the appropriate standards will actively avoid an app that’s in breach of them, especially if they’ll be eventually stuck with making changes to fix the problem after delisting and begging forgiveness from the powers that be.

Depending on the marketplace, standards differ. Therefore, they must be investigated properly. For example, there are established WordPress Coding Standards. For WordPress plugins, these state that they must be written in the PHP language and be fairly easy to interpret. Spaghetti code that technically runs but is confusing and intentionally so won’t pass muster.

Also, requirements do change, so verify before any app sale listing it still isn’t in breach of standards that came into force recently.

Is it the Right Time to Sell the App?

Prepare ahead of time before selling your app and consider whether this is a smart business decision. Often, there is no good reason to sell an app, as you can continue making a great monthly income and the app won’t be worth any more in a year. However, you may have personal reasons for wishing to take a step back, and that’s OK. You may also want to pursue new development opportunities, which is another common reason why developers decide to sell a successful app and move on to the next project.

It’s also worth pointing out that there are tax benefits, as the sale profit could be classed as capital gain and taxed at a lower rate. Speak to an accountant to verify this first.

Once you are ready to sell, it’s time to look for buyers. There are sites where you can list an app for sale, such as Flippa, or you can work with an app broker. Either way, don’t rush into anything, and always check the reviews first if you decide to use a broker.

Finally, never accept the first offer you receive, it’s likely to be a low-ball offer and you can do much better if you exercise some patience.

Introduction to Ceramic Printed Circuit Board

Hello friends and welcome to this article. Today we are going to have a look at the introduction to the ceramic printed circuit boards. we have previously introduced what a printed circuit board is and we noticed that it is a very important part that makes electronic circuits complete and well organized. Having that in mind, we had also discussed several materials that build up these PCBs and today our focus is on the ceramic types of PCBs.

Introduction to Ceramic Printed Circuit Board

  • This printed circuit board is referred to as ceramic PCB because of the substrate used in the construction of this board is made up of ceramic and it finds applications in special areas.
  • The process of making this board is that copper is pasted on the surface that is made up of alumina ceramic which is the substrate material at a very high amount of temperature.
  • Its substrate material offers a very high value of conductivity features, very great insulation factors and provides easy soldering surfaces.
  • The most preferred manufacturing process is the laser rapid metalization technique which is a very important process.
  • The structure of ceramic borders is very simple when compared to other types of these boards and it offers high-level operations than what is offered by the other type of boards.
  • The size of the conductive layer used in this type of board is between one micrometer and 1-millimeter thickness.

How to order Ceramic PCB

There are many online PCB companies, where we can place our PCB orders and the best of them all is JLCPCB. JLCPCB is a China-based PCB Fabrication house and offers the cheapest PCB rates. It's quite simple to place your PCB order on the JLCPCB official site. Here are the steps:

  • First of all, create an account on the JLCPCB site.
  • They have an online PCB calculator, where you can calculate the final price of your order by adding all your requirements.
  • Next, you need to upload the Gerber file of your PCB design.
  • Finally, made the payments through an online secure payment gateway, they have multiple options i.e. Visa, MasterCard, PayPal.
  • That's it, once your order got ready, you will get it through DHL express delivery service.
[video width="1920" height="1080" mp4="https://www.theengineeringprojects.com/wp-content/uploads/2021/12/homeOrderVideo.mp4"][/video]

Structure of the ceramic PCB

In this discussion, we shall have a look at a single-layer ceramic PCB. It consists of; the ceramic substrate layer, the copper layer and the solder mask layer. Let us have a look at the image below which is a double-sided layer ceramic PCB constructed through the normal method of lamination.

Ceramic substrate

  • Compared to the FR-4, ceramic has good thermal conductivity and thermal insulation features and there in these boards, ceramic plays two very important roles one is about thermal dissipation and the other is about providing insulation between the board’s circuit layers.
  • When double or multilayer ceramic PCB is required, vias are necessary for providing connection between the layers. To achieve this, vias are drilled through the ceramic substrate by the use of laser technology.
  • The drilled vias are then filled with the copper core through plating.

Copper layer

  • This is in form of a thin copper foil that is bonded to the substrate by the method of magnetic sputtering.
  • After bonding the copper foil on the ceramic substrate, the circuit is etched on the copper by the use of the photoresist coating of the yellow light way.

Dielectric layer

  • Made up of various materials such as epoxy resins, phenolic, etc.
  • It is used to bond the structures of two adjacent ceramic substrate layers.
  • This substrate has poor thermal conductivity properties compared to the ceramic material hence it ends up affecting the overall thermal conductivity of this board.
  • it is important to note that ceramic boards can only be used in applications that have lower heat dissipation.

Solder mask

  • this has the importance of protecting the exposed copper wires from solder, metals and damages from the environmental conditions.
  • The solder mask is applied on the top layer of every PCB after completion of lamination. It might be white, green, beige, red, etc in color.

Single-sided layer ceramic PCB is shown below;

We can notice that it has a copper layer, the substrate layer and the copper shield but the dielectric is missing. This is because the two ceramic layers are bonded by the PP.

Types of Ceramic PCB

Ceramic PCBs are classified according to ceramic substrate material used and also according to the manufacturing method that was used. Let us have a deeper look into these classifications below;

Classification according to the type of ceramic substrate used

Alumina PCBs

They are the most used types of ceramic PCBs and aluminum oxide is the most readily available substrate.

Aluminum nitride PCBs

They are also commonly used PCBs but they are a bit expensive when a comparison is done with the alumina PCBs.

They gave high thermal conductivity and smartly higher frequency performance again when compared to the Alumina ones.

Silicon nitride PCBs

More costly when compared with the aluminum nitride PCBs. They have higher mechanical strength and toughness hence finding greater use in the power modules such as IGBT and military modules.

Silicon carbide PCBs

This is diamond and has high thermal conductivity and electrical conductivity. They find applications in the areas of laser technology.

Boron oxide PCBs

Has dozen times boron activities than the alumina ceramics but this type of ceramic is very poisonous. They find use in high power and frequency applications

Classification according to manufacturing.

High temperature co-fired ceramic – HTCC

This is the earliest method known for PCB manufacturing. The method is suitable for high power and not for high speed or high-frequency PCB manufacturing.

Direct bonding copper method – DBC

This one requires lower temperature compared to the HTCC. They have no PTH vias and they are mainly preserved for power electronic module packaging.

Thick film ceramic PCBs

This has a requirement that the circuit line space should be at 60 micrometers. They find their use in applications that require lower power utilization.

Low temperature co-fired ceramics PCBs – LTCC

They are usually multilayer and normally three-dimensional. They are best suited for communication devices with high frequency.

Thin-film ceramic PCBs.

Has very high precision circuits but the copper layer has a limited thickness. These types of PCBs find their use in high precision devices and also in very small devices development.

Direct platting copper PCBs

They are developed from thin-film technology and can be in 3D and has very high circuit precision. They find their use in high-frequency and high-power circuits.

Characteristics of the ceramic PCBs.

Ceramic boards have very distinct characteristics that always give them an advantage over the other type of boards. below is the list of these special characteristics;

  • They are excellent heat conductors.
  • Offers excellent CTA component compliance.
  • With ceramic PCBs expect a high level of mechanical compatibility.
  • They are not easily corroded by chemicals.
  • It is very simple to do a high-density outline in these types of PCB boards.

Benefits/advantages of the ceramic PCBs

The ceramic PCB boards are given high priority due to a number of material features and characteristics that they offer which proves to be beneficial in the process of PCB manufacturing. The character of heat dissipation gives this board an advantage over the traditional types of PCB boards. components of the board are placed on the boards directly without the involvement of the isolation layer and this makes the flow of heat throughout the board better compared to the other types of boards. The following are some of the benefits that make this board the most preferred;

High thermal expansion

They are the most popular in the field of electronics due to their features that are unique. One of these features is that it provides a very high thermal coefficient expansion. These boards will still offer very high thermal conductivity even when operated at high temperatures.

Adaptability

These types of boards use a metal core. The metal core is used when the board is undergoing the engineering process. The board can be changed to a rigid carrier which will offer a stiff mechanical strength. This stiffness is very crucial as it allows the board to be used in both fluids and solids.

Durability

The ceramic material offers a lasting-results to the PCBs being manufactured. The toughness of the material used in the making of the board will protect it against routine wear and tear. In addition, these boards offer high thermal resistance which will slow down the decomposition of these types of boards and therefore increase their durability.

Stability

They offer very high stability which is a result of a stable dielectric property that originates from the dielectric materials. Due to the toughness of the ceramic materials, it has a natural resistance to many chemicals.

Versatility

It has a very high melting point hence it can be used in many applications for both low and high temperatures. The best thing about these ceramic boards is that they will offer good thermal conductivity while distributing heat evenly throughout the board and different positions of the devices.

Ceramic boards disadvantage

  • It is very hard to find ceramic PCB boards because they are hardly available.
  • When compared to the standard boards, the ceramic boards are very expensive.
  • These types of boards are highly fragile and therefore they require handling with great care.

Ceramic PCBs applications

Memory module applications

It was done in Japan when a company crested an SRAM memory module by the use of the multilayer ceramic PCB. The ceramic PCB is appreciated for both high-density PCB and low-density PCB. Another example is about the USA company that had developed the telecommunication, aerospace and missile products using this type of board.

Transmission module

This is being done by an American company that is determined is building a transmission module for radar communication using the ceramic PCB boards.

Digital PCBs

Japanese have used low-temperature PCBs in the manufacture of digital PCBs. This is used because it reduces the weight of the circuit greatly. It also reduces the volume of the circuit.

Interconnect boards;

The ceramic boards are mostly used in printed circuit boards because they support the miniaturization of the devices. It has a very high probability in the application of the boards in multilayer interconnects.

Solar panels

HTCCs and LTCCs are both applied in the process of making photovoltaic panels. In this device, we shall use multilayer ceramic PCBs to make them tough and durable.

Electrical power transmitter

There has been an increase in the use of wireless power transmission systems and this implies that most power transmission system has to use ceramic boards to achieve that ability.

Semiconductor coolers

With the introduction of very small pocket gadgets, many electronic circuits are getting miniatured. To achieve miniaturization, it starts with the use of semiconductors that have a highly reduced size. The normal boards cannot give the support needed in order to make sure that the miniaturization process is fully achieved. In order to make this possible, ceramic semiconductors have been introduced and this is accompanied by the use of ceramic PCBs.

How to choose the right ceramic PCB manufacturer

When you are choosing the person or the manufacturer who can produce your board, you have to consider the manufacturer who has the superior tooling that is required to make the process successful. The manufacturer should be able to control the oxidation process so that the board can have superior thermal conductivity and higher temperature resistance.

Ensure that the manufacturer uses the automated process to do the manufacturing and this will make sure that your board is in perfect condition and of very high quality and the process will be less time-consuming.

Introduction to the MATLAB Datatypes

Hello friends. In this lecture, we are going to have a look at the different kinds of MATLAB data types.

As we have already seen in previous lectures, MATLAB stands for MATrix LABoratory and allows us to store numbers in the form of matrices.

Elements of a matrix are entered row-wise, and consecutive row elements can be separated by a space or a comma, while the rows themselves are separated by semicolons. The entire matrix is supposed to be inside square brackets.

Note: round brackets are used for input of an argument to a function.

A = [1,2,3; 4,5,6; 7,8,9];

An individual element of a matrix can also be called using ‘indexing’ or ‘subscripting’. For example, A(1,2) refers to the element in the first row and second column.

A larger matrix can also be cropped into a smaller matrix, as we can see in the example below.

A scalar is just a special case of a matrix and its element size is 1x1. Square brackets are not needed to create a scalar variable. Also, a vector is a special case of a matrix with a single row or column. Square brackets without an element inside them create a null vector. We see examples of this in the code below:

  • u = [1 2 3]; %Produces a row vector
  • v = [1;2;3]; %Produces a column vector
  • X = []; %Produces a null vector

Elements of a matrix can be all kinds of numeric datatypes, whether they are floating-point, integers, or imaginary numbers, as we will see in the next section. They can even be symbolic.

DataTypes of MATLAB

Every variable that is stored in the workspace of MATLAB has a datatype. It can be an in-built or default datatype or users can build their own datatypes depending on the purpose of the code.

You can always find a datatype in MATLAB by using the 'class’ function.

Numeric datatypes:

Double:

  • This datatype takes 64 bits to store a number. This essentially represents a floating-point number, i.e., a decimal number with double precision, and can be positive or negative. You can use the function ‘double’ to declare the datatype when creating a variable, but double is the default datatype in MATLAB and whenever you call a command such as the one shown below, the number is stored as a double.
  • These variables can store values varying from between -1.79769 x 10308 and -2.22507 x 10-308 for the negative numbers and the range for positive numbers is between 2.22507 x 10-308 and 1.79769 x 10308 In situations where such large values of numbers are not needed, single-precision floating-point variable can be used.

Single:

  1. When storing smaller numbers, it is better to use the single-precision floating-point numbers which vary between-3.4x10^38 and 3.4x10^38. This stores a variable in only 32 bits and helps to speed up the code. We use the function single in order to create this kind of variable.

Integers:

  • MATLAB supports four types of signed integers and four types of unsigned integer datatypes, given by, int8, int16, int32, and in64 for the signed integers, and uint8, uint16, uint32 and uint64 for the unsigned integers. The number refers to the number of bits required to stored these integers and the range of allowed numbers is decided accordingly.

Complex numbers:

  • You can create a complex number by using the ‘complex’ function or using the default symbol ‘i’ for the imaginary part of the complex variable. We can also extract the real and imaginary parts of the complex number using the ‘real’ and ‘imag’ functions on the complex number.

Infinity and Nan:

  • Any number larger than the range given above is represented in MATLAB by the value ‘Inf’. Such a number can result when we divide by zero, which leads to results too large to represent as floating-point values and they end up being outside of the ranges discussed above. We can check if a variable is an infinity or not by using the function ‘isinf’ on it. Some numbers that can’t be represented by a real number such as the result of calculating ‘0/0’ or ‘inf/inf’ are called NaN, i.e., “Not a Number”. We can check if a variable is NaN or not by using the function ‘isnan’ on it.

Logical:

  • These are variables that only have values of 0 and 1, and are the result of a comparison operation. An example of a result of comparing two matrices that gives a logical matrix as an output is shown below:

Representation

We can represent the output of a double in a shorter format which is easy to read or in a longer format which will help with learning about the accuracy of those double variables, using the commands below:
  • format short
  • format long

Conversion of numeric datatypes:

We can convert between double or single-precision numbers, as well as from floating-point to integers or vice versa using the functions described above which we use while declaring the numeric data type.

Operations on numeric datatypes:

Following is a list of operations on the numeric datatypes.

  • abs: to determine absolute and positive value of a signed or complex number.
  • Fix: round-off a floating point number towards 0. For example, fix([-2.1, 2.9]) = [-2, 2]
  • floor: round-off a floating point number towards –Inf. For example, floor([-2.1, 2.9]) = [-3, 2]
  • ceil: round-off a floating-point number towards +Inf. For example, ceil([-2.1, 2.9]) = [-2, 3] round: round-off a floating-point number towards the nearest integer. For example, round([-2.1, 2.9]) = [-2, 3]
  • Rem: Remainder after division of first argument by second argument. For example, rem(10,3)=1
  • Sign: signum function returns the sign of a number.

Other datatypes:

Characters/strings:

  • The character or string array is used to store text data in MATLAB.

Single quotes are used to declare a character array. For example,

A = ‘Hello World’ is a character vector.

However, double quotes are used to declare a string. String is different from a character because individual parts of a character array can be accessed using indexing but the same is not true for strings.

You can carry out the exercise shown below to understand this subtle difference.

The various operations that can be performed on character array include:

Cell matrix:

  • Just like matrices, a cell array is an indexed data container with each element known as a cell and can contain any type of data, including other cells and arrays which can be numeric or non-numeric types. Cells can be declared with curly braces, { } to let MATLAB know the input is a cell array. Individual cells inside a cell array can be called using round parentheses whereas contents at a location can be accessed by curly braces again, as shown in the example below:

The function ‘cell2mat’ takes a cell as an argument and outputs a matrix. However, for this, all the elements of a cell array must be the same data type. This is what distinguishes Cell arrays from Matrices.

Tables:

  • A table is a convenient data structure to write column-based or tabular datasets that can be stored in a text or spreadsheet file, or plotted easily as well. Tables let you access individual columns with variable names. Each variable can be a different datatype. The only restriction for different columns is for them to have the same number of rows. You can load the inbuilt tabular dataset inside MATLAB as shown below.

Structures:

  • Structures are the most generic datatype in MATLAB which consist of indexed elements and each index can store a different datatype or in fact, a structure itself. Such structures are known as nested structures and the various branches of a nested structure can be accessed using the dot notation.

Non-numeric datatypes also include function handles, symbolic variables and anonymous functions but they are a topic worth a separate lecture for discussion and will come up in the upcoming lectures.

In further chapters, we will look at some of the applications of MATLAB in Linear algebra, look at different kinds of matrices inside MATLAB that are commonly used in a linear algebra class, and also work with input and output of data and functions using ‘m’ files as well as ‘mat’ files. We will also read about saving and loading operations, for input and output of data from MATLAB, and we will look further at making GUI in MATLAB, plotting linear, polar, 2D and 3D graphs with data sets.

Regulated Power Supply Using LM317

Hello geeks, welcome to our new project. We are going to make an important project which will be very useful for us in our daily life which is a variable DC power supply. As engineers who work with electronics need different voltage ranges of DC power supply for different electronic projects and components. It becomes very clumsy and hard to manage different power supplies because of wires which are connected to it and each power supply consumes an extra power socket as well.

So in this project, we will overcome this issue and learn to make an adjustable DC power supply, in which we will get a wide range of voltages.

Software to install

We will make this project in the simulation, as it is a good practice to make any project in the simulation first so that if we do any mistakes or errors in the circuit, which can be corrected without making any physical damage to actual components.

To make this project we will be using the Proteus simulation tool. A brief about the Proteus, it is a simulation software for electronics, here we can make different types of electronic circuits and run the simulation and it will give us the real-time working model of our circuit. Also, we can easily debug in case of a wrong connection.

It has a very large database of pre-installed components which has basically all types of different electronic components and in case, if it is not pre-installed, then we can install a library for those.

Components Required

  • One Step down transformer
  • Five 1N4007 Diodes
  • One 4700 microFarad Polarised capacitor
  • One 100 microFarad Polarised capacitor
  • Three 0.1 microFarad non-polar capacitors
  • One 5 kOhms potentiometer
  • One 220 Ohms resistor
  • One LM317 IC

Components details

1. LM317

  • It is a voltage regulator IC which has a wide range of applications in various voltage limiting circuits.
  • It has three terminals as Vin, Vout, Adjust.
  • Using these three pins only we can regulate the output voltage.
  • As the name suggests, the Vin pin is used for the input power supply, the Vout pin is used to take the output voltage, and Adjust pin is used to control the output voltage.
  • It is a very easy-to-use IC, it requires only two resistors for the circuit and it will be ready to use.
  • It uses one resistor for the RC filter and one as a potentiometer to adjust the output voltage.
  • As per the datasheet, it has a formula for calculating output voltage, and using that we can adjust our resistor value as per our requirement of output voltage.
 
  • For more details about this IC prefer the following datasheet:

2. Step down Transformer

  • Step down transformer is used to convert the high input voltage to low voltage.
  • It takes high voltage and low current as an input and it will give low voltage and high current as an output.
  • Here we will not go in-depth about the working of transformers but in brief, it has two windings as primary and secondary.
  • It is the exact opposite of the Step-up transformer as per the use case and windings.
  • In this type of transformer, there are more turns on the primary side winding and lesser turns on the secondary side winding.
  • It is mostly used in power supplies.

3. Diodes

  • Diodes are two-terminal simple electronics components.
  • It works as a valve which allows the flow of current in only one direction and limits the flow of current in another direction.
  • They are used mostly in every electronic device such as in power supply or as regulators or used in construction ICs for logic gates.
  • It has two terminals as Anode and Cathode and current is allowed to flow from Anode to Cathode side only.
  • As per the construction, it has two sides P side and N side.
  • The P side terminal is also known as Anode and the N side terminal is known as Cathode.
  • A simple PN type diode is made using the P-type and N-type semiconductors.
  • In N-type semiconductors, free electrons are in majority, and in P-type semiconductors, holes are in majority.
  • There are various types of diodes available but as per our use case, we will use a simple PN junction type diode.
  • We are using the diodes as rectifiers in this project.

4. Capacitors

  • Capacitors are electronic components that have the ability to store energy.
  • It has two terminals that are connected with two parallel conductor plates and they are separated from each other with an insulating material called dielectric material.
  • When we apply voltages across the terminals then due to generated electric field, it stores energy in the form of electric charges.
  • We have used capacitors in this project for filtering purposes.
  • There are various types of capacitors as per the use case in this project we have used the non-polarized and polarized capacitors.

5. Potentiometer

  • It is a passive electronic component using which we can vary the output voltage by changing the resistance.
  • Basically, it is a variable resistor in which we change the resistance by moving a nob.
  • It has three terminals as Vcc, Ground, and Vout.
  • There are two types of potentiometers. First is the Rotary potentiometer and the second is the Linear potentiometer.
  • In this project, we have used a rotary potentiometer.
  • The main application of a potentiometer is a voltage divider. And using this characteristic, it is used in various types of applications such as speed controlling of motors, volume control in audio systems, etc.

Project Overview

In this project, we will use the following components-

  • LM317 - We will be using this IC as the main controller of our project, using this we will regulate the voltage of the power supply.
  • Diodes - These are very important components for any DC power supply as they will change the AC supply to DC supply.
  • Step down Transformer - This will be used as an isolator and it will lower the input voltage.
  • Capacitors - These are used for smoothening the pulses and making the noise-free power supply.
  • Potentiometer - It is used as a regulator to set the output DC voltage.

Now we know the basic role of each component, so let's talk about how actually our power supply will work. In brief, the flow of our power supply will be as mentioned further.

We connect it with AC power then we will lower down the AC supply to 12-24 AC because most of the electronic component has this working voltage range, thereafter we will change the AC to DC and do the smoothening of that DC supply, and then we will regulate that using a potentiometer and LM317 IC.

  • To step down the AC voltage we have used the Step-down transformer and it will also isolate the AC circuit with the DC circuit although there are ways to step down the power without using the transformer also.
  • After that, using the diodes we will make a full-wave bridge rectifier. It will change the AC power to DC but still, it will have some ripple from the AC supply.
  • To smoothen the ripples from the AC supply we will use the RC filters, where we will connect some capacitors.
  • Now we will have the smooth DC supply that we will use as input power for LM317 IC and a potentiometer will be connected to it.
  • Using that potentiometer, we will change the output voltage.

Circuit Diagram and Working

Now we know all the components which we will use in this project and their use cases also. Let's start connecting them.

  • Start the new project in the Proteus software and import all the required components to the workplace.
  • Now, we have all the listed components in the workplace.
  • First, connect the AC power supply with the Step-down transformer primary winding.
  • On the secondary winding of the transformer, we will connect the full-wave bridge rectifier which we will make using the diodes. They are simple 1N4007 diodes.
  • First, we will make two pairs of diodes by connecting two with each other.
  • In the first pair, we will connect the Anode of two diodes with each other and leave the other two terminals free.
  • Then in the second pair, we will connect the Cathode of two diodes with each other and leave the other two terminals.
  • Now we have two free terminals in each pair, and we will connect them with each pair.
  • If you are working with real components, just remember there will be a grey color stripe on the diode so that side will be Cathode and another side will be Anode.
  • In simple words just take two diodes, connect the grey strip side of them with each other, then take another two diodes and connect the black side with each other, and after that connect them with each other.
  • It is very important to connect the diodes very carefully otherwise our power supply will not work.
  • And in case of wrong connections, it will flow the AC current in our circuit and that would be very dangerous.
  • Now we have completed our full-wave bridge rectifier so now connect the input side of that with the secondary side of the step-down transformer.
  • And connect two capacitors parallel to the output side of the rectifier. That is used for smoothening the output power.
  • One 4700 microFarad capacitor and a 0.1 microFarad capacitor.
  • While connecting the polar capacitor keep the terminals in mind.
  • Connect the positive terminal of the capacitor with the positive side of the rectifier and the negative side with the negative side of the rectifier.
  • In the polar capacitor, the longer terminal is positive and the shorter side is negative.
  • Now let's connect the LM317 IC with the circuit.
  • As we know LM317 has three pins so connect the Vin pin of IC with the positive terminal output of the rectifier.
  • Now connect the Adj pin of IC with the potentiometer and Vout of IC will be the output of the power supply.
  • We will use some more resistors and capacitors for filtering purposes.
  • Connect two capacitors parallel with the output of LM317 and one RC filter also with it.
  • At last, connect a diode from the output of LM317 with the input side of LM317 that will prevent the flow of reverse voltage. It is for simple protection.
  • Now we have completed the connection of our circuit. For debug purposes, connect a voltmeter at the end so that it will be easy to check the working of the power supply and we can monitor the change in the output voltage by changing the value using the potentiometer.

Results and Working

  • Now run this project.
  • At first, AC high voltage will be converted to low voltage AC.
  • As we know AC power is a sine wave and DC power is a straight line. It does not travel as a sine wave.
  • That will be converted by the full-wave bridge rectifier. We know that diodes allow the flow of current only in the forward bias. This means only half of the cycle of the sine wave will pass through it, that is when the sine wave is in a positive direction.
  • So to overcome this problem, we have used the diodes as full-wave bridge rectifiers.
  • When the AC sine wave will be in the positive half cycle, the diodes D2 and D3 will be in forward bias, thus they will let the current flow. But D4 and D5 will be in reversed bias so they will not allow the current to flow.
  • And when the AC sine wave will be in the negative half cycle, the diodes D2 and D3 will be in reversed bias, and diodes D4 and D5 will be in forward bias and that is how current will flow here. Thus, we will get the current in a full sine wave.
  • So the output of the full-wave bridge rectifier will be like the following image:
  • But still, this wave is not a DC current, so to make it a smooth DC current we have used the capacitors.
  • When the wave goes upward, at that time, the capacitors store the charge but when the wave goes downward, then the capacitors start discharging, and while discharging they maintain the output voltage and let the current flow.
  • But this will make some ripples and to neutralize that, we have used another capacitor that will do the same charging-discharging process and after that, we will have a straight line of pure DC power.
  • Now DC power will go into the LM317 regulator IC. Thereafter when we change the value from the potentiometer, we can see the output voltage will change on the voltmeter which is connected to the output side.
  • We can see in the following image when the value of the potentiometer is 4% then the output voltage is 2.40 volts
  • Let’s change the value of the potentiometer.
  • After changing the value of the potentiometer to 52%, we can see that output voltage is also changed to 14 volts.
  • As we can see that output voltage changes by changing the value of the potentiometer which means our regulated power supply is working well.

Conclusion

I hope we have explained all the points related to this project. And I hope this will be a very useful project for your daily use as a power supply.

Please let us know if you face any issues while making this project in the comment section below.

We will be happy to know if you will make this project and how you are going to use it in your daily life.

Thanks for reading this article and All the best for this project, see you in the next one.

Motion Detection with ESP32 & PIR Sensor

Hello readers, we hope you all are doing great. Welcome to the 4th lecture of Section 5(ESP32 Sensor) in the ESP32 Programming Series. So far, we have discussed the ESP32 built-in sensors in this section. Today, we are going to interface an external embedded sensor(i.e. PIR Sensor) with the ESP32 Microcontroller board. At the start, we will discuss the basics of a PIR Sensor(HC-SR501) i.e. its pinout and working. After that, we will design a simple project to detect the motion with a PIR sensor and ESP32. Finally, we will display the motion detection results on the ESP32 WebServer.

We will use ESP32 interrupts to detect the motion. Interrupts are used when a microcontroller needs to continuously monitor an event while executing other tasks at the same time. We have already posted a tutorial on ESP32 Interrupts, which includes both software and hardware interrupts. In this tutorial, we are implementing the hardware interrupt(Hardware interrupts are the external interrupts that are caused by an external event). In our project, the hardware interrupt will be generated by the PIR sensor.

PIR motion sensor is mostly used in home automation & security projects, used to enable the system to respond automatically over human presence. Appliances connected to ESP32 will respond automatically(as per the instructions provided) whenever an interrupt is triggered by the PIR motion sensor. Let's first have a look at the working of PIR Sensor:

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP32AmazonBuy Now

What is a PIR Motion Sensor?

In today's project, we will use the HC-SR501 PIR Sensor to detect the motion. PIR stands for Passive Infrared sensors. It uses a pair of pyroelectric sensors to detect heat energy in the surrounding environment. Both the sensors sit beside each other, and when a motion is detected or the signal differential between the two sensors changes the PIR motion sensor will return a LOW result (logic zero volts). It means that you must wait for the pin to go low in the code. When the pin goes low, the desired function can be called.

PIR Sensor Calibration

PIR Sensor has two variable resistors on its back side, used to adjust the Sensitivity and Detection Range, explained below:

  • Low sensitivity ignores the small motions i.e. a moving leaf or a small mouse. The sensitivity can be adjusted based on the installation location and project requirements.
  • The second resistor is used to specify how long the detection output should be active. It can be set to turn on for as little as a few seconds or as long as a few minutes.

PIR Sensor Applications

Thermal sensing applications, such as security and motion detection, make use of PIR sensors. They're frequently used in security alarms, motion detection alarms, and automatic lighting applications.

Now let's interface the PIR Sensor with ESP32:

Interfacing PIR Sensor with ESP32

As I mentioned earlier, in today's project, we will design a motion detection project with ESP32 and PIR Sensor. In the first example, we will turn "ON" the LED on motion detection, while in the second project, we will display the results in the ESP32 WebServer.

Here's the list of the components for today's project:

Components Required

  • ESP32 Development Board
  • PIR motion sensor (HC-SR501)
  • LED
  • 1k Ohm resistor
  • Jumper Wires
  • Breadboard

Circuit Diagram

Here's the circuit diagram for motion detection with ESP32 and PIR Sensor:

Now let's design the programming code for motion detection:

ESP32 Motion Detection Code

We are using Arduino IDE to compile and upload code into the ESP32 module. You need to first Install ESP32 in Arduino IDE to get started. Here's the code for motion detection:

//----Set GPIOs for LED and PIR Motion Sensor
const int led = 23;
const int PIRSensor = 4;

// -----Timer: Auxiliary variables
#define timeSeconds 10
unsigned long now = millis();
unsigned long lastTrigger = 0;
boolean startTimer = false;

//---Checks if motion was detected, sets LED HIGH and starts a timer
void IRAM_ATTR detectsMovement()
{
    Serial.println( " MOTION DETECTED " );
    Serial.println("Turning ON the LED");
    digitalWrite(led, HIGH);
    startTimer = true;
    lastTrigger = millis();
}

void setup()
{
    Serial.begin( 115200 ); // Serial port for debugging purposes
    pinMode( PIRSensor, INPUT_PULLUP ); // PIR Motion Sensor mode INPUT_PULLUP
    pinMode( led, OUTPUT );
    digitalWrite( led, LOW );
    attachInterrupt( digitalPinToInterrupt( PIRSensor ), detectsMovement, FALLING ); // Set PIRSensor pin as interrupt, assign interrupt function and set RISING mode
}

void loop()
{
    now = millis();
    if( startTimer && (now - lastTrigger > ( timeSeconds*500)))
    {
        Serial.println(" Turning OFF the LED " );
        digitalWrite( led, LOW );
        startTimer = false;
    }
}

Variables Declaration

  • The first step is to set up the GPIO pins for the LED and motion sensor(PIR).
  • LED is connected to GPIO23 and PIR sensor to GPIO4, as shown in the below code:
//----Set GPIOs for LED and PIR Motion Sensor
const int led = 23;
const int PIRSensor = 4;
  • Next, we need variables to set the timer to count the time, after the interrupt is detected.
  • The variable "now" defines the current time
  • The variable "lastTrigger" defines the time when the interrupt is detected.
  • The variable "startTimer" is used to start the time when an interrupt is detected.
//-----Timer: Auxiliary variables
#define timeSeconds 10
unsigned long now = millis();
unsigned long lastTrigger = 0;
boolean startTimer = false;

ESP32 Interrupt Function "IRAM_ATTR"

  • The Function with the attribute "IRAM_ATTR" is executed inside the internal RAM.
  • We are assigning this attribute to our interrupt function because RAM (random access memory) operates faster than flash memory.
  • After the execution of the interrupt code or ISR, the normal code will be executed inside the flash memory.
  • It is recommended that the interrupt service routine should have the minimum possible execution time because it halts or blocks the normal program execution.
//---Checks if motion was detected, sets LED HIGH and starts a timer
void IRAM_ATTR detectsMovement()
{
    Serial.println( " MOTION DETECTED " );
    Serial.println("Turning ON the LED");
    digitalWrite(led, HIGH);
    startTimer = true;
    lastTrigger = millis();
}

Setup() Function

  • Inside the setup() function we are initializing the serial communication with a baud rate of 115200.
  • Set the mode of pin GPIO23 (LED) as output.
  • Set the initial state of the LED as LOW.
  • Assigned the digital pin(connected to the PIR Sensor) to hardware interrupt using the attachInterrupt function.
  • The detectMovement function is passed as an argument inside this function.
void setup()
{
    Serial.begin( 115200 ); // Serial port for debugging purposes
    pinMode( PIRSensor, INPUT_PULLUP ); // PIR Motion Sensor mode INPUT_PULLUP
    pinMode( led, OUTPUT );
    digitalWrite( led, LOW );
    attachInterrupt( digitalPinToInterrupt( PIRSensor ), detectsMovement, FALLING ); // Set PIRSensor pin as interrupt, assign interrupt function and set RISING mode
}

Loop() Function

We have activated the interrupt in the Setup Function, so when the PIR Sensor detects the motion, it will automatically execute the interrupt function, which will turn the LED ON and start the timer.

  • In the loop function, we are comparing the current time with the last triggered time.
  • LED will turn off after a delay of 5sec (once an interrupt is detected).
  • The variable “now” will be updated with the current time in each iteration.
void loop()
{
    now = millis();
    if( startTimer && (now - lastTrigger > ( timeSeconds*500)))
    {
        Serial.println(" Turning OFF the LED " );
        digitalWrite( led, LOW );
        startTimer = false;
    }
}

Motion Detection Results/Testing

  • Select the right development board from Tools >> Boards >> DOIT ESP32 DevKit V1 in Arduino IDE.
  • Compile and upload the code into ESP32 using Arduino IDE.
  • Open the serial monitor with a 115200 baud rate as defined in the Arduino code.
  • Press the EN button on the ESP32 development board.

This concludes the tutorial. I hope you find this tutorial helpful. Thanks for reading. See you soon with a new tutorial on ESP32. Take care !!!

Christmas Tree using Arduino

Hello Geeks, I hope you all are doing great and enjoying your festive seasons. This time, we have come up with a new project which will make your festival a bit brighter so here comes a Christmas tree.

It is said that Christmas is the center of all the celebrations. Did you guys know the scientist who discovered the light bulb, Thomas Edison and his friends were the first to put up the light bulbs on the Christmas tree, and here we are going to keep that tradition forward? Well, it’s time to gear up for the next season of Christmas being tech-savvy. Hence we have decided to brighten up a Christmas tree with the usage of Arduino Uno and LEDs in real life.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2Arduino UnoAmazonBuy Now

Software to Install:

To make our festival a little safer, we will first make our Christmas tree in the simulation and for that, we will use the Proteus simulation software. Making it in the simulation will give us a good understanding of how it is going to work, and how we are about to design the Christmas tree such as the placements of lights and lighting patterns.

Proteus is a simulation tool for electronic projects. In this software, we can make approximately every type of electronic circuit and run the working simulation. It will show the real-time working simulation of the circuit and errors as well if any occurs.

It has a large database of mostly all types of electronic components but still, for some, we have to install libraries. In this project, we are using Arduino UNO and it is not pre-installed so we have to download it first.

Project Overview:

Following components will be required to design our Christmas Tree

  • Arduino UNO - It works as the main controller in the project. We have used this to make different types of lighting patterns and using this, we will have a scope to make interesting lighting effects.
  • LEDs - We will need LEDs for our Christmas tree. We have used different colors of LEDs to make the matrix shape circuit for the Christmas tree.

Components required:

  • Arduino UNO
  • Different colors of LEDs

Components Details:

Arduino UNO

  • Arduino UNO is an open-source development board that we will use in this project.
  • There are many types of Arduino development boards available but as per our requirement, we will be using Arduino UNO.
  • It uses the ATMega328P processor.
  • This microcontroller has a RISC-based architecture.
  • It has 32KB flash memory, 2KB of SRAM and 1 KB of EEPROM.
  • Talking about the communication peripherals, it has 1 SPI, 1 I2C and 1 UART on board.
  • It comes with 6 individual PWM channels and 6 channels of ADC.
  • There are 14 digital pins starting from D0-D13 and 6 analog pins starting from A0-A5 in this.
  • D10-D13 can be used for digital I/O and SPI communication pinouts.
  • A4 and A5 can be used for analog I/O and I2C communication pins.
  • To power the Arduino, we can use the USB or Vin pin of the Arduino UNO board.
Note - It is recommended to disconnect any connection which is connected with the D0 and D1 pin of Arduino UNO before uploading the code otherwise it will cause issues in communication with the Arduino UNO and there can be an error for the same.

LEDs

  • In this project, we have used different colors of LEDs for our Christmas tree.
  • LED stands for light-emitting diode.
  • It is one of the most efficient light sources compared to all other types of lights or bulbs.
  • They are used mostly in all types of electronics projects such as display, indicators or works as a light source.
  • Due to the long range of applications, LEDs come in a variety of shapes and colors.
  • There are two poles for connecting it, one is short and the other one is longer.
  • Talking about the connection, the longer side pole will be connected to positive voltage and the shorter side will be connected to the ground.
  • As LED is a type of diode, the current will flow in only one direction. In case, if we connect the wiring incorrectly, it will not work.
  • But still, if we have connected the LED wrong, no need to worry, just flip it over.

Mostly it has not been damaged yet.

  • LEDs come in different voltage working ranges but here we have used 5v operating

Circuit Diagram and Working:

Now let's start with the circuit diagram of our project. The first step would be to import all the components to the workspace of Proteus software.

We will be using one Arduino UNO for controlling the LEDs and six different colors of LEDs. Here we will make 6 rows and 6 columns of LEDs for our Christmas tree, so we will be using 6 Aqua color LEDs, 6 Green color LEDs, 6 Orange color LEDs, 6 White color LEDs, and 6 Yellow color LEDs.

  • After importing all the components to the workplace, it’s time to start connecting them.
  • We will use 6 pins of Arduino UNO for rows and 6 pins for columns. As we know, Arduino UNO has 14 digital pins but as suggested we should not connect any connections with D0 and D1 pins.
  • We will connect from D2 to D7 with the rows and D8 to D13 for columns.
  • While connecting the LEDs, we must be very careful in case, if we connect any wrong terminal or any wrong connection, our whole tree will not work because all of them are connected in series with each other and that is the drawback of series connection.
  • In case any connection is loose or wrong then all of the connected components will not work.
  • Keeping this in mind, when we will use the real components, make sure all the LEDs are working fine otherwise we will not get the desired output.
  • Don’t leave any loose connections or hanging wires.
  • It would be easy if we would connect it in steps therefore we will divide it into three steps.
  • First, connect all LEDs and make a 6x6 matrix. For connecting those we can use the simple twisted copper wires.
  • While connecting the LEDs, mind the terminals.
  • Now we will connect the column pins.
  • After connecting the pins, we will connect the row pins.
  • We have divided the connections in different pictures so that it would be easy to understand.
  • After completing all the connections, our circuit will look like as shown in the picture below.
  • Here, we have adjusted the wires, so that it will be in shape as the Christmas tree.
  • After completing the connections, there may be a doubt about the working of this circuit.
  • It is a little tricky, we have to make sure from the coding side that whenever we want to glow any LED, its ground terminal should be logic LOW and the positive terminal should be logic HIGH.

Arduino Coding:

After the connection of the circuit, let's start to code our Christmas tree:

  • For writing the code, we will be using the Arduino IDE.
  • In this application, we will not require any external library.
  • So our code will be divided into three parts: first declaration of variables, pin definition and setup and the last main application logic.

Code declaration

  • First, declare two arrays for rows and columns.
  • In those arrays, we will store assigned pins for each row and column.
  • As we are using D8 to D13 for columns, that will be stored in the “column” array and D2 to D7 for rows, similarly, that will be stored in the “row” array.

Void setup function

  • This is one of the most important functions as per the structure of the Arduino sketch.
  • As we are using the GPIO pins to control the LEDs, we will set the pin modes of LEDs to be in output mode.

? We have declared all the row and column pins in the output modes.

Void loop function

  • In this function, we will write our main application code for our Christmas tree.
  • Here we will write the interesting patterns to glow the LEDs of the tree.
  • While making patterns, we only need to focus on two points, first, if we want to glow LEDs sequentially from rows, in this case, set all the pins of the column to logic HIGH state and if we want to glow the LEDs sequentially from columns then we need to set all the row to logic LOW state.
  • Keeping the above-mentioned points, we can glow any pattern on our tree.
  • For blinking the LEDs in a row-wise direction. We have to set all the column pins to HIGH state and then toggle the rows pin to HIGH-LOW.
  • For blinking the LEDs in a column-wise direction. We have to set all the row pins to LOW state and then toggle the column pins to HIGH-LOW.
  • To turn off all the LEDs, either set all the pins of columns and rows to logic HIGH or set all the pins of columns and rows to logic LOW.
  • To turn off the LEDs by setting all column and row pins to a HIGH state.
  • To turn off the LEDs by setting all column and row pins to LOW state.
  • We can use either of the above-mentioned logic depending upon the next pattern.
  • Using these simple logics, we can write various patterns.
  • Here in this code, we have written some interesting patterns that would be easy to understand while running the code.

After completing the development side of the Christmas tree, it is time to test it.

Results and Working:

  • As we have successfully completed the coding and the wiring part of our project, let's start the real fun of running it.
  • In the Proteus, to run any application code, it requires a hex file of the application code.
  • First of all, we need to generate the binary or hex file of our application code using the Arduino IDE.
  • To generate the hex file, we need to go to the toolbar and then click on the “Sketch” option. Thereafter click on the “Export compiled binary”.
  • After that, it will compile the code and a hex file will be generated.
  • Now add this hex file to the Proteus project.
  • To do so, click on the Arduino UNO module and go to the “Program File” option, then browse to the folder containing the hex file.
  • Now we are all ready to test our project.
  • Click on the “Play” button in the Proteus software.
  • As per our code, first, all the LEDs will blink column-wise, after every 100 milliseconds of delay.
  • Then all the LEDs will blink row-wise similarly after every 100 milliseconds of delay.
  • After that, all the LEDs will be off and it will start glowing in the column-wise pattern from both sides towards the center.
  • Thereafter, it will start glowing from the center towards the sides.
  • Each row will glow and after that, all the LEDs will be off, thereafter each will blink sequentially.
  • The working logic of this circuit is pretty simple. We just have to maintain the appropriate switching of the pins.
  • Using the same we can have different types of interesting patterns.

Here is the working demo of our Christmas Tree

I hope we have covered all the points related to this project and you have enjoyed reading it. We can use this with the real component and decorate the Christmas tree or we can use some cardboard and insert the LEDs on them in the same way.

If you have any doubts regarding the project. And we will be glad to read about how you made your Christmas tree using this project and if you try any interesting new patterns with it, please let us know in the comment section.

Merry Christmas.

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir