How to Make a Shield in Eagle CAD

Table of Contents

Introduction

So you want to design a shield for your 3DoT board. First, which shield do you want to design? The 3DoT boards includes both a top “3DoT Shield” and front facing “Sensor Shield.” The 3DoT Shield is typically used to add functionality to the board; for example an accelerometer, gyro, Inertial Measurement Unit (IMU), compass, boost converter, or current monitor etc.. The sensor shield is typically used to add a downward facing sensor; for example an IR sensor, RGB color sensor, or CCD camera. This post shows you How to Design the 3DoT Shield.

The 3DoT Shield plugs into a 16 pin header and typically communicates with the Micro-controller Unit (MCU) via a serial communication protocol. The shield supports I2C, USART, and SPI serial interfaces.

Figure 1: 3DoT Shield

In most cases the pins may also be used to implement a simple digital interface. It also can output a PWM (AnalogWrite) waveform or read an analog input (AnalogRead).

3DoT Serial to Digital Pin Map
PinSerial PinDigital Pin NameNote
2SCLD3PWM Output
3SDAD2
4RXD0
5TXD1
16MISOD14
15MOSID16
14SCKD15
13SSD17RXLED
11A4A4May be used as digital pin

In the following tutorial, I will show you how to design and layout a basic 3DoT Boost Shield by starting from an existing open source design.

Setup

This tutorial assumes you have a basic working knowledge of Eagle CAD. If you are new to Eagle CAD you may want to start by reading the blog posts on the Getting Started/Electronics and Control Resources page in the “PCB Design” Section. Before you begin, make sure your computer is configured with the latest software.

3DoT Boost Shield Tutorial

So what functionality do you want to add to your robot? To travel in a straight line or turn you may want to add a gyro, compass, and/or rotary (also known as a shaft) encoders.  To run 5 or 6 volt motors or servos consider adding a boost converter. If you do add a boost converter, you will want to make sure you do not exceed the 1.3 A capability of the CR123A Li-Ion battery by including a current sensor. Technical Note: The current limit of the 3DoT Power Management IC (PMIC) chip is set to 1.0 A.

In many instances, you can download Eagle CAD layouts and simply adjust the form factor and pin assignments to make your 3DoT shield. Eagle CAD designs are provided by the Arduino Community,  Digi-Key Designer, and SparkFun.

For my tutorial, I am going to make a 5v boost converter based on the SparkFun LiPo Charger/Booster – 5V/1A.

Figure 2: SparkFun LiPo Charger/Booster

So lets begin.

Step 1 – Download: Download the Eagle Files found here. Make a copy of the folder and rename the board (.brd), and schematic (.sch) files and the folder  3DoTBoost5V1A_v1. As you work on your design remember to save often.

Figure 3: Name Folder and Files

Step 2 – Replace the Frame: Open your soon to be new 3DoT shield in Eagle CAD. Delete the SparkFun Frame and replace it with the FRAME-A4L device found in the SparkFun-Aesthetic Library. Follow these instructions to set the CNAME, DESIGNER, and CREVISION values in the title block:

  • Right click the origin of the title FRAME (Small red cross seen near the bottom-left of Figure 4) and select Attributes from the pop-up menu.
  • Click the New button.
  • Enter the name you want to change, in the example “CREVISION”
  • Enter the value you want displayed, in the example “1.0”

Figure 4: Update Title Block

Step 3 – Simplify the Schematic: The 3DoT board includes a Li-Ion Battery charger so we can delete the top half LiPo Charger Booster of the schematic leaving the Switching Regulator Circuit. We are going to be switching from the SparkFun breakout board connectors to our 3DoT headers so you can delete Jumpers J5, and J6.

Step 4 – Simplify the Board Layout: Now lets cleanup the original Sparkfun Charger/Booster layout shown in Figure r5 by removing artwork, vias, and traces that are now longer applicable.

Figure 5: SparkFun Charger/Booster

  • Show Layers  21 tPlace and 22 bPlace ONLY (verify layers 39 tKeepout and 40 bKeepout are Hidden). Block select everything and delete. Don’t worry, artwork that is associated with components will not be deleted. Show the layers you just hid. The board should now look like Figure 6 “Boost Only.”

Figure 6: Boost Only

  • Rename v10 on bottom layer v1.0.
  • Remove unused “shield” polygon.
  • Restore Top and Bottom GND polygons to rectangles with dimensions equivalent to the board.
  • Remove ground traces and vias that are outside the boost circuit. If they are not already visible show layers 23 tOrigins and 24 bOrigins.
  • Block select Boost Circuit and move closer to the left of the board.

Your board should now look similar to Figure 7.

Figure 7: Cleaned-up Board

Congratulations, your design is now ready to be configured as a 3DoT Shield.

Step 5 – Add 3DoT Shield:

The 3DoT Shield with dimensional information is shown in Figure 7. Follow these instructions, to place your boost circuit on the 3DoT Shield.  Don’t panic if the circuit does not fit inside the 3DoT shield. We will be working on this problem after we wire up the connectors.

  • Redefine your boost shield’s border plus top and bottom ground planes as defined in Figure 7.
  • From the SparkFun-Connectors-8pin library add two (2) CONN_08>CONN_08″ devices. They should automatically be labeled J1 and J2.
  • Place J1 (left) and J2 (right) in the orientation and location defined in Figure 8.

Figure 8: 3DoT Shield with Dimensional Information

Step 6 – Wire Boost Circuit to 3DoT Shield Connectors: Open the schematic window. For our boost circuit we only need to wire the input J2 pin 8 RAW and output J1 pin 10 VM  to our circuit. RAW is wired to our battery through a Power Management IC (PMIC) chip. The PMIC in turn is enabled by the switch on the 3DoT board. The VM pin is wired to the motor driver and servo power connectors.

  • Add and Name traces VM, RAW, and two GND pins on J1 and J2 as shown in Figure 8 (bottom right). The attractive label symbols are enabled by checking the xref box in the symbols property window. Notice that relative to the J1 and J2 connectors, the input (RAW) is on the right and the output (VM) on the left.
  • Returning to the boost schematic. Rename VBATT -> RAW and VCC -> VM. Add labels and clean-up the design. Notice that relative to the circuit, the input (RAW) is now on the left and the output (VM) is now on the right. My final circuit is shown in Figure 9.

Figure 9: 3DoT Boost Shield Schematic

Step 7 – Complete the Board Layout: Switch to the board view window.

  • You should now see the layout of the boost circuit connected to the J1 and J2 connectors by air wires (layer 19 Unrouted). With a little tilt of your head you hopefully can see that with a simple rotation to the right (clockwise) the circuit will line up quite nicely with connectors.
  • Run 32 mil traces for VM and RAW. Because I am never happy with good enough, I used polygon fills for the VM and RAW traces. Do not forget to name the polygon. For my design I needed to also change the rank of the polygon fills to 1, and the top plane to 2.
  • Although the 3DoT Board is designed to support a Boost Shield, unless the solder bridge across Jumper 1 is removed, a short will occur when the boost shield is plugged in destroying the 3DoT board! To make sure the user is aware of this potential danger to the board, add a note on Layer 21 tPlace with the following text “IMPORTANT: REMOVE SOLDER BRIDGE ACROSS JUMPER J1 ON THE BOTTOM OF THE 3DOT BOARD BEFORE INSERTING THE BOOST SHIELD. NOT FOLLOWING THIS INSTRUCTION WILL RESULT IN LOSS OF THE 3DOT BOARD.
  • Congratulations you have just made your first 3DoT shield!

Figure 10: 3DoT Boost Shield PCB

On your Own

While my design is good it could be better. Here are two modifications you can make to improve your boost shield.

  1. Assign one of the unused serial interface pins as a digital pin and wire to the EN trace. Now you can turn the boost circuit on and off through software. This is especially important if you want to avoid a large an inrush of current when the 3DoT board is initially turned on and to save power when the motors are off.
  2. Add a current sensing circuit to your shield. Whenever you run motors and servos, especially with a boost circuit, it is important to manage the amount of current drawn by the robot. For example, to turn off the motors if one of them stalls resulting in excessive current being drawn which will result in the loss of the motor and potentially the 3DoT board as well.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S’18 Project and Mission Objectives

Design and fabricate a remote controlled, competitively priced, toy robot that is capable of memorizing and traversing a path. The child “teaches” his/her robot by guiding it through a maze. Once the child and robot team solve the maze. The child returns the robot to the entrance of the maze and quizzes the robot to […]

Solar Tracker

Robotic Arm V.1

Top Shield PCB Debugging

Inductive Sensor Issues and Fix – Ugly Blues

Introduction:

Inductive sensors can be tricky. For this project, we used the LDC 1612 inductive sensor. This is a 10-bit, 2 channel, inductive sensor that runs over I2C. For testing, I used the SEEED Studio “Grove – 2 Channel Inductive Sensor”. This sensor incorporates the LDC1612 and even comes with an accompanying library file that works with the 3dot. All testing worked flawlessly with this breakout board. However, trouble came during the manufacturing of our PCBs. There were 2 main problems, the library no longer worked and when I tested with a different “working” library, the values the LDC sensor gave seemed to be random. Both of these issues I was able to fix are described below.

Coil design is an Art:

It turns out my coils were not identical to the Groove sensor. I had to use a thicker trace value for Oshpark to be able to create my PCB and by doing so, I changed the characteristics of the coil. To design the coil I used TI’s coil designer which can make compatible coils for the LDC sensor(it is a TI sensor). This wasn’t the problem, the problem was the capacitor in parallel with the coil. The groove sensor used a 100pF capacitor and with my coil the values given by the sensor were unstable. So with a lot of testing, I found a suitable value of 47pF. Keep this in mind if you want to use this sensor, try to make it exactly the same as the Groove sensor to minimize any problems with the coils.

https://webench.ti.com/wb5/LDC/#/spirals

https://www.ti.com/lit/an/snoa930b/snoa930b.pdf?ts=1620945473204&ref_url=https%253A%252F%252Fwww.google.com%252F

LDC1612 Libraries:

So my sensor would not communicate with the Groove sensor library. After a long time searching I found another library written by a physics professor to test inductors for his class. This library did work but it was very “bare-bones” and did not have a dual-channel mode, something I needed. The reason my front shield did not work was because I used the internal cyrstal oscillator of the LDC sensor while the groove breakoutboard used a physical component added to the board. Since this device was I2C. I need to initialize it to use the internal crystal instead. The fix can be seen here:

This code is in the “Seeed_LDC1612.cpp” in the Arduino library under the Multichannel config function. By changing the highlighted value to 0x0401 from 0x1601 the internal oscillator will be running the chip. This coincides with the part of the LDC datasheet:

We are changing bit 9 from 1 to 0 which enables the internal oscillator. I also changed bit 12 from 1 to 0 which gave me more consistent readings. I hope this helps someone!

Boost System Design – De Robot

Introduction:

The boost system for the De Robot project is intended to temporarily speed up the robot on straight parts of the maze. By doing this we can save some time in the maze and therefore get more points while solving the maze. To do this we are going to use a 12V boost converter to charge a supercapacitor. By controlling the output of the supercapacitor by switching MOSFETs, we can push the voltage into the motor controller on the 3dot, therefore temporarily using 12V to power the motors. However, the 3dot runs on 2 different voltages, 5V and 3.3V, so adding 12V to the system needs to: 1. Create 12V, 2. Charge a suitable supercapacitor, and, 3. Be able to switch the output of the supercapacitor on and off.

Creating 12V:

Since the 3dot has a pin for taking the raw battery voltage(~4.2-3.0V) we can take the direct output of the battery for our 12V boost system. Boost converters, more specifically switching boost converters, can be “finicky”. Meaning that the PCB design and component choice need to be very specific to operate correctly. Luckily Texas Instruments makes an online tool for the schematic design and component choice, additionally, following the PCB design guidelines in the datasheet for the boost converter chip we can design a suitable system. The tool is called Webench Power Designer(https://www.ti.com/design-resources/design-tools-simulation/webench-power-designer.html) and by putting in the parameters we want it will generate a lot of circuits suitable for the job. My requirement for choosing which one to use was: 1. Cost, 2. Efficiency, and 3. The simplicity of the circuit. The simpler circuit will make things like PCB design much easier as there are fewer components and therefore, fewer traces. I chose this design:

This design had a lost cost BOM(bill of materials), a decent efficiency. and the simplest schematic of all the designs. Also using the BOM I was able to find many of the components on Digikey directly, speeding up the part ordering process. Some parts like the inductor and the capacitors were not on Digikey but with the specified parameters of each part I was able to find equivalent parts.

Charging a suitable supercapacitor:

Since the boost system only needs to boost shortly we didn’t need a super high capacity capacitor. Additionally, a very high capacitance would take longer to charge therefore lowering the number of times the boost could be used. So we settled on a 1F 27V supercapacitor. Now to charge the capacitor I looked at typical battery charging circuits. They tended to share one thing in common. They are measured by the current of their output rather than voltage. This is perfect for battery charging as batteries are typically charged with the constant current rather than constant voltage. Supercapacitors could be charged either way, but charging it like this made things feel moderately safer. So to charge the supercapacitor all we had to do was add a current limiting resistor to not overwhelm the current output of the 3dot then hook it up to the output of the boost.

Switching the output:

Before we decide how to turn on and off the boost system we first had to look at the 3dot schematic to find out how we can provide voltage into the motors. I am looking for 2 things, how the motors are getting power, and how I can protect the 3dot from the 12V.

Motor driver:

The 3dot uses an H-bridge motor driver called the DRV8848 to control and power the motors. According to the datasheet of this DRV8848, it can accept an input voltage from 4V-18V. This means we can switch the power to the H-Bridge without boost output and be able to use PWN while boosting! But first, we need to find how we can switch the power.

Protecting the 3dot from the 12V:

This picture here shows a solder jumper on the board. To keep things short, on the V10 version of the 3dot the 5V is the output of the onboard 5V boost converter and 5V_VM is the power source only used for the H-Bridge. This means but desoldering the solder jumper and adding in a Schottky diode we can isolate the supercapacitor output to only the H-bridge and keep the 3dot safe.

Note: The pinout says 5V_VM is the power pin on the servo header but this is not correct according to the schematic.

High Side Switch:

There are many ways to switch one voltage with another, relays, analog switches, etc. I chose what seemed to be the simplest to implement and best performing in this case. By using a P-channel and a N-channel MOSFETs with suitable resistors we can make a high side switch with the other MOSFET driving the gate of the high side transistor. This can be seen in this LTSPICE simulation:

Finally, we can add all these things together to create the final EAGLE schematic and PCB.

Note: The current limiting resistor is not included as it was added off-board. The final PCB design was changed to fit all the parts and make it easier to manufacture. Please refer to De Robot’s top shield blog post for the final top hat design.

 

LDC Sensor Selection Research