Using PIR Sensors for Motion Detection

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Using PIR Motion Sensors in Your Next Project

Motion detection is used in a variety of applications and (lucky for us!) is relatively easy to implement in your next project using PIR motion sensors. Whether you are building on an Arduino board or you are designing your own PCB, PIR sensors are easy to incorporate. Some applications include power switches for electromechanical systems (think automatic sliding doors) or proximity sensors for alarm and lighting systems.

How Does a PIR Sensor Work?

shutterstock_1476976379

When a warm body moves in front of a PIR sensor, the sensor generates a differential voltage. Each PIR sensor unit consists of two individual infrared-sensitive halves. As the radiating body (a person in our case) moves in front of the sensor, one sensor will be crossed before the other. For this short duration, the first sensor will capture a larger amount of radiation than its counterpart, creating a positive differential voltage. Similarly, while leaving a PIR motion sensor’s field of view, one sensor will continue to receive more radiation, resulting in a negative differential voltage.

Difference in motion detection for single and dual modes of the PIR sensor
Principle behind the motion detection using PIR sensor. [Source:
Adafruit]

PIR motion sensors usually come in a three-pin package with VDD, GROUND, and SIGNAL pins. The supply voltage typically ranges from 3 to 5 V, although it can reach as high as 12 V in some sensors. Although the sensor itself is essentially a pair of photodiodes and a transistor, the dome-shaped packaging for an integrated sensor can be rather large. The dome on a PIR sensor acts as a Fresnel or plano-convex lens, which focuses infrared light on a back-to-back photodiode. This photodiode arrangement can then connect to the gate on a transistor, providing a digital output.

The digital output is active high and can drive a load up to 10 mA (always check the datasheet!). In most cases this pin can be connected to a microcontroller input, but you should cross-check your datasheets as this pin may be open-collector, which requires placing a pull-up resistor on this pin. There is a PIR sensor available at SparkFun that has a fourth pin which supplies the analog output from the PIR sensor. This provides additional flexibility for using and analyzing the PIR output.

Difference in motion detection for single and dual modes of the PIR sensor
PIR motion sensor for Arduino projects or similar projects

Designing a Custom PIR Motion Sensor

If you’re a serious electro-optical designer and you’re looking to build a custom PIR motion sensor, you’ll have plenty of fun building your own PCB for a custom PIR sensor. The layout for a PIR motion sensor on a custom board is not difficult as it only requires two detectors, a transistor, and some resistors. The signal conditioning, delay, and sensitivity are controlled with an integrated PIR controller. The real fun is in designing the optics, but you can reuse a dome from a different PIR motion sensor module.

PIR sensor modules usually have two trimming potentiometers on the backside that can be used to customize the behavior of the motion sensor. The sensitivity trimpot can be used to change the detection range of the PIR sensor. The second is an OSC trimpot which controls the length of time the digital output stays high (i.e., the delay time). The pulse width of the output can be anywhere between hundreds of milliseconds to a few seconds.

Using the Digital Output

Most PIR sensors are 3-pin designs that produce a digital output. This sensor produces a pulse when motion is detected, which is then captured with a PIR controller and processed. There are two possible trigger modes for the digital output. The first is single pulse mode detection, where you can detect an object that enters or leaves the PIR’s field of view, and the second is a dual pulse mode detection where you can distinguish objects entering and leaving the field of view. The modes can be easily selected in your PIR motion sensor controller. Figure below shows both the modes of a PIR sensor for the NCS36000DG PIR controller from ON Semiconductor.

Difference in motion detection for single and dual modes with PIR motion sensorsSingle and dual pulse modes for PIR motion sensors. [Source: ON Semiconductor]

Using the Analog Output

The analog output from a PIR can provide a huge amount of information. Theoretically, multiple sensors could be used to determine the dimensions, speed, distance, and direction of the object. The figure shown below is from Arduino serial plotter, where the correlation between the hand motion and the output can be easily seen.

Motion detection using the analog output from PIR motion sensors
Analog output from a PIR motion sensor showing various hand movements. [Source:
SparkFun]

The downside of using the analog output is the additional signal processing requirements. It is easy to view the signal on a serial plotter and process it in MATLAB or another program, but doing so on hardware adds significant complexity to your project.

Implementing a Prepackaged PIR Motion Sensor Module

One simply method to configure a prepackaged PIR sensor is to connect it to a battery and drive a simple LED with the sensor’s output pin, as shown here. This arrangement works well for testing the delay and sensitivity of your system. However, you normally want to use the digital or analog output to perform another set of tasks. In this case it makes more sense to use a PIR motion sensor with a microcontroller. Arduino or another development board, and some open-source code for your project, provide a good starting point for testing your prototype. It can also be used to drive and store the output signal from the PIR motion sensor.

Simple motion detector using Arduino and PIR sensorSet-up for a simple motion detector using Arduino UNO and a prepackaged PIR motion sensor. [Source]

You can find details of the implementation and the Arduino code here. One important thing to note at this point is that the PIR sensor takes up larger current when detecting the motion. The sensor from SparkFun (here) runs at approximately 3 mA while detecting motion and 80 uA during standby. If you have a more complex system with multiple sensors, this would be the time to start thinking about managing battery life.

A simple trick to reduce the current in a prepackaged PIR module is to remove the LED from the backside. The job of this LED is to simply tell you that sensor is ready, and this LED will blink every time motion is detected. You can pull out the LED once you have thoroughly tested and calibrated your PIR board.

Using Upverter to Design a PIR Motion Detection System

Whether you are designing a custom PIR motion sensor module, or you are purchasing one on the market, you’ll want to make a system that contains all the required sensors, microcontroller, power source, and some output module. The output module will be based on what you wish to do with motion detection. Some common examples can be triggering a relay to run a motor, sending data to the cloud (e.g., when counting the number of people crossing the sensor), or simply switch other devices on and off.

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 to Use Coplanar Waveguide Routing for HF Boards

Get Started with Altium Upverter, Sign Up Now.

When to use coplanar waveguide routing and layout

Radar systems, wireless systems, high frequency analog systems…all of these need to include measures to ensure signal integrity. With many high frequency systems, this can be difficult with microstrip or embedded microstrip routing on the surface layer. However, you can save yourself a lot of signal integrity headaches using coplanar waveguide routing.

Most design tools can be used to define coplanar waveguide routing with a ground pour feature. This allows you to easily define a coplanar waveguide on your board, or a grounded coplanar waveguide by defining a ground plane in an interior layer. The question remains: when should you use coplanar waveguide routing? Here’s everything you need to know.

What is Coplanar Waveguide Routing?

A coplanar waveguide is a copper arrangement where a signal trace is routed in parallel to two ground planes. The presence of the ground plane on each side of a signal trace provides natural shielding for the signal against interference from other traces on a board. A coplanar waveguide also comes in the grounded variety. The geometry is essentially the same, except there is another ground plane beneath the surface layer. This is shown in the image below.

Different signal and ground plane arrangements in coplanar waveguide routingCoplanar waveguide geometries

Advantages of Coplanar Waveguide Routing

Compared to microstrip and stripline traces, placing a signal trace on the top layer with the ground pour on each side of the trace causes a signal to see lower radiation losses. This also reduces resistive heating losses as the signal hugs the side of the trace, rather than hugging the bottom of the trace near the rough interface with the substrate. This means your signal will be stronger at the receiver end of the trace, and the shape of your signals will not be distorted as they travel along the trace.

Most feedlines, for example Bluetooth and WiFi transceivers and antennas, require series and/or shunt elements for impedance matching. Because coplanar waveguides have a ground plane directly next to the trace, these parallel components can be mounted directly between the trace and the ground plane without placing routing through a via.

Disadvantages of Coplanar Waveguide Routing

Because coplanar waveguides require the use of ground planes surrounding the trace, you have less real estate available on the surface layer. The cost of all that copper on the surface layer also drives up the board cost. You also need a relatively thick substrate, so you should keep the layer count low if you are using a standard board thickness.

There are closed-form equations for the impedance of a coplanar waveguide, but these formulas require evaluating elliptical integrals. If you’re more focused on the design than the math, you probably don’t have time to go and calculate the solutions to these equations. One thing you will notice is that the impedance is more sensitive to the spacing between the signal trace and the ground plane than it is to the cross-sectional geometry of the signal trace.

This means you’ll need to use a calculator that calculates the impedance numerically. Thankfully, you can find a number of calculators online for specific coplanar waveguide geometries, including a grounded coplanar waveguide. There is a great calculator on Sourcefourge that allows you to consider everything from your substrate dielectric properties and the frequency you will work with in your board.

There is another issue with coplanar waveguides that relates to the plating used on copper to prevent trace corrosion. Electroless nickel immersion gold (ENIG) plating has higher insertion loss on a coplanar waveguide than on a microstrip. The alternative coating, hot air solder leveling, has lower insertion loss but will have a rougher surface, leading to greater losses in traces. Unless you are working near 100 GHz, either surface finish will likely be just fine for your application, as long as your trace lengths are not too long.

Large PCB with ENIG surface finish
ENIG surface finish on a PCB

When to Use Coplanar Waveguide Design

Many designers have jumped head-first into Bluetooth-capable devices, but working with coplanar waveguide routing gives you an easy way to get into working with higher frequency devices (i.e., 5 GHz and above) while ensuring signal integrity throughout the board. Some example applications include radar systems, both for automotive and UAV projects, and even 5G-capable devices. The price point for components for these devices has been dropping recently, and now anyone can get into the game with coplanar waveguide routing.

There is no specific frequency limit at which you should switch from microstrip to coplanar waveguide layout and routing. However, industry types are commonly using coplanar waveguide routing in applications that operate at 10s of GHz, and in systems that require ultra-precise signal integrity (think a guidance system for a missile). If you’re doing anything above 5 GHz, then you can consider using coplanar waveguides on your most sensitive analog signals in order to isolate them from nearby digital signals. If you are working on a fully analog board at these same frequencies, then you should probably use coplanar waveguide routing.

High Frequency Design in Upverter

Working with Upverter’s browser-based PCB design platform allows you to easily implement a coplanar waveguide routing strategy thanks to the ground pour feature in the PCB layout tools. If you’re designing a grounded coplanar waveguide system, you’ll also have the via design tools you need to provide the connection between surface and interior ground planes in your board.

Alternatively, if you want to work with an existing Arduino project for a high frequency board, you can find some great open-source 24 GHz radar projects for high frequency radar that will work with an Arduino. This particular project is based on the XMC1302 and XMC4200 ICs from Infineon, and the author included their ARM code for programming the Arduino controller. This type of project is ideal for a UAV that will incorporate chirped radar. 

24 GHz radar board for Arduino with coplanar waveguide layout and routing
An
Arduino 24 GHz radar project

With the browser-based design features in Upverter®, you’ll have access to the PCB design features you need to create high speed or systems or high frequency projects that use coplanar waveguide layout and routing. The schematic design and PCB layout tools are designed for taking your design from start to finish and preparing for manufacturing. These standard design features are accessible from anywhere. These features also provide collaboration and rules verification for your next embedded systems project.

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 Design for a LoRa IoT Sensor Node

Get Started with Altium Upverter, Sign Up Now

Upverter - PCB Design for a LoRa IoT Sensor Node

When it comes to IoT devices, most designers and engineers focus on Bluetooth, cellular, WiFi, or Zigbee for wireless communication. However, LoRa (long range) is a great option for creating a low power wireless device for use in IoT networks. Currently maintained by the LoRa alliance, the specifications are easier to work with compared to other RF devices while providing up to 6 miles of communication range on a mesh or multilevel star network.

Small LoRa IoT sensor node as part of a LoRaWAN network

A LoRa IoT sensor node on a LoRaWAN network

This sub-GHz protocol is actually quite simple to implement in a PCB compared to other protocols that operate at higher frequencies. The required components are readily available and there are plenty of open source projects you can use to get started. Many organizations and individual programmers have developed open-source code to support your LoRa IoT sensor node and the LoRaWAN backhaul architecture, which will help get your new device online quickly.

Why Use a LoRa IoT Sensor Node?

Many companies already use LoRaWAN to offer long range connectivity for IoT devices. The Things Network is an active member of the LoRa Alliance and aims to support developers in building IoT products for use in LoRaWAN solutions. In addition to The Things Network and big companies like Microsoft and Google, individual developers have made their designs and their code publicly available to support LoRa developers. LoRa operates on unlicensed bands (433 MHz, 868 MHz in Europe, and 915 MHz in the US), so you can build, run, and/or join a LoRa network without a special license.

LoRa is great for low power, long range communication, but your device will not be able to connect to the internet directly. LoRa IoT sensor nodes can be built with small footprint and connectivity to other analog or digital sensors, as long as your LoRa IoT sensor node contains the right components. You don’t need full-scale SBC-grade processing power to create a LoRa IoT sensor node, so you can create some innovative solutions at low cost.

shutterstock_1380224039
Prototype Arduino Nano LoRa IoT sensor node for a LoRa network

LoRa Network Gateways

Although LoRa devices were intended to be used for star or multilevel star (i.e., star-of-stars) networks, you can easily construct a mesh LoRa network for IoT devices with Google’s OpenThread software. If you want a device on a LoRaWAN network to connect to the internet on the traditional star network, then you will need to build a LoRa gateway device to support your LoRa IoT sensor node. The gateway connects to the internet wirelessly or over copper and facilitates communication with other remote LoRa devices via the LoRaWAN protocol.

Note that, if you are building a single LoRa IoT sensor node or similar device to connect to an existing network, then you won’t need to build your own gateway. As an example, you could use a gateway on The Things Network, which is a popular network for LoRa devices. You can also select a different LoRa network operator from the list of LoRa Network Alliance members and build your own node, or even your own LoRa network gateway.

Component Selection for a LoRa Network

The exact components you need will depend on whether you are building a gateway or a node:

  1. Building a LoRa Network Gateway

If you’re looking to build a gateway, then your best bet is to use an inexpensive single board computer (Raspberry Pi is one popular choice). Note that you’ll need to use some extra components to ensure your gateway can connect to the LoRa network, such as a USB/Ethernet converter (for a Raspberry Pi board). You’ll also need to include an antenna that operates in your intended frequency band. A rubber ducky antenna is usually a good choice for a LoRa network gateway.

Prototype LoRa IoT sensor node for a LoRa network
LoRa network gateway on a Raspberry Pi board

If you’re a serious designer and you want to create a smaller form factor gateway, you can consider importing a Raspberry Pi, BeagleBone, or other module into your PCB design software and place the components you need to operate the gateway directly on your board.

2. Building a LoRa IoT Sensor Node

Although you can certainly take an 8-bit microcontroller board (see the Arduino example above) and add an external antenna, you can make your form factor much more compact by placing an inverted F antenna on your board. The ATMega328p 8-bit MCU is a great choice for running your sensor node as it only costs a couple dollars. One great open source example LoRa IoT sensor node project is shown below.

Custom LoRa IoT sensor node board

Custom board for a LoRa IoT sensor node. Image credit: cernohorsky on GitHub

The exact MCU you should use and the communication options you need, the number of sensors you’ll interface with, costs, and desired form factor. Note that you’ll also need to place a sub-GHz RF transceiver unit on your board. As Semtech maintains the physical layer protocol for LoRa devices, they offer a wide range of LoRa products you can use to create a custom node. The RF transceiver unit shown above is from Hope Microelectronics.

The online PCB design environment from Upverter® provides a complete PCB design solution for any application. You’ll have the PCB layout tools and extensive component library you need to take your design from start to finish and prepare for manufacturing. Upverter continuously updates the platform with new features and capabilities that are demanded by the community, and you can make your LoRa IoT sensor node accessible from anywhere with Upverter’s GitHub-style sharing 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.

Getting Started with Embedded Systems Projects

Get Started with Altium Upverter, Sign Up Now

Upverter Expert Getting Started with Embedded Systems Projects.jpgCoding is just one important part of embedded systems design

Have you ever started an embedded systems project? If the answer to this question is no, just know that an embedded systems project is easy to start but difficult to master. You’ll need to become something of a coder as well as a hardware developer, and you may need to learn a new programming language in the process. If you already have programming experience, then you’ve got a head start over other engineers. Otherwise, there are plenty of open source hardware and software packages you can use to get started with building and programming your next embedded systems projects.

What Are Embedded Systems?

There is no strict definition of an embedded system. In the simplest sense, an embedded system is any electronic system that includes some components that provide computing capabilities. These computing capabilities could be reprogrammable, depending on the processing and memory components used in a particular system. These systems often appear as part of a larger electromechanical system or other complicated product. They also contain some kind of mechanism to receive user input or interface with another electronic, whether it is a set of buttons, a touch screen interface, or a wireless connection.

If you’re questioning whether you should build your next project as an embedded system, think about this: does the device need to process some kind of input from the external environment or another device, and does the device then need to make some kind of logical decision based upon that input? If the answer is yes, then you’ve got an embedded system on your hands.

You can find an extensive range of embedded systems, and you can even get some good ideas for your next project, by looking throughout your home. From appliances like air conditioners and microwaves to smartphones and smartwatches, you are probably using many embedded systems at the moment. With IoT devices set to become more popular in consumer electronics, industry, and other areas, many more products will function as embedded systems.

Processing Capabilities

Your processor, whether it’s an MCU or other component, will form the cornerstone of your embedded systems project. It also determines how many external components your device can incorporate, as well as the communication protocol your system will use to send or acquire data from other devices. Different processors provide different processing speed, although they carry different costs and will consume different amounts of board space.

Microcontrollers are an excellent choice for providing processing power in applications that don’t require extremely high speed and variable bit depth. Affordable microcontroller ICs provide bit depths ranging from 8 to 32 bits, and are available in speeds reaching from 10’s to 100’s of MHz. The footprints vary as well; many microcontroller come in DIP packages, while more powerful microcontrollers will be available in SMD/SMT packages.

shutterstock_707972428This microcontroller board can provide the backbone for a simple embedded system

Different microcontrollers support different programming languages, although microcontrollers typically use some higher-level programming language like Java or C/C++ in an integrated development environment (IDE). As an example, Arduino’s IDE is its own variant of C/C++. Before selecting a microcontroller, check the manufacturer’s IDE to ensure that you are familiar with the language. Microcontrollers are typically programmed in higher-level languages such as C++ or Java.

Embedded systems can be designed with an FPGA, and their reprogrammable nature makes them more flexible than most microcontrollers. The costs for a single FPGA can reach hundreds of dollars, and FPGAs tend to consume more power than typical microcontrollers. This makes them unsuitable in devices where power consumption is an issue.

If your device requires access to steady power, must run at high speed, requires hundreds of I/Os for data processing, and/or needs to be periodically reprogrammed, then a microcontroller is the better choice for your application. There are a number of specialized languages for programming FPGAs, with Verilog being the oldest. C/C++/System C is one example of a simpler tool for programming an FPGA, although you’ll need to use the manufacturer’s core generator tools to translate your code to the hardware level.

These limitations in programming languages cause FPGAs to be less accessible to designers who do not have experience with these embedded languages. For these reasons, many designers will find microcontrollers much easier to use for embedded systems projects compared to FPGAs and other CPLDs.

Building Your PCB and Your Device

Once you do select an appropriate processor for your next device, you’ll need to design a PCB that integrates your processor and your other devices onto a single package. If you are not the type to design a PCB on your own, there are plenty of microcontroller projects that can help you get started with your design. You can take these projects and expand on them, or you can use a popular microcontroller platform like Arduino to build your next device. Other, more powerful options are a Raspberry Pi single-board computer, or the even-more-powerful BeagleBone Black. The prices for these products ranges from a few dollars upwards, and your processing power and built-in memory will scale with costs.

Working with a microcontroller board like Arduino limits you to the capabilities that already exist on the board; you won’t have any ability to expand the on-board capabilities unless you open the schematic and layout for your microcontroller board in your PCB design software and modify it manually. If your board will interface with a number of other devices that will run at high speed and/or high frequency, it can be difficult to ensure signal integrity unless you have some PCB design experience. In this case, it is better to include these little extras directly on the board.

If you want your device to connect to other devices wirelessly or through the internet, then you might be better off going with a single board computer, like a Raspberry Pi or BeagleBone. If you are in the business of incorporating these capabilities on your own, you’ll need access to an extensive component database with electrical models, schematic symbols, and PCB footprints.

Once you decide on the basic requirements your device needs, and you have narrowed down the processing unit you will use, there are plenty of directions you can go to expand the capabilities of your embedded system. All this takes the right PCB design software with an extensive set of design tools.

Embedded Systems Projects in Upverter

If you’re looking for a platform to build an embedded system, Upverter provides a massive component library with plenty of FPGA and microcontroller options to choose from. All the important board design, rules verification, and circuit simulator features are available in a browser-based interface. You’ll also be able to collaborate with other designers on your next embedded systems project.

FPGA2The Embedded Micro – Mojo project, built for use in an embedded system with an FPGA

With the browser-based design features in Upverter®, you’ll have access to the PCB design features you need to create embedded systems projects and design PCBs to support these devices. The schematic design and PCB layout tools are designed for taking your design from start to finish and preparing for manufacturing. These standard design features are accessible from anywhere. These features also provide collaboration and rules verification for your next embedded systems project.

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.

Create Your BeagleBone Black Projects in Upverter

Get Started with Altium Upverter, Sign Up Now

Upverter Expert Create Your BeagleBone Black Projects in Upverter.jpgYou can quickly create new BeagleBone Black projects in Upverter’s online design platform

Development boards and open source hardware platforms are an excellent way to start designing a new prototype. These boards are a great option for anyone that wants to create a prototype of their new idea and eventually build it into a working product. They are also a great resource for entrepreneurs that want to build a proof of concept for their next project.

Some available options for development boards include Arduino, BeagleBone, Raspberry Pi, and the Edison platform from Intel. Although Arduino and Raspberry Pi happen to be massively popular among makers and entrepreneurs, BeagleBone Black definitely deserves some mention as it offers similar or better capabilities at a competitive price point. We’ll take a look at some of the capabilities of BeagleBone Black and the steps you’ll need to take to create a clone of a BeagleBone Black board.

BeagleBone Black vs. Arduino vs. Raspberry Pi

A quick comparison of these popular platforms is quite useful; those who may be more familiar with Arduino or Raspberry Pi may not be familiar with BeagleBone, or vice versa. These three popular open source hardware platforms have some similarities, although there are a few areas where BeagleBone stands above these other products.

Arduino Boards

Arduino is a microcontroller board and comes in several variants. Each variant is specialized for a different MCU, although you could certainly download the Arduino schematics and make your own redesigned version of an Arduino board that runs on a different microcontroller. Arduino requires a specialized IDE for programming that is its own variant of C/C++.

In terms of its hardware capabilities, it requires modest power (e.g., 6-20 V for the popular Arduino Uno, although it is recommend you stay within 7-12 V) and can run on a 9 V battery. It supports dozens digital I/O pins, including some pins with PWM output, depending on the exact variant you want to use. Note that Arduino boards can accept analog inputs and convert these signals to digital data with an internal ADC, but not all boards provide analog outputs. These boards come in 8, 16, or 32-bit variants.

Raspberry Pi

This development board is really a single-board computer that runs on Linux, giving software junkies many more options for programming the module. This module includes a much higher end microprocessor (700 MHz) with memory provided by an external SD card. This board is essentially a mini-computer that interface with a variety of hardware interfaces (HDMI for display, I2C/SPI/UART digital communication, and USB) that can connect to a network via Ethernet or wireless.

These features make the Raspberry Pi an extremely useful module for edge computing or as an IoT device that provides some serious data processing. In contrast, Arduino boards are better for less memory or processing-intense applications. The ability to support more mainstream languages allows anyone to start running open source code on one of these boards; you can easily tunnel into your Raspberry Pi over your LAN via SSH and start configuring your board.

shutterstock_195527210
Raspberry Pi single board computer

BeagleBone Black

BeagleBone Black is another single-board computer that supports Linux, but it has more powerful hardware capabilities than Raspberry Pi. It consumes similar power, has a similar footprint, and can communicate over standard interfaces (I2C, SPI, CAN bus, etc.). However, it includes a faster processor (1 GHz vs. 700 MHz) and GPU, supports 4 GB of onboard memory, and 10/100 Ethernet connections. If you decide to spend a few extra dollars per board, you can upgrade to the BeagleBone Blue, which includes wireless access.

BeagleBone Black and BeagleBone Blue both contain the same processing architecture, the primary difference is the wireless communication capabilities in BeagleBone Blue. This makes both boards capable for processing-intensive applications as part of sensor networks, for edge computing, a variety of automation tasks, and other applications.

Forking BeagleBone Black

Upverter is one of those unique platforms that stresses sharing and community. Many users are happy to share their designs with others as open hardware projects, allowing you to fork an existing project and build your own variant in a GitHub-style manner.

Unfortunately, the schematic for the BeagleBone Black on the project’s GitHub page is only compatible with Allegro, so it may not be usable with every PCB design program. Thankfully, the BeagleBone Black module just happens to be available in the Upverter project library as an open source project, and you can quickly create a variant of this board.

From a PCB design and signal integrity aspect, it may be better to integrate all your desired capabilities onto a single board if possible. Otherwise, you can place your external circuits on their own board and use best PCB design practices to ensure signal integrity in multiboard systems. You can probably get away with hanging components and floating circuits when working with a slower Arduino board, but these issues become more important when working with BeagleBone Black projects as these systems run at much higher speeds.

Working with a board like BeagleBone Black makes this quite easy; you can rest assured that signals on the development board itself will not be degraded, and your remaining concern should be providing a low inductance connection to your external circuits. Ben Jordan provides some great advice on this point; be sure to watch this video if you are not familiar with the finer points of signal integrity and multiboard design.

beaglebone_layoutYour newly-cloned BeagleBone Black layout

This gives you a quick way to expand its capabilities or even build your own board directly on top of the existing BeagleBone Black project. And it allows you to take your proof of concept and integrate it into a single board, rather than working with hanging components that need to be fastened to the enclosure. You can increase the board size to fit the extra components you want to add to this module and incorporate these components in the schematic and layout directly from Upverter’s component library. You can also request new parts be added to Upverter’s library with EE Concierge directly from the online editor.

With the browser-based design features in Upverter®, anyone has the ability to create BeagleBone Black projects and other custom projects from a unique browser-based design interface. The schematic design and PCB layout tools can help you take your design from start to finish and prepare for manufacturing. These standard design and production planning features are accessible from anywhere by multiple collaborators.

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.

Project Design Walkthrough: Airsoft Tracer Unit, Part 1

Get Started with Altium Upverter, Sign Up Now

Project Design Walkthrough

In my Guide to Starting a New Project, I mentioned working on some projects for a friend, and for this continuation article, I think it’s worth mentioning that we’re both Airsoft players. It’s a great way to spend a day out in the forest with some friends and get some exercise, and what better project is there for us to work on together than a tracer unit for night games. A tracer unit is a mock suppressor for a replica gun that shines UV light on a glow-in-the-dark BB as it exits the barrel. This is the perfect time to make one because there’s a large Airsoft event spanning multiple days coming up, which he is going to. I’d love to join him, but instead, I’ll be going to AltiumLive.

During the day, it’s very easy to see a white BB fly through the air toward your target, while at night, it’s more of a challenge to see what you’re hitting. Tracer units are surprisingly expensive and typically have under a single watt of LED power. For a similar price, we can build our own tracer unit and purchase about 140 watts of high power SMT LEDs. I’m a fan of the phrase “if it’s worth doing, it’s worth overdoing”, and 140 watts seems like plenty of overdoing, so that’s the plan. The challenge will be packaging this many LEDs and powering them!

Unlike many project articles you may encounter, this will be a series to take you through my full project design process as it happens. I’m writing this article as I’m planning and designing, and it will cover the project design process to the point of circuit board layout, and will be submitted before breadboard prototyping or schematic capture and PCB layout begins. This way, you will be able to see the full project design process, including changes that are driven by the schematic or PCB layout, rather than the cooking show’s typical ‘here’s one I prepared earlier’ approach. This is my first Upverter™ project. I’ve been an Altium Designer® user for over a decade, so I’m excited to see what the more modern Upverter has to offer in design experience.

If you’re new to designing your own electronics, this article will guide you through the process of an experienced engineer and maker as they tackle a project. As mentioned in the Guide to Starting a New Project, whether you are building a basic device, such as this tracer unit, or a complex project, the project design process all boils down to the same set of steps.

Specifications

My specifications document is fairly simple: Turn the LEDs on when a BB enters the tracer unit, and turn the LEDs off when the BB exits the unit. 

I was planning to build this purely with logic devices, however, the number of ICs was rapidly growing and the board space/packaging was going to be an issue. Instead, I’m going to use a microcontroller to detect the BB’s passage and control the LEDs. Not to mention, as a fun added bonus of using a microcontroller, I can also use the tracer unit as a chronograph, to measure every BB’s velocity as it passes through.

To detect the BB, I’m going to use an infrared LED and detector, as the BB travels past it will break the beam telling the microcontroller to turn the lights on. The light gate will be at the exit of the tracer unit, and used to turn the lights off. I’ll also want to add some code to the firmware to automatically turn the LEDs off after a period of time if an exit event was not detected. If there is strong infrared light, such as daylight, shining into the tracer unit, it may not detect the exit event, and with such a huge power draw for the LEDs, I want them switched off as quickly as possible to conserve battery life and prevent the whole unit from overheating. There will be very little cooling for these LEDs, so I’m relying on the very short duty cycle to prevent overheating.

Part Selection

Before even looking at a schematic or a PCB layout, I need to figure out which critical components the design will utilize. For this design it will be the battery, LEDs, LED driver, microcontroller and photogate. Since this is a tracer unit, it’s going to have a lot of LEDs, which means beyond the basics of merely detecting the BB travelling through the tracer unit, the power requirements for the LEDs will be driving many decisions.

Battery

For the battery, I am going to select a Turnigy 700mAh 3 cell LiPo battery with a 60C discharge rating, as it’s the most compact battery I can find that meets my discharge requirements. I’ve been using HobbyKing for many years, and their batteries are high quality yet inexpensive, and they have absolutely no circuit protection as you’d find on batteries targeted at consumer devices, which is great for stuff like this! Don’t think of the lack of protection as a bad thing, because in the radio controlled hobby industry, the electronics which the batteries plug into provide the necessary protection, leaving the batteries able to discharge staggering amounts of power. I will need to build a low voltage detection circuit into the design to stop the LEDs from running if the battery starts to be too depleted. 

Now that the battery has been defined, I could use its dimensions to set the minimum length of the tracer unit to about 80mm. The minimum length of the tracer unit will also affect the layout of components and the amount of space available on circuit boards within the unit. Knowing the battery size is critical to being able to design the most compact unit possible, which not only is better for real world usage, but also will determine the PCB manufacturing cost.

LEDs

Because I’m trying to light up a phosphorescent material, I first need to figure out the optimal wavelength of light to use. Phosphorescent materials work by absorbing a lower wavelength of light and re-emitting it as a higher wavelength. I can be fairly sure that typical Airsoft tracer BBs are using SrAl2O4, strontium aluminate, for the phosphorescent material as the cheaper ZnS probably wouldn’t get lit brightly enough to satisfy players. Wikipedia tells us that “excitation wavelengths for strontium aluminate range from 200 to 450 nm”, so the shorter UVB or UVC wavelengths are probably going to be the best options, if suitable LEDs can be found.

For the UV LEDs, I headed to Digi-Key to start filtering down the Infrared, UV, Visible Emitters category. Initially I’m looking for Active, In Stock, Ultraviolet ones that are on Cut Tape to see what options come up. Sorting by price at a quantity of 100 units, I can see there are a lot of low-power options there which just won’t give the energy density this project requires, so I’ll further filter by forward current for anything over 500mA. Now I have lots of 1A Forward DC Current (If(Max)) options, which is fantastic. The cheapest options have a 120°-130° viewing angle, which I suspect is going to be too wide, so I’ll head to Fusion360 to mock up the design to see what might work. I want the LEDs to shine on the BB for as long as possible, so perhaps a wide angle LED will work well, but if I can cram a lot of LEDS in a row, I could possibly get a higher energy density by using a tight beam. 

Mock up design for a 120 to 130 degree viewing angle LED in contact with a 6mm BBWide angle LEDs have to be placed close to the ball to achieve high energy density.

The box at the top is a 3.5mm wide LED, and the circle at the bottom is a 6mm BB. With a 120° viewing angle, I feel there will be good coverage of the LED as it comes past, but the peak energy on the LED perhaps isn’t going to be as high as it could be. To get the phosphorescent material glowing as brightly as possible in the shortest amount of time, I need to give it a lot of energy. My gut feeling is that travelling past more tightly focused LEDs will ‘charge’ the phosphorescent material better than more time in the emissions of a wide angle LED.

50degree LEDNarrow angle LEDs offer high energy density while maintaining distance from the BB.

If you look at the same drawing with a 50 degree viewing angle LED, you will notice that I can bring the viewing angle lines down to be tangent with the BB and still maintain good clearance (4.1mm) from the path the BB will travel. This should reduce turbulence in the tracer unit, allowing for a more accurate shot.

I now have a short list of possible UV LEDs, with the Everlight ELUA3535OG5-P0010U23240500-VD1M being the cheapest. It is a 405nm LED which isn’t perhaps as optimal as a 385nm or shorter wavelength, but the price is 37% lower than the same LED in a mildly shorter wavelength. I feel as though 37% more LEDs of the marginally longer wavelength is going to provide more brightness than we could get with fewer LEDs of the shorter wavelength. However, I do not have actual data to back this up. Inolux have several LED options that are just a little more expensive, but the Everlight datasheet is more comprehensive and has much clearer land pattern and pin details, which are very important to me designing the board. So we’ll go with the cheapest option, as not only are they the cheapest per unit, they are also the cheapest per watt. As this part is only available from Digi-Key, I made a quick check for UV LEDs on Mouser and European suppliers, but didn’t find a cheaper option that would suit my requirements.

LED Driver

The chosen LED’s datasheet has a nice voltage/current graph. Using the 405nm option, it looks as though 3.55v to 3.6v will give about 900mA to1000mA of forward current. This lines up very nicely with our battery, as a LiPo battery offers a nominal voltage of 3.7v per cell. However, a fully charged battery will be at 4.2v, making it clear that we’re going to need a constant current driver of some sort so as not to burn the LEDs out.

vf-vs-maHigher wavelengths allow for larger forward current for a given forward voltage.

There are two possible approaches to take here: either use an op amp on a current sense resistor to enable/disable the gate of a MOSFET to limit the peak current, or go with a full blown LED driver IC that can boost the voltage and allow more LEDs to be run in series. 

Being a lazy engineer, I’m off to Texas Instruments Web Bench tool to design up a constant current LED supply. I just input my requirements, and it came up with a design based on the TI TPS92691 multi-topology LED driver with a rail-to-rail current sense amplifier. It sure sounds fancy! Okay, I’m kidding somewhat, I wanted to use a constant current boost driver because I’m going to be doing another UV LED project for post-curing parts that have been 3D printed from resin. Knowing I’m going to be having similar LEDs and power requirements for that project allows me to design a power supply for this one, and use the same schematic for the other project as well, which makes it both easier to order parts, and reduces the total design time for both projects.

I have chosen to go with 4 ‘rails’ of LEDs inside the tracer unit, and based on a series of decisions which are now mostly irrelevant since deciding to use an LED driver, I decided to use 12 LEDs per rail. I was planning to run the LEDs directly from the battery using a MOSFET and an op amp for current limiting, which led to groups of 3 LEDs. A constant current LED driver, however, will supply a consistent brightness as the battery is discharged and is a more elegant solution. The driver will run two sets of 6 series LEDs in parallel, which requires a 21.6v, 2A supply. This ends up being about 173W for the whole unit, which is definitely overkill and a bit of scope creep, but I’m okay with that.

Web Bench takes care of pretty much everything, however, it does make some odd choices for capacitors and inductors. Given that I need this to be a relatively compact design, I used the integrated bill of materials editor to swap out parts for smaller, more efficient options. I’m not overly concerned with saving every last cent, as I will only be making a couple of these units, so a difference of a dollar or two in the BOM to get a more efficient, more compact design is worth it.

TPS92691-schTI Web Bench allows you to design power supply systems with complete ease.

My main concern with using a driver like this is that I can’t afford to have a soft startup or really any startup delay. As starting up the LED driver takes more time than simply switching the LEDs on and off, I’m going to have to put a N-Channel MOSFET on the LEDs. This is going to make the driver think the LEDs are broken or something’s gone wrong; the datasheet specifically mentions this.

The TPS92691/-Q1 supports continuous LED status check through the current monitor (IMON) output. This allows for LED short circuit or open circuit detection and protection. 

The IMON pin is an analogue output, and the driver mentions cycle by cycle protection and sensing, so I’m hoping if the load goes away, it will give me full current on the next cycle if required. I don’t normally like technical risks such as this in a design, however, I’m curious enough to try it, and the project timeline isn’t critical, so I could afford to spend time experimenting. When I get the circuit boards I’ll find out if I need to do a redesign!

softstart-simSimulated driver startup shows that LEDs reach peak current after a delay.

Microcontroller

Next up, we’re onto the microcontroller. To keep things easy, I’m going to go with an NXP microcontroller with USB bootloading and MBED compatibility. The NXP LPC11U12FHN33/201 fits the bill nicely. It’s cheap, has enough resources for this project, and shows up as a USB mass storage device when bootloading. What more could you ask for? If the board layout gets tight, I will switch to the LPC11U35FHI33/501 at almost twice the price, but in a 5x5mm footprint rather than a 7x7mm one. I could use a microcontroller that fits in a WLCSP package (36 pins in a 2.4×2.5mm area) if I needed to go really tiny, but those are starting to reach beyond the limits of my ability to hand populate a board reliably.

Photo Switch

There are multiple ways to implement a photo switch/photogate sensor, however, due to the short duration of the dark period as the BB travels across the sensor, I need an implementation that is capable of low latency response. Because of this requirement, I’ve decided to use an infrared photodiode connected to a transimpedance amplifier, which in turn will drive an S-R latch that is connected to a microcontroller pin. I may not need the S-R latch, but I haven’t decided how I want to implement the code at this point (either as a loop or using interrupts and with or without MBED). I really need to ensure the BB’s transit across the sensor is not missed, so by using a latch I can ensure the event is caught, and held, until the microcontroller has dealt with it.

In the UK, an automatic airsoft gun is limited to 1 joule, which, with a common 0.2 gram BB gives around 340 feet per second (104 m/s). A single shot airsoft gun, such as a sniper rifle, is limited to 2.3 joules which would give a 0.2g BB a 500 feet per second (152 m/s) velocity. However, snipers typically use much heavier BBs to reduce deflection by wind and increase range, so the projectile’s velocity could be around 340-400 feet per second. At 340 feet per second, the BB will block a 3mm sensor area for about 29 microseconds, a relatively long time in the world of microcontrollers, but still possible to miss if for example the code is saving chrono data to an EEPROM.

When selecting the photodiode, it’s important to look at the spectral response graphs. Many of the available options list an infrared wavelength, but will also detect some UV and a considerable amount of visible light upon closer inspection. As the tracer unit will contain 170 watts of UV LEDs, and just a basic IR LED, light leakage from the UV LEDs could cause a missed detection on the exit sensor as could bright sunlight. The tracer unit will have 3D printed light baffles/shields around the IR gates. However, with orders of magnitude more light coming from the UV LEDs, the chance of some light getting past the baffles is quite high.

Optimizing the part selection for the infrared spectrum only, and the highest possible current when exposed to light, I chose the Everlight PD15-22B/TR8 Silicon PIN photodiode. This photodiode has a peak sensitivity wavelength of 940nm, which is important to know prior to selecting an IR LED, so it can be chosen to match this wavelength.

Heading back to the emitters category on Digi-Key, I’m now looking for an Active, In Stock, 940-950nm surface mount IR LED with a 10-20 degree viewing angle. I’m also trying to avoid gull wing and similar packages in general on this project, as they don’t handle shock and vibration as well as something directly mounted to a circuit board. When setting up the BOM for the LED driver in Web Bench, I switched from aluminium SMT capacitors to multilayer ceramic ones for the same reason. Whilst airsoft guns do not have anywhere near the same recoil as a real gun, they do have some vibration and shock as they are used. Sorting by radiant intensity, my top pick is an OSRAM SFH 4641-Z LED that should work quite nicely. It’s perhaps a little too power hungry, and 950nm rather than 940nm, but it nevertheless seems to be the best tradeoff given the options available.

Analog Devices have a nice tool to calculate the values for a transimpedance amplifier for a photodiode. It even has the properties for the photodiode I have selected in it’s database, which is nice. Using this tool, I was able to design a two stage amplifier, which has significantly lower noise than a single stage amplifier, using SOT-23-5 sized op amps to save space. The tool very much preferred auto selecting dual and quad op amps, but those were just too big. My end design with the tool uses an Analog Devices AD8615U1 for the first stage, and an AD8061U2 second stage. The resistor values will still need some tuning once I see what the actual current the photodiode generates within the device is, however, the tool does provide a very good starting point.

diodeampTwo stage amplifier designed with the help of the photodiode tool from Analog Devices.

When searching for a surface mount S-R latch, there aren’t a lot of options available. In the smallest pin pitch/package, it comes down to the Texas Instruments CD4043BPWR or the same device in a NAND configuration. That’s all Digi-Key has for me, so that’s what I will go with. Luckily, it has 4 independent latches built in, so I only need one of these real-estate hungry devices.

The High Level BOM

Now that the high level components for the design have been selected, I have the following parts:

  • 48x Everlight ELUA3535OG5-P0010U23240500-VD1M UV LEDs.
  • 4x Texas Instruments TPS92691 LED drivers.
  • 1x NXP LPC11U12FHN33/201 microcontroller.
  • 2x Everlight PD15-22B/TR8 photodiode.
  • 2x OSRAM SFH 4641-Z IR LEDs.
  • 1x Texas Instruments CD4043BPWR quad S-R latch.
  • 2x Analog Devices AD8615U1.
  • 2x Analog Devices AD8061U2.

Next Time

The process of selecting parts to meet requirements is critical to a project’s success. Even on a very simple project such as this, there are many engineering decisions to be made before even starting on a schematic. If this was a project I was taking to a client or management, I could provide them with a very broad idea of costs at this point, knowing that I’d have some miscellaneous IC’s such as low current linear voltage regulators, perhaps a clock crystal for the microcontroller, connectors for the battery and USB, as well as all the passives, and ESD and EMI filtering components. From past experience, I have a ballpark figure for how much those extras are going to cost me, and specifically for this design at the low quantity I will be producing, it’s probably going to be $5-$7 and a set of PCBs from asia will be about $30-$40 delivered. The main cost in this project is the stupid, over-the-top number of high wattage UV LEDs, but thats half the fun of maker/hobby projects!

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.

The Design Guide for Hardware Startups: Race to the Finish (Part 5)

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - The Design Guide for Hardware Startups_ Race to the Finish (Part 5)

Design-build-test cycles are at the core of any hardware or software development workflow. If you’re part of a hardware startup, then it’s time to embrace this process as reality. Testing and redesigning your prototype are only part of a product’s life-cycle, but these two pieces are vital to ensuring your new product works as desired. Now that your prototypes have arrived and have been tested, you’ll get to experience the joys of design-build-test iterations in their full glory.

shutterstock_403548145

You’re racing to the finish line…

Building and Testing (Again?)

If you’ve received your prototype in the mail and thoroughly tested it, then you might have compiled a laundry list of redesigns. This doesn’t mean that your journey is at an end; starting a new design iteration is all part of the development process for any hardware product. These redesigns could include changes to electrical functionality, your mechanical enclosure, or new design features that only help enhance your product.

Some redesigns might be relatively simple and may not require a new prototyping run. However, there are some design changes, such as swapping components and adding new features, that will likely require a new prototyping run. Just like you did when you started your product development journey, make sure to document all changes you’ve made to your product. This is not the time to skip any details. Once you receive a new set of prototypes, you may need to carefully identify whether any changes made to your design exacerbated existing issues, and if so, carefully revert your board to its previous version.

shutterstock_1236385933

Once you’ve finished your redesign and are ready for new prototypes, you’ll need to go back into your design software and prepare an updated set of deliverables for your manufacturer. This includes creating new Gerbers, assembly drawings, bills of materials, panels for your board, and any other documentation your manufacturer requires. If you plan to use the same manufacturer, make sure to consult with them to see if there is any other information they require when preparing for a new prototyping run.

These design-build-test cycles are part of the reality of hardware design, but getting everything right at this phase is critical to ensuring your product will function properly once it hits the market. Documentation is critical throughout this process as it helps you revert back to a previous version of your design.

You’re Almost There!

If you’ve made it this far, then you’ve accomplished a real feat. Taking an idea off of paper and preparing it for mass manufacturing is no easy task. It requires the consideration of a huge number of business and design complexities, and you’ll encounter plenty of roadblocks along the way. Working with the right design software, development process, and manufacturing planning tools can help you overcome the myriad challenges you’ll face on the way to making your dream a reality.

Speaking of business complexities, there is your market and your message to consider. Throughout the course of your design and testing processes described in this series, you’ll need to think about how to market your product and even raise money through crowdfunding platforms. This will help you build momentum for your product and might give you a head start on sales once your product is ready for deployment. There are other outlets you can use to raise money for your new venture that don’t rely on loans or gifts from friends and family. There are investor groups and accelerators for hardware startups that can help you with funding and launching your new product.

shutterstock_188940020Crowdfunding might be the right way to fund your initial prototyping and manufacturing runs

In addition to raising money to help fund your new venture, you’ll want to think about a creative marketing strategy to build awareness around your new product. Social media campaigns and catchy videos on YouTube can go a long way towards raising awareness for any new product. Taking your new product to a trade show can be a good way to show off your product to potential buyers. At the end of the day, nothing beats going out to potential buyers and giving them an in-person demonstration.

As orders come in, you’ll need to carefully plan manufacturing runs to fill your orders. It helps to have a small amount of product in inventory to fill orders, but you’ll need to carefully plan production runs and track your volume as your business grows. As you progress, you’ll have a chance to develop a better relationship with your manufacturer, and placing orders will become fairly routine.

Upverter: The Ideal Toolset for Hardware Startups

There are plenty of obstacles to bringing a new product to market, but development, testing, and planning for production are much easier to address with the right design tools. The browser-based design software in Upverter® is uniquely created for taking a new design from start to finish. Whether you’re part of a hardware startup or a large electronics company, the fully online design interface and optional desktop application include all the standard features designers expect for product development and collaboration.

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.