Project Design: Complete IoT Temperature Logger for Beginners, Part 1

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Project Design_ Complete IoT Temperature Logger for Beginners, Part 1

I have a confession to make for this project: I love collecting data, storing it, graphing it, and getting as much of it as possible. Altium Upverter® has a lot of users who are relatively new to circuit board design, which is fantastic, so I wanted to create a beginner project to introduce less experienced makers to my love of collecting data. We’re going to build a wireless temperature logger that will store data in a web platform, which we will build ourselves, thus allowing us to graph temperature over time, as well as allowing us to see the current temperature where each sensor is.

Embedded programming can be intimidating, especially when it involves wireless networks and web requests, so we’ll be making use of the excellent .NET nanoFramework to make development and debugging incredibly easy. I’ve wanted to use the .NET nanoFramework in a project since writing the article on high level programming languages in embedded projects on the Altium blog. This is a perfect project to use a high level language for, as it keeps the code very simple, easy to debug, and makes what could be the very complicated task of interfacing with a WiFi network and accessing the internet with it much simpler. Not to mention, using the .NET nanoFramework will make us able to rapidly write and test firmware for the device as we prototype it, and refine that firmware on the circuit boards we design and build without much stress.

If you’ve never built a website before, you might be a little worried about the idea of building a web platform to log the data we collect. Don’t worry, I have set up the guide for that part of the project to be easy to follow, and put two different paths that you can follow depending on your preference, and that will result in the same functionality and appearance: an ASP.NET Core with WebAPI based platform, and a PHP based platform. Both are built on open source technologies, and both will run on Windows, Mac or Linux. We will be using this web platform in a range of IoT projects in the future, so we will be building it to be extensible and operable with multiple sensor types. Everything in this project will be open source, and you will be able to freely use it and modify it for personal or commercial use.

Following along with this project will give you an excellent starting point for future projects that need to collect data, log it to a remote server, and present it to an end user. Whether you’re building an industrial asset tracker or agricultural crop monitor, you’ll be able to use this project as a starting point for your hardware, firmware, and web design.


The specifications for this project are broad, but very simple. As I mentioned in my Guide to Starting New Projects, typically for the projects I write about, I state the overall goal of the project, then proceed on to component selection. However, we have a few different segments that make up this project, so we can break down the specifications a little more precisely.


The hardware for this project needs to be able to connect to a wireless network, take temperature readings, and send those readings to a website. It would also be very nice to display the temperature reading on a screen as well. The final hardware should also be in an enclosure for protection, which we can 3D print to suit the board we design.

The temperature sensor within the device should be as accurate as possible, and capable of reading from -30°C to +50°C.


The firmware for the device will need to store temperature readings locally, but not necessarily in non-volatile storage, so if there are technical difficulties with the network or website, we don’t lose data that was unable to be submitted at the time of recording. 

The firmware should take temperature readings at regular intervals and both display the current temperature on the display and upload the reading to the website.


The website should have a dashboard that is able to display the current reading for each device, as well as a graph of the temperature for the past day. Each device should be able to be viewed individually, showing the full temperature history it has recorded.

Users should be able to register for access to the portal, as well as login. User registration should require email validation to be completed prior to the user being able to login.

An admin user should be able to add new devices to the system as well as edit or remove existing ones. The recorded data types should be configurable through the web interface rather than hard coded, so additional device types can be added in the future. 

Component Selection

Given the relatively simple nature of the device we’re building, there are not very many component decisions we need to make. That being said, this project does need some components so let’s take a look at what we might need.


As I’ve already made the decision to utilise the .NET nanoFramework for this project, our choices for a microcontroller are limited to those that the community has built support for. For this project, the ESP32 looks to be exactly what we need, it’s very low cost, has integrated WiFi, is supported by .NET nanoFramework, and offers options for a pre-certified module version of the microcontroller. There isn’t much point looking into other options when the ESP32 has so many great features for this project.

We’ll start off with the ESP-WROOM32 based DEVKITC for the ESP32, which should give us everything we need to prototype the device.


There are many different types of displays we could utilize for this project, from the humble 16×2 character display up to a nice touch screen TFT display. However, this is a simple project with simple goals, so I want to use the 1.8inch 128×160 pixel color TFT display based on the ST7735S controller that I’m using in the thermal camera project that you can find on my blog. I haven’t tried using this display with the .NET nanoFramework before, but it is a SPI display so it should be a good choice. 

Temperature Sensor

The key component in this device is of course the temperature sensor. There are many routes we could take for a temperature sensor—on the budget side of things there are thermistors, moving up to analogue temperature sensors with built in compensation. From there, we can start looking at low cost digital temperature sensors which use I2C or SPI to communicate with the microcontroller, and on into the premium grade digital temperature sensors.

I feel given this project is beginner oriented a basic digital I2C sensor is going to do the job nicely. These generally give far more precise readings than an analogue sensor, as the conversion is completed by the sensor itself, along with the algorithm to convert the analog voltage into a temperature measurement.

A sensor such as the very simple TMP102 will do the job very nicely. If you want to take the project to the next level, you can optionally implement a temperature and humidity sensor such as the Si7021 which is very popular. 

Power Supply

Our device is going to need some form of power, as this project is beginner oriented, we’re not going to delve into making this a battery powered IoT device. The component options we’ve selected would definitely support being battery powered, however we just want to keep this project simple. As such, I think a simple micro USB connector will be adequate for powering the wireless sensor. If we need to make it portable, an external battery pack/power bank would suit our requirements.

For prototyping purposes, this means we don’t need to order any extra components, as the microcontroller dev kit is also USB powered, and we can utilise the supply from it to power our sensors.

When we layout the PCB, we will need a 3.3v voltage regulator to drop the 5v from the USB line to a usable level, however there are a myriad of low cost linear voltage regulators that will do the trick.

A linear regulator has no engineering risk as far as I am concerned, as such, it’s not something I would include in my prototyping BOM. If we were designing and building this device for a client or mass production, it would be helpful to include the LDO at this point so that it could be considered from a budgetary point of view.

The High Level BOM

Our major components for the device are now selected, and we’re looking at utilizing:

  • ESP32 wireless microcontroller
  • ST7735S based display
  • TMP102 temperature sensor

I’ll order the dev kit and breakout board for the sensor, and while we wait for those to arrive, we will get started on a web interface to receive the data.

Next Time

In the next article in this series, we’re not jumping into the electronics, as we need to build the web platform first. To test the electronic design, we’ll need to have a web API to call in order to prove the connectivity portion of the design. We will start with the ASP.NET based platform, as the code created for that can be reused in the .NET nanoFramework code we’ll be running on the ESP32 microcontroller. The PHP based IoT portal will follow at a later date, as the project progresses.

After the ASP.NET IoT portal has been created, we will get back to electronics. We will prototype the temperature sensor design on a breadboard to prove out the schematic and firmware prior to designing a PCB in Altium Upverter.

If you’re not interested in building the IoT portal yourself, the complete code will be available on GitHub for you to use if you want to follow along with the hardware development of this project, or use it for any other project you have in mind.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

When and How To Use a Decoupling Capacitor in Your PCB

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - When and How To Use a Decoupling Capacitor in Your PCB

Do you know how to use a decoupling capacitor? 

You’ve probably read about decoupling capacitors in datasheets or technical notes, but the function of these capacitors is rarely articulated properly. Aside from looking at advice in datasheets, it helps to know what a decoupling capacitor does and how to use a decoupling capacitor correctly.

Demystifying Decoupling Capacitors

Any ripple or noise that is output from your power supply can cause major performance degradation in ICs. A digital IC can suffer a reduction in noise margin, and an IC used to drive a downstream component can see increased clock jitter if there is noise on the power bus. Analog ICs typically specify a power supply rejection ratio (PSRR), which defines degradation in the output due to noise from your power supply. These problems are worse when the supply noise is concentrated at a higher frequency (i.e., a higher PWM switching frequency). This is one reason why voltage regulators are used in a circuit board.

Even if you use a regulator, noise on the supply can still affect digital and analog circuits. One of the most common ways to reduce noise is to place a capacitor very close to the IC. This capacitor is called a decoupling capacitor and it acts like a charge reservoir. The capacitor is meant to cancel out any current fluctuations on your power rail so that they do not affect the voltage seen by an IC. Once completely charged, the decoupling capacitor opposes any change in the voltage across it by providing discharging if the voltage drops, or vice-versa. Understanding the decoupling capacitor, its placement, and how to choose them is the key to getting the best performance from your design.

When working on a schematic design with ideal power supplies, it is easy for new designers to forget that the real-world power supplies are often far from ideal. When there are a large number of gates in an IC switch, a large surge in current can cause the IC’s supply voltage to change significantly. Consider a digital design with thousands of transistors switching simultaneously. This leads to a current spike that can cause the output voltage from the regulator to drop. This also causes a large current to flow through to ground that causes an inductive voltage drop, known as ground bounce.

How To Use a Decoupling Capacitor

The following figure shows one of the most effective decoupling techniques, which uses two parallel capacitors.

decouplingPlacing two decoupling capacitors in parallel

A large electrolytic capacitor (typically 10 to 100 μF) must be placed no more than 2 inches from the chip. The purpose of this capacitor is to act as a large charge reservoir, which keeps the voltage across the IC’s power and ground terminals constant.

The smaller capacitor (typically 0.01 to 0. 1μF ceramic capacitor with low effective series inductance) should be placed as physically close to the power pins of the chip as possible. The purpose of this capacitor (sometimes called a bypass capacitor) is to short high-frequency noise on the power rail to ground. This small capacitor has a smaller time constant, thus it reacts faster than the large capacitor (in other words, it has higher bandwidth), but it has lower charge capacity.

The large capacitor, despite being slow, has a large charge capacity. Taken together, these capacitors help provide a smooth supply for the chip. They also provide a low impedance path to ground for any higher-frequency noise, hence any noise generated within one IC does not propagate to other ICs.

Here are some tips for connecting decoupling capacitors to an IC:

  • When multiple capacitors are placed on the same supply pin, make sure that the smallest capacitor is closest to the IC, and place the rest of the capacitors away in ascending order. When placed close to the IC, the smallest capacitor will provide the fastest short for high-frequency noise.
  • Devices with multiple power pins usually need to have at least one capacitor per power pin. Be sure to check the component datasheet for the manufacturer’s recommendations!
  • For this scheme to work well it is important to connect all decoupling capacitors to a low-impedance ground plane with a large area through a via or short trace.
  • Always make sure you are placing the smallest decoupling capacitor on the power pin itself and not on a net tied to logic “HIGH”.

Types of Decoupling Capacitors

Note that a decoupling capacitor is not a specific type of capacitor. In theory, any capacitor could be used for decoupling. Electrolytic capacitors are excellent candidates for use as large decoupling capacitors as they are cheap, available in a wide range, have high capacitance-to-volume ratio, and have a broad range of operating voltages. Electrolytic capacitors are polarized and reversing the polarity can damage the component. Care must be taken to ensure you have placed the capacitor with the correct polarity. They also have high leakage current, but for most basic applications they work very well.

shutterstock_731355235Different types of capacitors

Aluminum electrolytic capacitors are designed to handle high frequency switching pulses. Solid tantalum electrolytic capacitors generally have smaller operating voltage and smaller available capacitance values, but they have a higher capacitance-to-volume ratio. They are more expensive and should be used carefully.

Ceramic or multilayer ceramic (MLCC) are among the best candidates for high frequency filtering because of their small size and low losses. The performance of these capacitors varies widely with the type of dielectric being used. The X7R type is preferred as the capacitance does not vary with the input voltage. Multi-layer ceramic capacitors are also popular because of their low inductance design.

In general film capacitors are not used for decoupling applications because they are generally wound, which increases the capacitor’s parasitic inductance. Here is a good article for calculating the value of a decoupling capacitor.

Placing a Decoupling Capacitor on the Board

Ideally, you would place a decoupling capacitor on the opposite side of the board as the IC as it can be placed right below the SMD pads (see the right side of the figure below). This provides a shorter path to ground and frees up space for fanning out traces. In most situations, you will place all the capacitors on the same side of the board with the decoupling capacitor as closely as possible to the power/ground pins. An alternative option with the IC, capacitor, and other components on the same side of the board is shown in the left side of the figure below.

cap_placementStrategically placing a decoupling capacitor on the board can free up board space

When placing these capacitors on the layout it is important to make sure that the capacitor you are placing is a verified component with a correct footprint. Upverter® provides a vast library of verified components, including ceramic capacitors with low ESL, aluminum electrolytic capacitors, and tantalum capacitors that you can use for decoupling. Upverter’s browser-based platform also provides schematic design and layout capabilities for designing boards from start to finish.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

PCB Grounding Techniques: To Do and What Not To Do

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - PCB Grounding Techniques_ To Do and What Not To Do

One of the most common questions we see from many designers is how to properly ground their PCBs. This includes ground plane design, placement of grounded vias, and other important techniques to reduce noise in a PCB. The fact is, grounding is the foundation on which we build our systems, and a thorough understanding of PCB grounding techniques is essential.


Ground loop formed by two trace connections

We normally talk about signal integrity in terms of high speed and high frequency signals, but any PCB needs to have a stable ground to ensure signals are clean and noise-free. Proper grounding comprises routing return signals to a ground point, and properly designing ground planes. Let’s take a look at some PCB grounding techniques and ways to ensure proper grounding throughout a board.

What is a Ground?

This might sound like a simple question, but the distinction between different types of grounds is fundamental. An electrical ground is a conducting body that acts as a common return path for the current from various devices. Usually it is referred as the zero-potential node and all the other voltages in the system are referred with respect to this node. Following are the different types of nodes that are referred to as grounds-

  • Floating grounds: A floating ground is simply a large reference conductor in an isolated system. A floating ground is not physically connected to earth.
  • Earth ground:This is literally a physical connection to the earth. This acts as a safe return point to deplete surplus current.
  • Chassis ground: The electronics in a PCB cannot connect directly to an earth ground (this normally happens through the power supply), but the metal chassis can act as a good ground. This is usually used to ground the body of an enclosure as a safety measure.
  • AC ground: These are low impedance ground paths that block DC return current. This is normally created by connecting to a ground plane through a capacitor.
  • Virtual ground: These grounds can be found in negative feedback circuits at the inverting end of operational amplifiers. Connecting 0 V to the non-inverting input will pull the inverting input 0 V, and this value is usually held constant through feedback. This is an unstable node and cannot be used as a return path for other circuits.

PCB Grounding Techniques and Your Layout

Ground Plane

Any large piece of copper on the PCB connected to the ground is called ground plane. In a two-layer board, this is usually spread across the bottom layer, while traces and components are arranged on the top layer. In a multilayer PCB, one of the interior copper planes is normally dedicated to a ground plane.

If the ground plane doesn’t entirely cover a complete layer, then you should always make sure you do not create any closed rings in your ground plane as this makes your ground plane susceptible to electromagnetic interference (EMI). Note that EMI can be induced in the ground plane from other components on the board or from external sources. The conductive rings act as an inductor, and any external magnetic field can induce a voltage/current in the ground loop.

Similarly, placing unnecessary traces between the ground pins of two components creates a ground loop. This is an especially potent source of noise between digital circuits that mimics the behavior of ground bounce. It also creates an effective inductor that increases susceptibility to EMI. Each component must be connected to a solid ground plane individually to avoid ground loops.

ground_loopGround loop formed by two traces connecting to a ground plane

When using a chassis ground, you can avoid ground loops by placing a void in the ground section that connects to the chassis, as shown below. The use of a capacitor provides an AC ground point. This is an ideal situation for electrical equipment that will run off of wall power and needs to have a return directly back to earth.

Chassis-ground-connectionElimination of ground loop antenna

Ground Vias

In a multilayer board, ground planes on different layers are connected through vias. These connections help you access the ground plane anywhere throughout the PCB. Vias also help reduce the ground loops in the system. They provide a shorter return path for the current through a low impedance ground point.

Sometimes, pieces of copper may resonate at 1/4 the frequency of the current flowing through it. This is one reason that you should try to route the shortest possible connections between components using controlled impedance techniques. Placing grounded stitching vias at appropriate distances can help eliminate these oscillations as they provide a capacitive path back to ground. As a rule of thumb, these ground vias must be placed at 1/8th of a wavelength or less from the relevant conductor.

Ground Planes in Your Stackup

In a multilayer PCB, the arrangement of power, signal, and ground layers in the stack has major effects on signal integrity and will influence your routing strategy. It is important to keep a ground plane near signal planes in order to minimize the current’s return path. In a 4-layer board, the power and ground planes are normally kept on the inner layers, while signal traces and components are placed on the outer two layers.

Analog and Digital Component Arrangement

Components should be arranged on the signal layer close to the ground so that the return paths are short and traces coupled to ground. If the PCB contains analog and digital components, then the ground connections must be placed very carefully. The analog and digital sections of the board should be physically separated, but they still need to connect to the power supply return path.

mixed_signalMixed-signal ground connections

Some might suggest completely splitting the digital and analog ground and then connecting them using a ferrite bead, but this can create more EMI and noise problems than it solves, especially if you are working at very high frequencies. A good way to connect these sections is to place the power supply return path between the two planes so that return currents from either section will not enter the other plane. It is important to note that no traces should not be routed over a gap between two ground planes as this creates long current return path that is highly susceptible to EMI. The space between the ground planes can be used to place mixed-signal components like ADCs.

Designing a high-performance PCB requires attention to detail, and grounding is just one of many design aspects that require your attention. One rule of thumb to follow here is “grounding before routing,” meaning you should consider the location of ground connections in your PCB before routing signal traces. It is important that you do not leave any floating planes on your PCB and connect them to ground instead. Layout editors have design rule check (DRC) features that will inform you of any floating net.

No matter which PCB grounding techniques you need to implement in your PCB, Upverter® provides a high quality PCB editor with excellent routing tools to design boards from start to finish in a browser-based interface. You’ll also have access to real-time DRC tools to help avoid any rework in your layout. Upverter’s browser-based platform gives you access to your work from anywhere.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

Which Types of PCBs are Best for Different Designs?

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Which Types of PCBs are Best for Different Designs

As part of our best practices and information for new designers and hardware startups, we want to give new designers the information they need to choose the right PCB for their next project. Any PCB is intended to provide a physical support for an electronic system and its components. The complexity of different types of PCBs varies widely, depending on the function of different circuits. If you’re designing a PCB for the first time, we’ll show you the different types of PCBs that will hopefully provide inspiration for your next project.

Rigid PCBs

As the name states, these boards have a rigid substrate which prevents bending or warping. These are usually made of solid, rigid material like fiberglass weaves, but more demanding industrial or automotive applications may require ceramic or metal core substrates. With the number of layers ranging from one to more than ten, they are the most common type of PCBs on the market.

Single-sided PCB

Just like its name suggests, a single-sided PCB consists of a single layer of conductors and components. There is usually a solder mask over the copper layer, and silk-screen can be used to mark the positions of different components. Despite the low-cost, the utility of these boards is limited because of the design complexity limitation. Due to only one surface available for connections the area of the board can grow very fast to accommodate all the components and connections.

Layers in a single-sided PCBSingle-sided PCB

Double-sided PCB

Double-sided PCBs are similar to single-sided except the conducting layer is on both sides of the substrate. Now the connections can run on both sides of the PCB, hence it occupies a smaller area or can have more complex circuits. The connection between top and bottom layer is made using plated holes called “vias”. These boards are used for moderately complex circuits. It is generally not a good idea to try and design high-speed or high-frequency PCBs on double-sided boards as grounding and power distribution can be a real challenge, especially as the number of components increases.

double_sidedLayers in a double-sided PCB

Multilayer PCB

Multilayer PCBs have several layers of copper separated by insulating laminate materials. Connections between layers are also made using vias. Typical multilayer boards start with four layers, and the layer count grows for more complex (and costly) boards. The extra planes can be used for routing, power distribution, and grounding planes, which helps to reduce crosstalk and electromagnetic interference (EMI). A four-layer board is usually a good place to start for a moderately complex board that will run at high speed (faster than TTL logic) and/or high frequency (usually hundreds of MHz or higher).

Layer stack in a multi-layer PCBLayer stack in a multi-layer PCB

Flexible PCBs

Rigid-Flex PCB

Rigid-Flex PCBs are a middle ground between one of the previous types of PCBs and a flex PCB (see below). These boards are best used in applications where a board requires precise molding to its enclosure or when different sections of a board need to move with the enclosure. These boards are also useful in small spaces where a standard connector will not fit in the enclosure. These boards can be found in pacemakers, digital cameras, and cell phones.

Layer stack in a multi-layer PCBRigid-Flex PCB from RayPCB

Flex PCB

These boards are not really boards; they are fully flexible PCBs that can be molded into nearly any shape without affecting circuits present on different layers. The substrate is usually made from polyimide with copper or other malleable metal used for conductors. These boards are more expensive than the other types of PCBs due to the additional fabrication complexity.

Rigid-Flex PCBFlexible PCB

Which Type of PCB is Best for Your Design?

The answer to this question really depends on the application in which your board will be used, your production budget, and the level of complexity of your circuits. One rule of thumb that will aid in your decision is this: if your new design works properly on a breadboard, you can expect your circuits to work as designed no matter how you layout your PCB.

For designs that run at high speeds and or frequencies, single-layer or double-sided boards are typically unsuitable, and you’ll want to start with a four-layer PCB. Here are some other points to consider for different types of PCBs in certain applications:

  • PCB for medical devices have severe area constraints therefore require dense routing with compact footprint. Multilayer PCBs are therefore quite common in medical and other advanced applications.
  • Industrial applications usually have high current requirements than in other applications. PCBs used in these cases have a thicker copper layers compared to normal PCBs.
  • Automotive and aerospace PCBs must withstand strong mechanical vibrations, hence flexible PCBs can be used for such cases.

No matter which types of PCBs you want to design, Upverter® provides the schematic design and PCB layout tools you need to design boards from start to finish in a browser-based interface. If you are preparing a complex PCB with multiple layers, Upverter gives an easy EDA teamwork platform for a live multi-user collaboration and real-time design rule check (DRC) features.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

Top PCB Design Guidelines for New Designers

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Top PCB Design Guidelines for New Designers

PCBs are sometimes seen as an over-glorified way to wire up electronic components. However, once you understand the complexity of advanced PCBs and the importance of enforcing some order to your components on a single board, you’ll realize the importance of creating a PCB for your new device. If you’re a new designer, it can be difficult to find a good set of guidelines for getting started designing your first PCB.

We want to give new designers some important PCB design guidelines to follow when building a new board. The guidelines below are not strict PCB design rules, but are suggestions that might help save you a lot of rework. You might not need to follow all of these guidelines for every design. At the end of the day, you are the master of your design, and with some practice, you will know what works best for your project.

Top PCB Design Guidelines for Beginners

Once you have validated your design idea with a breadboard, individual components, and what seems like a couple hundred wires, it is time to move start designing your own PCB. The most important considerations for a successful PCB design are that it should be manufacturable, functional, and reliable. The design tool you use can help ensure manufacturability by allowing you to checkyour layout against standard design rules and constraints.

Schematic Design

The first step is to start designing a schematic for your board in the tool of your choice. This process is rather easy as you are placing connections between the components. The design tool you use should include a schematic capture tool as this allows you to generate an initial layout from your schematic. It’s good to have a detailed schematic that gives you access to different component specifications, such as pin-out, names, and ratings. Once you finish your schematic, your schematic capture tool will create the initial layout, and you can then start making real connections on a PCB.

Placing Components

A PCB is like a piece of real estate; some areas carry higher value than others. Placement of each component depends on its individual importance. Precision; sensitive analog parts must not go to the edges and they should be kept away from any areas on the board with fast digital components (i.e., TTL components). Similar parts should also have similar orientation on the board as this aids routing between components. All surface-mounted components must be on the same side of the board, and all through-hole components must be on the top layer of the board.

Power, Signal, and Ground Routing

Once you have tentatively placed your components (this might change as layout is a dynamic process!) it’s time to start connecting them together with copper traces. If you have a multilayer PCB, make sure to keep power and ground planes symmetric and overlapping. This helps prevent any bending or stress development on the board. If you have only two layers, then you will need to have thick power and ground lines able to withstand the heat generated by the total current flowing through your board.

The two methods for connecting functional blocks of electronic components are star configuration and daisy chaining. It is highly recommended that you not daisy chain the power lines to different functional blocks in a PCB. Instead, use a star configuration to connect power rails to different portions of the board. This is a basic requirement for ensuring ICs receive consistent voltage during operation.

PCB design guidelines for power routingDaisy chaining should be avoided

Signals on the top and bottom layers of a two-layer PCB should run orthogonal to each other to avoid inductive coupling between them. For a multi-layer board, the same strategy should be followed for signal lines on adjacent layers. You should only break this guideline if there is a copper plane between the signal layers.

routingOrthogonal routing of traces on a two-layer PCB

Bypass Capacitors

Each PCB that contains digital components will have some areas with high switching activity and greater current consumption. Voltage and current spikes will occur when these digital components switch. These voltage and current spikes occur due to a large rush of current into a circuit during digital switching, sometimes called ground bounce. These voltage/current spikes can couple between different traces, known as crosstalk.

This problem can be solved using capacitors between the power and ground pins on a digital component. If you look at manufacturer’s guidelines for different components, they will often recommend a certain capacitor size which you can use to compensate for ground bounce.


It is also important to prevent coupling between digital and analog traces during switching using isolation. With mixed signal PCBs, it is important to keep analog and digital grounds separate in order to keep digital signals from interfering with sensitive analog components. This does not literally mean using two different ground planes; this can mean placing digital and analog components over different areas of the same ground plane. The DC bias signals should also be shielded from any coupling with digital signals. A good way to do this is to run two ground lines run on both sides of a trace carrying an analog signal or DC voltage. This simple design choice is known as shielding.

shieldingSignal or bias shielding

Thermal Issues

While designing a PCB, you should also consider heat management. First, you should look through your component datasheets for thermal resistance and power consumption values to determine which components will likely be producing the most heat and reach the highest temperature. In addition to heatsinks or cooling fans on hot components, there are some simply layout choices that help keep temperature low.

If more than one component will produce a large amount of heat, then it is best not to place these components in one location, otherwise hot spots might form. Circuits that are very sensitive to temperature changes should be placed farther away from these blocks. There should be at least 2-4 vias for each layer transition near high current paths. This helps conduct heat away from the surface layer and helps reduce inductive and resistive losses.

Signal integrity

This is a huge area of PCB design, however there are some simple ways to ensure signals in your board do not get distorted during operation. Signals should be routed directly between components over the shortest possible path to reduce loop inductance. You should also avoid running parallel tracks over long distances as this increases capacitive coupling. If tracks need to cross, this must be done at a right angle to reduce coupling capacitance. These guidelines will help suppress crosstalk and reduce susceptibility to electromagnetic interference (EMI).


To ensure your PCB meets functionality and reliability criteria, it is important to check the design for any rule violations. Electrical rule checks (ERCs), and design rule checks (DRCs), are two very important tools that should be performed once you have laid out your board. The right design software can run these checks dynamically (i.e., as you place components and route traces). This helps you identify design errors that may not be obvious from a visual inspection. Once you have verified your schematic is correct and your layout complies with all design rules, you are ready to think about producing your board.

Choosing the Right PCB Design Tools

There are many PCB design tools in the market. A good tool is the one that provides easy integration between schematic and layout, a vast library with reliable components, and provides easy platform for collaboration and sharing. You should also be able to generate documentation for a manufacturer. This includes Gerber files, assembly drawings, and a bill of materials for your components.

Upverter® provides schematic design and PCB layout capabilities for designing boards from start to finish. Its browser-based platform gives you access to your work from anywhere and makes it easy to collaborate. Upverter’s cloud-based platform verifies part designs, removing the risk of symbol and footprint errors so that you can manufacture your designs with confidence.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

Range/Obstacle Detection with Ultrasonic Sensor Projects

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Range_Obstacle Detection with Ultrasonic Sensor Projects

The choice of sensor is a challenging and crucial part of any project. The performance, cost, and size of your project depends greatly on the sensor you choose. Range, obstacle, and level detection are very common tasks in many applications, and many sensors are available on the market for range detection or obstacle detection. Compared to other sensors, ultrasonic sensors are cheap, easy to use, and robust. This makes them a favorite entry-level sensor for hobbyists and professionals.

HC-SR04 module for ultrasonic sensor projects

The HC-SR04 module for ultrasonic sensor projects

How Ultrasonic Sensors Work

Compared to an optical sensor, and ultrasonic sensor’s output and sensitivity is independent of ambient light, color, texture, and transparency of the target. Because these sensors operate beyond the range of human hearing and vocal spectrum, the sensitivity is also independent of most ambient noise sources.

All ultrasonic sensors determine the distance to an object by measuring the time required for ultrasonic waves to reflect from a target. This is similar to SONAR, but off-the-shelf ultrasonic sensors can be used in any environment. These sensors produce high frequency sound waves which reflect off an object or obstacle in their path. The ultrasound receiver captures the reflected waves, and you can then calculate the total distance to the obstacle based on the speed of sound in that medium. This requires specifying the speed of sound in your calculation (approximately 331 m/s at atmospheric pressure and ambient temperature).

Ultrasonic sensor measurement principle

First, the total travel time (T) between transmission and reception of the signal is measured with the system, and the distance (D) between the sensor and the target can be estimated using the following relation:


where Cs is the speed of ultrasonic waves in the medium. The factor of ½ is due to the fact that the wave travels double the distance between the transmitter and receiver.

Getting Started with Ultrasonic Sensor Projects

If you’re thinking of including range detection capabilities to your board, the prepackaged module shown above will interface directly with an Arduino board or other microcontroller board. As most transducers emits at 40 kHz and above, you only need to supply a low frequency analog signal or a stream of digital pulses to trigger the transducer. Given the low frequencies used in these systems, you can easily implement an ultrasonic sensor in your board without worrying about EMI or other signal integrity problems.

Advantages of Ultrasonic Sensors

Linearity is one of the important performance parameters for any sensor, and ultrasonic sensors have linear output response over a broad range of input power. Ultrasonic sensors can be reliably used for range detection indoors or outdoors. The performance doesn’t fluctuate with variations in the ambient lighting. They are also robust and can be moved quite often, hence they are suitable for mobile applications, such as collision avoidance for robots moving at low speed.

Mist, smoke, or dust also do not affect the performance of these sensors. The color and texture of the target doesn’t matter either as long as the target has a hard surface, which means ultrasonic sensors can even be used for mash structures. Soft structures will have reduce the intensity of the reflected wave, making them more difficult to detect at longer range. The response of the sensor has a small dependence on temperature, but these sensors are still more stable against temperature changes than infrared sensors.

Challenges in Using Ultrasound Sensors

The primary challenge involving the use of ultrasonic sensors for range detection occurs when the target surface is of low density. In such cases, sound waves get absorbed by the surface and reflections are too small to be reliably sensed by the receiver. Another concern with ultrasonic sensors is their minimum sensing distance.

After transmitting the signal, the sensor needs some time to recover before it is ready to receive the reflected wave. If the range is too small, the receiver will receive a reflected wave before the trigger signal ends, resulting in an erroneous measurement. The datasheets for your particular sensor will usually specify the minimum range that can be reliably detected.

Range Detection in Your Ultrasonic Sensor Projects

One common sensor used for range detection with a development board is the HC-SR04 (see above), which provides high accuracy and stable readings in a compact package. It has four pins: supply, ground, trigger, and echo. Transmission is initiated by sending a 10 μs pulse to the trigger pin. This causes the ultrasound sensor to send out 8 pulses of 40 kHz each and raise the echo pin to high value. The echo pin stays high until the reflected signal is received, at which point it turns low. The length of time the echo pin remains high is proportional to the distance travelled (see the above equation).

timing_sensorTiming diagram for the HC-SR04 ultrasonic sensor

The typical usable range for this particular sensor is 2 to 400 cm, although working at more than 10 cm ranges gives better results with 3 mm accuracy. These modules typically require a 5 V power supply, and the operating current can reach 15 mA (3 mA standby current). The sensor assembly can be easily plugged into a breadboard for testing purposes.

For a simple range testing, you can plug the HC-SR04 sensor into an Arduino board, as shown in this tutorial. Ultrasonic sensors are excellent devices to use for liquid level measurements with a microcontroller board. This can be used for something as simple as creating an automated plant watering system, flashing an alarm LED, or for triggering a relay to turn a valve in a large water tank.

Another interesting project is to use an ultrasonic sensor in robotics for obstacle avoidance. This is simple enough to implement on an Arduino board, although you might consider going with Raspberry Pi or an equivalent if you need much more processing power. For the clean freaks, you can find a touchless automatic motion-sense trash can in this tutorial. The applications for the ultrasonic sensors are limitless and quite affordable.

More Advanced Ultrasonic Sensor Projects

You can also use an ultrasonic sensor for more complicated speed measurements. If the relative speed between the sensor and the object is rather large, a Doppler shift will occur once the wave is reflected from the target, and the shifted frequency can be detected with an ultrasonic sensor. The magnitude of the Doppler shift can be used to calculate speed, but not heading; at least two sensors with defined angle between them must be used to measure heading as well as speed.

If you want to implement this feature, you need a separate analog ultrasonic transducer. You then need to mix the detected signal with the reference signal, producing an AM analog signal. The frequency of the AM signal can then be extracted using an envelope circuit and then measured. You can then determine the relative speed between the sensor and the target using the standard Doppler shift equation. Note that the actual speed and any heading measurement will depend on the resolution of the ADCs in your system.

Small module for ultrasonic sensor projectsSmall module for ultrasonic sensor projects

Once you have decided on the type of system that you want to build and collected all the required components it’s time to test the system. The easiest way to implement a test system would be using Arduino, Raspberry Pi, or similar platform.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

A Guide to Arduino Shield Design

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - A Guide to Arduino Shield Design

You probably have a great idea that you tested using your Arduino, breadboard, and what looks like a bird’s nest of connectors, and it works great. Congratulations! If only a couple of ICs and additional circuitry could be added to your Arduino to make it look like a finished product. We have two choices here. First, you could make a custom board that might be more organized, but will require some time to design. You’ll also have to replicate Arduino’s functionality in your custom board, or you’ll have to clone an Arduino board.

Arduino shield design by stacking multiple boards

Arduino shield design with expandable memory and an LCD display 

The other option is to take all the additional components and make an Arduino shield. If you are lucky, you might be able to find an existing shield that will hold your additional components. If you’re more adventurous, you can create your own shield board that plugs directly into an Arduino module. Here’s what you need to consider in Arduino shield design and how to create a custom shield for your new product.

What is Arduino Shield Design?

Arduino shields are small circuit boards that sit on top of existing Arduino boards and contain additional components to boost the capabilities of the system. There are a number of capabilities you can add to an existing Arduino, such as Wi-Fi, Bluetooth, motor control, a camera, or other features. Arduino shields provide some important advantages:

  • Stackable. The layout of a shield board will be compatible with a basic Arduino board, which means they can be plugged in straight away. Signals are sent from the GPIO pins or other MCU interface, and multiple shields can be stacked together to form a complex system.
  • Inexpensive. Shields are relatively inexpensive to buy or design. For a small manufacturing batch, you’ll find that they are cheaper compared to custom PCB.
  • Extensible. If you use a through-hole shield, you can add more components to the board or rework it as needed. Note that this is not generally the case with a custom shield, which is normally fabricated for a specific set of functions.

Arduino shields have the same form factor as that of a standard Arduino board. Power and ground pins are located on one eight pin header, the analog pins are placed on a six-pin header, and the digital pins are placed on the opposite side with an eight-pin and ten-pin header. An example footprint for an Arduino Uno shield is shown below.

Arduino shield design for an Arduino Uno
Typical shield form factor for an Arduino Uno

Some Arduino shields are designed to use every pin, while some shields leave open pins. Shields generally communicate using SPI, I2C, or serial communication, and some use interrupts or analog inputs. If you’re buying a premade shield, you’ll find that not all of these modules are extensible. Some shields include an array of plated holes for soldering through-hole components, while others are designed for a very particular application and are not expandable. Take a look at Adafruit for some good examples.

Types of Arduino shields

There are hundreds of Arduino shields on the market these days, and going through each will turn this article into a lecture. Here are a couple interesting shields that might inspire your next design.

Connecting to the world

Arduino WiFi or Ethernet shield. As the name says, this allows your Arduino to connect to the internet through Ethernet or via WiFi. Arduino has retired the WiFi shield, but similar shields can be found from other suppliers or from tutorial websites. You can also build your own shield that provides both capabilities.

GPS shield. You can easily add GPS capabilities to an Arduino with a simple chip antenna. You could even clone an open-source GPS module and easily adapt it as an Arduino shield.

Music and Sound

MP3 player shield. You can turn your Arduino into an MP3 player by adding some speakers, a microSD card, and a headphone jack.

Music instrument shield, You can turn your Arduino into different digital instruments. You can generate an analog signal with a DAC on the shield board, and you can use other components to modulate this signal. You can also use UART to control other devices via MIDI.

Display and Touchscreen

LCD display or touchscreen shield. You can easily add a 16×2 character LCD display with controllable backlighting to your project. You can use two I2C pins on the Arduino board, which leaves plenty of pins left over for interfacing with other devices. If you want to include a touchscreen, an Arduino board can provide sufficient power for place a small touch screen with decent resolution (240×320 is typical). You can also add a microSD card for storing images and videos.


Relay shield. A relay shield allows you to bring automation to our home appliances. This type of board can contain multiple relay switches that can be individually configured as normally open (NO) or normally closed (NC).

Motor shield. The Adafruit link shown above includes a great example for a motor shield. If you ever want to build a robot (who doesn’t!), you can use the digital output to power a DC motor. You can also use the PWM output from the MCU to control a stepper motor.

Arduino shield design for a stepper motor control board.

Things to Consider in Arduino Shield Design

While there are plenty of shields you can create for a new product, there are some important points to consider when designing your own Arduino shield.

  • Pin-out. The pin-out on your shield should match the pin-out on the MCU board. Pay attention to the datasheet for your Arduino model when designing your shield.
  • Current rating. When powered with an external supply, the total current is limited from 500 mA to 1 A, depending on the exact model. Components connected on the shield board and wired to the power/ground pins will increase the total current used by the device.
  • Supply voltage. Some Arduino boards use 3.3 V while others use 5 V. The components you add to your shield should be compatible with the supply voltage used with the MCU board.
  • Through-hole vs. SMD components. Some shields come with an array of holes for through-hole components alongside some other functionality that is built into the board. You can certainly use these premade boards for your shield, but you will be limited to through-hole components. If you prefer SMD components, then you will be better off designing your own shield.

Design for Wireless Communication

If you add a Bluetooth, WiFi, GPS, or other wireless module to a custom shield as a chip antenna, you’ll likely need to include a ground plane in your shield board. Be sure to pay attention to your antenna manufacturer’s guidelines when working with your chip antenna. Unless your shield is much larger than your MCU board, your RF traces are unlikely to act like transmission lines, but you should still pay attention to impedance matching rules for your antenna.

Alternatively, you can use copper pour on your shield board to create your own antenna, such as an inverted-F antenna. This will provide a compact footprint compared to a larger rubber ducky antenna.

Arduino Shield Design in Upverter

Upverter® provides users with a simple yet powerful browser-based platform for designing boards from start to finish. You can easily pick from a vast range of existing open-source hardware projects to get started, or you can import Arduino shield templates from Eagle libraries available from Sparkfun or Adafruit. 

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.