New Release For EAGLE CAD with PCB Alignment Tools

Since Autodesk acquired Eagle CAD, big changes have been made to Eagle CAD. Regardless of the new licensing system using subscription model, which was a subject to criticism by a lot of users, the new management of Eagle from Autodesk has successfully added a lot of demanding features that old team failed to bring out.

Eagle 8 came with a lot of new features like BGA auto-router and “Past Block Design” tool to add a complete block of connected components both in schematic and board.

The new release 8.1.1 brought PCB alignment tool to align a group of objects in different positions; top, bottom, left, right, center, and distribute horizontally / distribute vertically.

Image Source: Autodesk Eagle’s Forum

Another improvement in eagle 8.1.1 that deserves mention is that a new category has been added to DRC (Design Rule Check) called Airewire. It’s an important improvement because airwires is one of the most common things designer should be aware of. In older Eagle releases, you should work with your eyes wide open and never forget to hit ratsnest at the end of your work and read the magic sentence in the bottom corner “Ratsnest: Nothing to do !”.

Image Source: Autodesk Eagle’s Forum

Source: Autodesk Eagle’s Forum

Exploring Eagle CAD ULPs #6 – Group-aps_v4.ULP Autoplace by Group

Welcome to the 6th post of the “Exploring Eagle CAD ULPs” series. Each post will be discussing one useful ULP in Eagle CAD.

“ULP” User Language Program is a plain text file which is written in a C­-like syntax and can be used to access the EAGLE data structures and to create a wide variety of output files. You can think about it as a plug-in for Eagle.

You can reach the posts published in this series using the following link.

In the previous post we explored Place50 ULP which places all parts of the board to the position in the schematic. Place50 moves all parts of the board, but sometimes we need to do this auto-placement for just a certain group of parts. Beside that, we can’t change the position scaling factor in Place50. Group-aps_v4 ULP overcomes these two points of limitation in Place50 ULP by doing the auto-placement by group, and having user defined position scaling and offset.

To use Group-aps_v4 ULP first download it from Autodesk website. Before running it in the schematic editor, you need to define a group of parts first.

Group-aps_v4 has a simple dialog to enter scale and offset values.

Scale is used to scale the value of original position (X and Y) of the parts in the defined group in the schematic. While X,Y offset is used to offset the final position of the part in the board after scaling it. For example, if scale was 0.5 and the position (in mil) for the part is (500,100) then is will be considered as (250,50).

Group-aps_v4 ULP originally places the group in the calculated position of the the first part. So as an output, all parts will have the same X and Y and that’s not effective. So i made a simple edit to the ULP to solve this issue. You can download the updated version N_group-aps_v4.ulp.

Know your Tool – Optimize C Code for microcontrollers

One of the talks in the “Embedded Linux Conference 2016” was about best practices to optimize C for microcontrollers. This talk deserves to be mentioned to Electronics-lab readers.

The presenter Khem Raj worked on Comcast’s (broadcasting and cable television company) reference design kit for STB, Gateway and IoT platforms.

We will cover some important points that have been suggested by the presenter:

Optimization Levels

Optimization in compilers in general (GCC is the one in Khem’s case) has different levels (5 Levels: Os, O1, O2, O3 and Og). Os is for size optimization while O1, O2 and O3 are for performance.

Optimization Levels - From Khem’s slides
Optimization Levels – From Khem’s slides

Linker

Linker which is an important tool in microcontrollers’ software toolchain, is mentioned in Khem’s talk.

Linker script is written in the linker command language and controls the memory layout of the output file (what goes where). Moreover, Linker can output a map file which is very useful when you want to track down references to symbols in the MCU memory.

Linker Script File - From Khem’s slides
Linker Script File – From Khem’s slides

Objdump

GNU GCC has a collection of binary tools; they are called (binutils); and objdump is one of them. It interleaves your assembly code with source code so you can do disassembling using it.

Variables

Talking about best practices with variables. If the concept of local, global, volatile, const and static are blurred for you, then watching this presentation will clarify them besides other important terms.

Khem also mentioned special integer types in C99; they are “fast” and “least” types. So you can allocate your variable like that:

  • Fixed width unsigned 8 bit integer uint8_t
  • Minimum width unsigned 8 bit integer uint_least8_t
  • Fastest minimum width unsigned 8 bit integer uint_fast8_t

To ensure portability of your code, Khem advised to use portable datatypes using uint{8,16,32,64}_t type declaration. This avoids effects of changing size of int type across different processors (compilers).

Using global and local variables is another concern. Khem advised to use local variable as much as possible. Global variable needs to be loaded from memory and stored back every time it is used. So if you use a global variable in a loop you will have multiple loading and storing operations.

Khem’s presentation has other tips about: array subscript Vs. pointer access, loop increments Vs. loop decrements and other stuff. Make sure to watch the presentation, all of it!
Slides

ESPurna-H, A Compact Open Source Hardware Wireless Power Wall Switch

Controlling your AC loads using wireless power switch is not a new concept. Several commercial products from several vendors can be found on the market such as Xiaomi’s Mi Smart Socket Plug, SAMSUNG’s SmartThings Power Outlet and Sonoff Pow WiFi Switch from ITEAD.

Using ESP8266 makes the building of a customized WiFi power switch more affordable especially if you start with Sonoff Pow WiFi Switch design and you use a special Arduino C firmware called ESPurna developed by Xose (tinkerman) which is an open source firmware for ESP8266 based wireless switches such as Sonoff POW and many others.

After Xose has built the software ــ ESPurna, he decided to build his own smart switch board to meet his special needs. ESPurna-H electronic design is very similar to Sonoff POW’s one; it uses ESP12 module as a controller and as WiFi transceiver.

ESPurna-H
ESPurna-H

AC power monitoring is done using HLW8012 IC which is also present in Sonoff POW. This IC monitors both voltage and current of the AC power, and output RMS voltage, current and active power encoded as a 50% duty cycle square wave where the frequency is proportional to the magnitude. I should mention that ESPurna supports interfacing with HLW8012. In addition AC load is enabled/disabled by using a 10A relay.

ESPurna-H uses HLK-PM01 AC-DC step-down power supply module. The 100-240 VAC input range so the board can be used anywhere in the world and the good performance made Xeos select this module.

HLK-PM01
HLK-PM01
HLK-PM01 Inside (Image Source ــ lygte-info.dk )
HLK-PM01 Inside (Image Source ــ lygte-info.dk )
HLK-PM01 Inside (Image Source ــ lygte-info.dk )
HLK-PM01 Inside (Image Source ــ lygte-info.dk )

ESPurna-H has another option to enable/disable the relay using a capacitive touch switch using TTP223 module.

Xose designed the board with Eagle CAD and released the schematics, PCB layout and other hardware design files on Github.

Source: cnx-software

Exploring Eagle CAD ULPs #5 – Place50.ULP Place All Parts of The Board to The Position in The Schematic

Welcome to the 5th post of the “Exploring Eagle CAD ULPs” series. Each post will be about one  useful ULP in Eagle CAD.

“ULP” User Language Program is a plain text file which is written in a C­-like syntax and can be used to access the EAGLE data structures and to create a wide variety of output files. You can think about it as a plug-in for Eagle.

You can reach the posts published in this series using the following link.

In this post, we will discuss an autoplacer ULP. Normally, Eagle CAD places parts in the board without any considerations to electrical connections, and there isn’t any built-in auto-placing tool in Eagle.

Without the help of ULPs, you will need to do this task manually by moving connected parts near to each other. However, some ULPs can solve this problem ــ manual placement is a time consuming task when the PC can help us !.

Place50 ULP has a simple and smart idea. It’s an autoplacer which places all parts of the board to the position in the schematic. To use this ULP first download it from Autodesk website to run it in schematic. Running this ULP from schematic editor will generate a script file in your home directory. Now open board editor and run the script file “place.scr”.

I made a little edit to the original ULP to make the script file be saved in the same directory of the project rather than the home directory. Download it from here.

Exploring Eagle CAD ULPs #4 – Renumber The Parts Number In Order

Tools for the Electronics Hobbyist Part 2- LC200A L/C Meter

When I started to deal with Chinese electronics suppliers from websites like Alibaba, Aliexpress and Taobao, I discovered that there are huge amount of undiscovered tools from the Chinese market. They are not easily discovered, maybe due to the Chinese language barrier, especially when we deal with a Chinese website like Taobao or maybe because most of us are used to deal with known electronics distributors like Sparkfun.

I also discovered that I can get my stuff from there in a lower price and in most cases of the same quality.
We can’t deny that dealing with known and trusted electronics stores such as Sparkfun and Adafruit is more comfortable and safe, but our proposal is an alternative one.

That doesn’t mean that our series will focus only on tools from Chinese suppliers. We will also explore special tools from Ebay, Tindie and other resources.

This series is weekly, so stay tuned! Please note that when we talk about a tool from a certain store or a supplier, we don’t claim that we guarantee the quality and if the store is trustworthy.

You can reach the posts published in this series using the following link.

tools_series2

Welcome to the second post in this series. Last time we talked about the graphic component tester. This time we are going to talk about another useful tool in our labs. I discovered it from the Chinese vendors and it’s called ‘LC200A L/C Meter’. It’s a tool that measures capacitance and inductance.

lc200a1

It has two leads that are connected to the target inductor or capacitor. LC200A has four measuring range positions:

  1. C range – Capacitance (0.01pF-10uF).
  2. L range – Inductance (0.001uH-100mH).
  3. Hi.L range – Big inductance (0.001mH-100H).
  4. Hi.C range -Big capacitance (1uF-100mF).

This device has three options to power it, through mini USB, 5.5mm DC socket or 4 AA batteries.

lc200a2

lc200a3

The results of the measurements are shown on a 16*2 LCD.

lc200a

To use it, you need to press the red button for 1 second after connecting the probes so the device calibrates, because the probes may give some drift (error) in the readings. You also need to select the range before connecting the probes with the target capacitor or inductor. You can read more details and features for this device from the user manual. You can also watch the video below, which is a review and a teardown for LC200A.

You can get LC200A for about 40$ from ebay, Aliexpress or Taobao.

Exploring Eagle CAD ULPs #3 – Teardrops.ULP Make A Teardrop Shape Connection With Pads and Vias

Welcome to the third post of the “Exploring Eagle CAD ULPs” series. Every week we will publish a new post about one useful ULP in Eagle CAD.

“ULP” User Language Program is a plain text file which is written in a C­-like syntax and can be used to access the EAGLE data structures and to create a wide variety of output files. You can consider it like a plug-in for Eagle.

You can reach the posts published in this series using the following link.

ulpserpost3

In this post we are going to explore a ULP called ‘Teardrops.ULP’. This ULP makes a teardrop shape connection between the traces and the vias or pads.

Before I found this ULP, I thought that I can’t do the teardrop thing using Eagle CAD, while I saw a lot of designs that have been done using Altium have this feature.

Using teardrop shape connection may result in many advantages:

  1. It prevents drill breakout due to drill misalignment where the trace joins the via or through hole.
  2. It makes stronger connection between the traces and the pads. Thermal expansion when re-soldering/desoldering could sometimes lead to a loose connection where the trace joins the pad.

 

Image Source - Youtube/Premier EDA Solutions
Image Source – Youtube/Premier EDA Solutions

 

Image Source - Youtube/Premier EDA Solutions
Image Source – Youtube/Premier EDA Solutions

This ULP should be used with forethought or on a copy of your board file just before plotting because it would be difficult to remove teardrops afterwards. Once added, they can’t be undone using ctrl-z.

Teardrop.ulp GUI
Teardrop.ulp GUI

In the GIF below, I tried to demonstrate how to use this ULP.

teardropulp

Note: You don’t need to download and add this ULP. it’s available in the ulp directory.
To use it, just press the ULP icon from the tool-bar and search for ‘teardrop.ulp’.

Building A Quadcopter For Newbie

Drones are one of the rising technologies in the world and it became very popular that we see it in news on places that have armed conflicts, aerial photography like GoPro drones and even for customer care like the Prime Air delivery system from Amazon which is designed to get packages to customers using small unmanned aerial vehicles (aka drones).

If this is the first time to read about how to build a quadcopter, then this post is for you. Boris Landoni from OpenElectronics made a detailed how-to tutorial on how to build a quadcopter in two parts.

quadcopter

As the name implies, the quadcopter has four propellers and to control them we need a lot of electronics parts and with no doubt a control board. The control board which Boris Landoni build is based on Arduino Mega and manages the engines of the drone with up to eight outputs, receives commands from a remote controller and supports the telemetry function via smartphone using HC-05 Bluetooth module.

mainboardquad

GY-86 flight control sensor module is used on top of main board (the small blue board) which combines MPU-6050 (3-axis accelerometer and 3-axis gyroscope), a digital 3-axis compass HMC5883L form Honeywell and the pressure sensor MS5611 MEAS.

Boris talked about the firmware that could be used to control the main board, but chose MultiWii firmware which is a general purpose software to control a multirotor RC model.

MultiWii Configuration GUI - Image Source eng.ucsd.edu
MultiWii Configuration GUI – Image Source eng.ucsd.edu

He used six-channel remote control operating on the 2.4 Ghz frequency. Each channel controls one surface or component in the quadcopter.

tablercchannels

flightglossary

 Main Board Assembled on the Frame and Connected with RC Receiver (the black box in the left of the main board)
Main Board Assembled on the Frame and Connected with RC Receiver (the black box in the left of the main board)

You can do both the telemetry and the control via Bluetooth from your smartphone using EZ-GUI Android application, which is a Ground Control Station (GCS) for UAVs based on MultiWii and Cleanflight.

ez-gui

Boris talked about PID parameters calibration, a control loop feedback mechanism used to control systems. He shared an interesting video showing how changing these values changes the behavior of the quadcopter.

 

The full assembly instructions and other important notes by Boris are found in the two part how-to tutorial: Part1Part2.

Bill of Material
Bill of Material

Benefits of Using A Buck-Boost Converter As A Pre-regulator For LDOs

Intersil published a new white paper titled “Preventing Subsystem Brownouts in Mobile Devices“. This white paper demonstrates the benefit of using a buck-boost converter as a pre-regulator, which leads to better overall system efficiency and enhanced battery life.

preldobuckboost

Systems powered from a battery may have voltage brownout when they are subjected to a burst current discharge, that is because of internal resistance of the battery. The internal resistance in Li-Ion battery varies according to its charging level. It can reach 200 Milli-ohm at the end of the discharge. Thus, a 4A burst current can cause an 800mV droop at the terminal, pushing the nominal 3.4V voltage to 2.6V, which is considered as a brownout voltage if the target LDO output is 2.85V. In this case boost converters prevent the momentary brownout.

Overall system efficiency is another useful aspect of using a buck-boost converter as a pre-regulator. The battery voltage is first converted to a voltage slightly higher than the highest LDO output voltage of the target LDOs, which is typically 3.3V. The buck-boost output is then set to 3.4V. So, the LDOs see a 3.4V input voltage, regardless of the battery voltage.

We can see, by numbers, the improvement of efficiency by comparing the two setups, with and without using the buck-boost converter.

nonpreldobuckboosteff

preldobuckboosteff

The figure below shows the comparison of battery discharge with and without a pre-regulator, while running the same applications with the same battery. You can see 12% enhancement to battery life.

runtimepreregbb

[White Paper]