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!

Advertisements

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: 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: Circuit Design

This post is meant to be an explanation of the final schematic for my Smartwatch board, version 1 with a bit of reasoning behind each component and my reasoning behind why I did what I did.

Total Schematic Overview

This is just the reset button, connected to reset the AVR and BLE module.  I also originally tied the screen reset to it as well until I realized the Adafruit screen library required it to be connected to a GPIO.

This is the vibration motor circuit.  Since the motor uses up to 85mA, about twice what the AVR can supply, it’s hooked up to an N-MOSFET to amplify the current.  I also hooked up the gate of the MOSFET to a PWM pin on the AVR in case I don’t need the full vibration.  There is also a diode and capacitor attached to the leads of the motor to help reduce noise and prevent large voltage spikes.

Next are the switches.  The four-pin box above is actually a navigation switch with each pin being a connection for up, down, and press actions.  Since the AVR has built in internal pull-up resistors, the switches are all tied to ground.  I also quickly ran out of interrupt pins (there are four or five on this AVR but they also doubled as communication pins that I needed for other things) so am using PCINT pins instead.  I have never used these before and they aren’t built into the Arduino toolchain so we’ll see how using them goes.

Here is the BLE module in all of its low power glory.  I grabbed the eagle part over from the same place I got the breakout board and used his design as a reference.  There are debugging LEDs on the TX, RX, and Connect lines to show the status of the BLE module, but odds are I won’t be keeping these since LEDs take several mA and I won’t have power to spare.

Above is the power regulation circuit.  It takes the battery (3.4V – 3.7V) and regulates down to 3.3V.  I also added a power switch at the last minute in case I want to solder the battery leads directly onto the PCB.

This is the charging circuit.  It takes 5V power from the USB port and feeds it to a chip that handles the charging for me.

Next is the cheap 3-axis accelerometer I’m hoping to use for a good deal of the interactivity of the watch.  However, it is a secondary feature so if I messed up it’s not too big of a deal.

Here’s a simple brightness-detection circuit.  I want to automatically control the brightness of the screen as a means of saving power so I’ve hooked up a photoresistor in a voltage divider circuit with the output being sent to an analog pin on the AVR.

This is just the header for the screen.

Lastly is the AVR itself.  In addition to the connections I’ve already covered there’s also a voltage divider connected directly to the battery as a simple means of detecting the battery voltage as well as the USB data pins in the hopes that I can load the Arduino bootloader and program the watch directly from the computer.