ICRS: Power Board Prototype Design

SchematicBoard

The design for the board to supply power to both the Pi Zero and robot modules is fairly simple. It’s two components are a single-cell, LiPo charging circuit based on the MCP73831 and the Pololu adjustable step-up regulator. The charging circuit is fairly straightforward so I’ll just explain the step-up circuit which takes the output voltage from the single cell battery, passes it to the four pin input side of the step-up regulator, and gets back a boosted voltage from the second four pin output side of the regulator.

I also added four beefy diodes between the regulator and the 5V supply for the system. My reasoning behind this was to provide the ability to use multiple power boards, and therefore multiple LiPo batteries, in the system. Each regulator is limited to roughly three amps of current with the multiple boards, Arduinos, and the Pi Zero taking up a fair chunk of that. I was worried that the regulator wouldn’t be able to supply enough current to the motors and so I added the diodes so that multiple power boards could be safely put in parallel. I also decided to use an adjustable voltage regulator so that the output voltage of the regulator could be set higher than 5V so that the actual voltage seen after the diodes would be 5V after the diode forward voltage.

ICRS: Motor Board Prototype Design

The first board I’ll go over is the Motor Board prototype. It’s fairly simple; excluding the Arduino that handles communication and control it only consists of encoder connectors and a dual H-bridge. My planned use for this prototype will be to control the main drive motors of the robot base module. The schematic and PCB are shown below.

Schematic

Board

H-Bridge

I’m using an L293D chip for the motor driver. As shown in Figure 10 of the datasheet, each half of the chip can function as a bidirectional motor controller. By driving PWM signals to the control inputs of the chip, the speed of the motors can also be controlled. Unfortunately, each half of the bridge can only handle up to 600mA, which is relatively low, but it’ll sufficient for controlling the basic motors I plan on using on the prototype robot.

Encoders

The encoders I’m using are KY-040 Rotary Encoders which will measure the number of rotations of the motors and provide feedback to the motor controller. The linked description explains how the encoders work better than I can, but essentially the Arduino will measure the speed and number of rotations that the motor is travelling at and apply more or less current to the motor to get it to the desired end position. I plan on using a basic PID loop for this which I will cover in a later post.

In addition to the encoder connectors on the left, I’ve also added a basic debounce circuit in the top left of the schematic. Because these encoders use mechanical switches, they’re subject to mechanical bouncing of the switch contacts and so I plan on using a capacitor to act as a low pass filter and absorb these bounces and clean up the encoder signal.

OpenADR: Battery Charger PCB

 

Schematic

ChargerSchem

Above is the final circuit for the four cell LiFePO4 charger.  I tweaked a few parts of the original design for safety, testing, and power considerations.  A diode has been added after the main voltage output to allow for the capability to parallel multiple battery packs.  Another thing is that I’m using generic PNP and power resistors so that the maximum charging current of the design can be adjusted as necessary.  Since the charging current of a battery is loosely based on its capacity (see C Rating), allowing for a wide range of currents makes it theoretically possible to use any battery size.  I also plan on using a charge current of ~100mA for my first go at this.  Doing so allows the batteries to charge slower and give me more resolution when testing the charging circuitry.

BOM

The components I’m using from this design are as follows:

Board

ChargerBoard

One last thing to note is that I purposefully chose to use through hole parts for the sake of debugging.  The excess space and exposed connectors make it easier to use alligator clips to measure the voltages and signals, making sure that everything is operating as it’s supposed to.

Next Steps

Soldering, assembly and testing!

Big Seven Segment Display

Recently at work my team was throwing around the idea of real-time feedback by adding a big counter to the workspace to keep track of things like time left in the development cycle, number of static analysis warnings, etc.  For that reason I decided to build a large Seven Segment Display to provide that continuous visual feedback.  I designed the display completely from scratch to serve as a simple project that utilized a wide variety of skills.  Below I go through each step of the process and how each part works.

Mechanics

2015-07-24 17.30.41

For the actual segment part of the display I used transparent PLA from Hatchbox.  I didn’t have any trouble with how these turned out and am happy with the filament.  I had to do some experimentation with infill percentage in order to get the right amount of light passing through.  I believe in the end I settled on 20%.

2015-07-24 17.30.51

Here’s a close up of the semi-transparent digits.  Two 5mm LEDs fit snugly into the holes int he back.

2015-07-25 22.18.20

 

The individual segments are designing to press fit into black PLA frames.  I “welded” the four separate frames together using a 3Doodler to extrude plastic into the gaps.  For aesthetics I only welded the backs of the frames together, so while they’ll stay connected the seams won’t hold up to much abuse.

Electronics

Segment_Schem    Segment_Board.png

To keep board size small and reduce complexity I designed individual boards for each segment.  They only consist of two 5mm through hole LEDs, a current limiting resistor, and a 0.1″ header to connect to the main board.

2016-04-03 17.59.20

Here’s a pic of the boards soldered up and hot glued into the display.

Controller_Schem

Controller_Board.png

The control board is just a breakout for the TPIC6B595 which is a high current shift register that can power LEDs and be daisy chained together using SPI.

SparkFun ESP8266 Thing - Dev Board

I’m using the Sparkfun ESP8266 Thing Dev Board as the brains of the project.  This nifty little WiFi controller is Arduino-compatible and allows me to communicate with the display without needing to connect it to a USB port.

Firmware

Like I mentioned above, I’m using the SPI bus to communicate to each individual LED controller and daisy chaining them all together.  All that’s required is to write out four separate 8-bit numbers to set the appropriate LEDs.

The server side of things is the most complicated part of the project.  I borrowed heavily from the Web Server example in Sparkfun’s hookup guide.  The Thing board hosts a web server which accepts GET requests with the number to set the display two.  It then parses the string version of the number and converts it to the correct 8-bit sequence to set the seven segment display.

Software

The client side of things involved writing a Python script to submit the GET requests based on what data is being measured.  The current example is going through a directory and counting the occurrences of “if” in the code.

Source

As always, the source code and 3D files will be up on my Github.  I’m travelling this weekend, but will upload all the files Monday night.

Improvements

2016-04-08 12.43.14

While the LED display was plenty bright in my dim home office, I found out that they weren’t nearly strong enough to overcome the bright fluorescent lights at my office.  It’s difficult to see in the picture above, but it’s hard to read the numbers from more than a few feet away.  When I originally designed the display I erred on the side of caution and ran the cheap eBay LEDs at ~3mA.  Unfortunately, this was not nearly enough.  While it would be relatively easy to swap out the resistors to increase the current to the LEDs, I’m also unhappy with how much the plastic segments diffuse the light and think just making the LEDs brighter would only exacerbate the problem.

For version two I think I’ll experiment with two different ways to fix the problems above.  One option would be to use “straw hat” LEDs instead of the generic 5mm kind.  These LEDs have improved light diffusion.  I could also use hemispherical holes in the plastic digits, rather than cylindrical ones, so that the light is directed in a wider pattern.

Another option would be using WS2812B.  In conjunction with an improved plastic digit to help with light diffusion, this LED would greatly simplify the electronics of the display.  These LED modules have built in resistors and control logic, allowing them to be daisy chained and controlled via a serial interface without any need for the shift register control board that I used for version one.  WS2812Bs are also RGB LEDs, so another benefit is that the color would be controllable.

Hopefully I’ll get a chance to start on version two soon!

Maker’s Tablet: Multimeter

schematic

I decided to design and build my own digital multimeter for this project because I couldn’t find a suitably cheap USB multimeter.  Designing my own also let me flex my analog circuit design muscles as well as control the size and shape of the board.  Below are the different sections of the circuit and a brief explanation of how each works.

Vmeas

This is the voltage measuring circuit.  It operates by measuring the voltage between the two resistors in a voltage divider circuit with three selectable voltage ranges.  Turning on the 10kOhm resistor allows for a maximum of 10V, the 2kOhm resistor allows for a maximum of 25V, and the 470Ohm resistor allows for a maximum of 100V.  Details on how the resistor values were calculated can be found in the Instructables article where I found this design.

 

Imeas

The current measurement circuit uses a combination of Ohm’s law and a shunt resistor with a low resistance.  The voltage generated over the resistor is then amplified by a non-inverting amplifier.  With a gain of 5x from the amplifier, a 1 Ohm power resistor, and two 500mA resettable fuses, I can measure a maximum of 1A of current.

 

Rmeas

The resistance measuring circuit is the only thing I decided not to use from the multimeter Instructable.  The original circuit used a constant current source and Ohm’s law to determine resistance, but because I wanted a simpler circuit I just used another voltage divider with selectable ranges.  The only downside of this method is that the resolution of the measurement will now be non-linear, but I don’t think accuracy will be a huge deal for most of the circuits I’ll be working on so I’m not that concerned.

layout

Above is the final board layout that I’ll be using.  I kept most of the components as surface mount to minimize board size.  Now all that’s left is checking to make sure it actually works!

Maker’s Tablet: Xprotolab BNC Adapter

As I mentioned in my previous post, I was unhappy with the standard 0.1″ headers that the Xprotolab Plain used for measuring analog signals, so I created an adapter board that would connect standard BNC connectors to the oscilloscope header. BNC connectors tend to be the standard for analog signals due to their compatibility with coax cables which reduce the noise on analog signals.  In addition to routing the two oscilloscope channels to BNCs I added a third one to route the AWG waveform out of.  However, due to the voltage range only being +/- 2V, I decided to add some signal amplification to increase the range to +/- 8V.

Schematic

Below I’ll break the schematic down into pieces and explain the purpose of each.

 

xproto_con

This is the connector to mate with the Xprotolab Plain board.  Both oscilloscope channels, the oscilloscope trigger pin, and the AWG are broken out.

 

5v

Rather than adding a step up regulator to the board to boost the Xprotolab’s 3V to the 5V that is necessary for the Max680 circuit, I just left a connector on the board to feed the 5V supply.  Due to the large amount of USB components that will be in the tablet, I expect it will be easy to connect the USB power to this input.

 

trig_con

I’ve routed the external trigger for the oscilloscope to a 0.1″ header.  Because it’s a binary signal I don’t need to worry as much about high speed signalling and noise.

 

 

BNCs

These are the three BNC connectors for the two oscilloscope channels as well as the AWG output.

 

Boost

This is a boost converter that takes in 5V and generates +/- 10V to use for the amplifier rails.

 

Amplifier

This is just a basic inverting amplifier using one of the op-amps in the LM358.  It takes the AWG signal as an input and amplifies it up to a +/- 8V signal.  Due to the inner workings of op-amps, it’s not possible to use the full +/- 10V, so I rounded down to the next even number.  The resister ratio (R2/R1) needed to be 4x to achieve the proper gain to amplify the 2V signal to 8V.  However, because most resistors have a 5% tolerance, I used a 10kOhm potentiometer for R2 rather than a 4kOhm resistor so I could adjust the gain to be exactly 4x.

Layout

Here’s the final layout for the board.  Notice I didn’t use a powered plane on the top board layer like I usually do.  This is to prevent any power bus noise from interfering with the oscilloscope signals.  I also tried to keep the traces as thin as possible because thicker traces cause more signal degradation.  For anyone interested in ordering this board for themselves, it’s available on OSH Park here.  I kept all of the components as through hole parts to make soldering easier.

Maker’s Tablet

For the past year or so I’ve had a project on my project list called the PiPad+.  The details on the project page are pretty generic, describing it as a DIY tablet.  I’m hoping to remedy this by fleshing out the project details and motivating myself to finish it in the coming weeks.

Like most of the Maker community, I was amazed when the PiPad came out.  When Chalk-Elec got their 10″ displays back in stock I quickly bought one so I could create my own version of the PiPad.  Of course, being myself, I couldn’t just copy what had already been done.  I had to do something new and exciting.  Right off the bat I decided I would get rid of Raspbian’s default GUI and do something new that was optimized for touch controls and my personal tastes.  I got as far as implementing a basic window manager and a grid-style homescreen before I “took a break” because GUI design is hard!  For the past year the code lived in my GitHub, gathering digital dust, until very recently when I decided to delete it.

During the long “break”, the project was also subjected to a good deal of feature creep and component scouting.  Many things have also changed in that time; I bought a 3D printer, the Raspberry Pi 2 was released, etc.  Rather than continue to let this project stagnate in its project drawer I’ve decided to try to finish up the project in the near future so I’m no longer plagued by the inexorable desire to shove in as many features as possible.  The semi-final state of the project will be as follows.

Processor:

I chose to build my tablet around the Raspberry Pi due to the large amount of community support behind the SBC.  The huge number of people tinkering with the Pi’s OS ensured that I’d be getting the maximum performance available for the hardware.  I’m currently using a Raspberry Pi 2, though I will probably upgrade to the Raspberry Pi 3 once it becomes available.  The built in WiFi and BLE will help save space inside of the tablet.  The only downside with using the Pi is the size.  Due to the dimensions of the USB port the thickness of the tablet will have to be around 2.5cm.  Rather than attempting to slim down a Pi, I opted to utilize the thickness to cram the tablet full of features as detailed below.

Screen:

Due to the amount of stuff I wanted to cram in this tablet I decided to get Chalk-Elec’s 10″ Touchscreen to use as the tablet display.  If things get too cramped I might consider upgrading to one of their bigger displays.

Battery:

For the battery I decided on an EasyAcc 10Ah Battery, commonly used as a portable phone charger.  I chose this battery because it was the largest one I could find that would fit in the tablet chassis.  It also has pass-through charging, a feature which allows the battery to power the tablet while it’s being charged.  Surprisingly, this is a rather uncommon feature in portable battery packs.

Extra Features:

Rather than building a basic tablet that won’t get much use, I decided to add extra features that would enable my version of the PiPad to be the ultimate Maker’s tablet.  The extra added features are detailed below.

Multimeter

The most important tool in a Electrical Engineer’s toolbox is his multimeter, so this one was a must have.  However, I had trouble finding a small and cheap USB multimeter, so instead I opted to make my own.  I borrowed heavily from this Instructable when designing my custom board.

Oscilloscope

An important tool for working with analog circuits is an oscilloscope.  A few months prior to starting this project I bought an Xprotolab Plain, which is a nifty little USB oscilloscope that’s surprisingly cheap.  Due to its small size I decided to add this into the tablet.  I also created an adapter to go from the Xprotolab’s header to a standard BNC connector.

Logic Analyzer

The Xprotolab Plain also had a Logic Analyzer built in so this one was a freebie.  The logic level is only 3.3V, however, so I’m toying with the idea of making an adapter to add 5V tolerance.

Bus Pirate

The Bus Pirate seems to be a commonly used tool by many makers and hackers.  I don’t have any experience with it, but decided to include it in the tablet since it didn’t take up much space.  I decided to go with version 3.6 of the hardware as that seems to be the most widely supported.

GPIO Header

Lastly, because I wasn’t using them for anything I decided to add a breakout for the Raspberry Pi’s GPIO to the tablet.  This would add some additional IO to fiddle with and was simple to add.

Plans

The components that will hopefully make the tablet are currently sitting on my workbench in a rough semblance of how they will be organized inside of the tablet.  The steps that I still need to take in order to get everything working are listed below:

  1. Populate, solder, and test the multimeter
  2. Determine how to organize the power subsystem
  3. Decide on a semi-final organization of all the parts’ locations inside of the tablet
  4. Finalize the 3D printed bezel with connector cutouts
  5. Glue the mechanics together
  6. Secure the components inside of the tablet with double sided and Kapton tape
  7. Connect everything together
  8. Design and attach a removable back plate
  9. Decide on whether to use Raspbian’s default window manager or design my own

Over the next few weeks I’ll start going through each step, trying to finish up the tablet hardware so I can move on to other projects.  For the components that I’ve custom built, I’ll post source files and separate blog posts to explain how I’ve designed these parts, and how they work.

DIY Smartwatch: Soldering SMD

Going into this project I knew I would have to do a lot of surface mount soldering to save space and money.  I used the smallest SMD hand-solderable packages and still ran out of space!  I’ve never been particularly good at soldering, but knew that I would have to become much better to tackle the types of projects I’m interested in.  In anticipation of this, I splurged and bought a very nice soldering iron from Radioshack.  I cannot express how great this iron is!  I’m used to using cheap, $10 irons that just need to get the job done, but with the fine tip on my new one, SMD wasn’t difficult at all!  Below is a picture of the board with most of the components soldered on.

{INSERT IMAGE}

You’ll notice that I haven’t yet soldered on the accelerometer.  That’s because QFN packages are much smaller than I anticipated, even with a fine tipped iron.  In order to solder this, I’d probably need solder paste and a hot air station, something I’m not quite ready to drop $100 on yet.  Not sure what I’m going to do about that, especially since I’m going to need the accelerometer to minimize power usage.

DIY Smartwatch: Improvements for V2

From the current progress I’ve already made on this project, I can already see a lot of mistakes and things that will need to be improved for the second PCB.  Below is a list of the ones that immediately come to mind.

  • Possibly use the onboard voltage regulator on the Adafruit display
    • The Adafruit display board already has a 3.3V regulator for the screen logic, using this would mean one less part that I need and would give me a tiny bit extra space.
  • Maybe just switch to the E-Ink display to save power
    • I was very dismayed by the enormous amount of power the screen uses.  Even if I get tricky and heavily optimize the screen usage, I’m not sure how long I can get the battery to last.  This is a last ditch solution and would probably involve an entire re-layout of the board.
  • Use through holes for the battery instead of a connector
    • The battery connector is the tallest component on the board aside from the connectors, getting rid of it would mean I can make the uber-thick watch a little bit thinner.  Since I have verified that the battery charging circuit works, I just need to decide which battery will be used I should then be able to solder it in permanently.
  • Use micro USB instead of mini
    • Same thing as above, the mini USB is pretty tall.  A micro USB connector didn’t seem much harder to solder and would give me a little extra space.
  • Get rid of reset button
    • When I’m entirely done programming the watch, I’ll most likely give it a simple case, making the Reset button entirely inaccessible anyway.  It might be better for space to replace the button with a test point.
  • Add real-time clock
    • With the added space from removing components, there might be room for an RTC that could be used to keep better track of time.
  • Enlarge accelerometer pads for easier soldering
    • As previously stated, the accelerometer is very difficult to solder, especially without a hot air station.  If I don’t decide to buy one, another option might be to enlarge the pads for the accelerometer chip connections so it is easier to touch with the soldering iron.
  • Move tall components away from microSD slot on display board
    • In line with the USB and battery connections, I need to plan ahead so that the top boards fits better with the bottom board with less wasted space.
  • Silk screen labels
    • Since I rushed to ship out the board for fab, I didn’t take the time to properly and clearly label all the components on the board.  Doing so would make identifying what needs to go where much easier and would make debugging simpler if I know what vias are attached to what.
  • Test points
    • It would probably help to have some dedicated test points to make sure the circuit is behaving as it should be.

DIY Smartwatch: Board Layout

After the circuit design comes the hard part, the board layout.  I went through several iterations of trying to fit all of the different components on the board but essentially based the design around the Bluetooth module, which I knew I wanted on top, the screen header, which I wanted on the bottom, and the buttons which I wanted on the right side of the watch.  Below is the fruit of many hours of labor.  The board design is actually the stage which decided the final components I would use.  During the circuit design phase I had included an RTC and crystal oscillator, but as you can see below, there wasn’t really any room for it.  I also figured that the internal oscillator on the AVR is reasonably accurate and the time could be included in a data packet sent from the phone.

The top layer of the board is a 3.3V pour and the bottom is a ground pour, but after adding all of the components to the board I noticed that the power would have to take a rather circuitous route to reach some of the components on the right side.  To remedy this, I decided to add some last minute capacitors and shift some components around to provide better connectivity.  However, in my rush I ended up making a few minor mistakes.  Namely I placed several capacitors and components directly under the Bluetooth board.

And here are the fabbed boards!  I ordered them from Fusion PCB since they are the cheapest option I could find and provided a quantity of ten boards in the event I made a lot of soldering mistakes.  I only glanced at a few of the boards but am very satisfied with the quality.  The only downside of their service is the turnaround time.  It took twenty days from day of order to day of delivery, which is reasonable since they’re based in China, but can be frustrating if you need to make multiple iterations and improvements.