clockworkpi

Gameshell Multimeter Project

Overview

I gave my GameShell the ability to measure voltage, resistance, and current. This is a project I’ve been working on for over a year. It involves PCB design, 3D printing, Python and Arduino programming.

https://github.com/liamHowatt/Gameshell-Multimeter

I am happy to answer questions anyone has. Feel free to remix/improve it. I’d love to see what you guys come up with!

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Operation

The left switch (as viewed from the front) turns the circuit on and off. The right switch has three positions for switching between voltage, current, and resistance measuring mode.

Info

Code

You must install Python 3 and pygame on the GameShell. It may be possible with Python 2. Place these files in /home/cpi/multimeter/ where multimeter is a directory you must create. Then, to get it to appear in the launcher, put this file: 11_Multimeter.sh in /home/cpi/launcher/Menu/GameShell.

Flash the Arduino Nano with the sketch.

PCB

Order from OSH Park
Gerbers available on GitHub to fab elsewhere.

Case

Unfortunately the design might be a little tricky to 3D print with a regular 3D printer. I had Shapeways make it with SLS (selective laser sintering). I didn’t have access to a 3D printer anyways. Solidworks files and STL files are available on GitHub.

I also used 4 Meccano nuts and bolts which are really just socket head cap screws. I used 2 washers for the bolts that hold the PCB in place.

I glued 6 2x2 flat lego pieces so that it can attach to the GameShell. Alternatively, there are 2 small rectangular holes you could use to feed zip ties through and tie it down.

I glued a piece of glass from a picture frame to the window on the back. I used a glass cutter.

Measuring Range

R10 is 5.1 kOhm and R11 is 1 kOhm in my build and the code, but R10 is 3.3 kOhm and R11 is 2 kOhm in the schematic. These resistors form the voltage divider for measuring voltage. Different combinations of R10 and R11 make it possible to vary measuring range and precision.

It says on the PCB that the max measurable voltage is 13 v, but with the resistor pair I decided to use last minute (R10=5.1kOhm, R11=1kOhm), it can measure up to 30.5 v.

The shunt resistors are 1.2 Ohm, 3 watt resistors. They are for measuring current.

R9 can be varied to change the resistance measuring characteristics. There is a diode to prevent a weird Arduino shorting behavior I noticed while breadboarding it.

I created functions to map Arduino ADC readings to approximate voltage and resistance values. Yet to do current (just uses ideal-case voltage divider function for now).
Here are the graphs and regressions:
voltage: https://www.desmos.com/calculator/7crqdgohij
resistance: https://www.desmos.com/calculator/l3u5bhsdcv
X is the ADC reading and Y is the approxmate true value. Voltage is linear and reistance is reciprocal.

GameShell GPIO Custom Communication Protocol

I made the GPIO pins send send and receive bits from the Arduino with two clock lines and two data lines. When data gets exchanged, a byte is sent in both directions. With the code as it is, there is actually no data being sent from the GameShell to the Arduino. The only data being sent is a 12 bit byte from the Arduino to the GameShell 30 times per second. 10 of the bits are the ADC reading, and 2 bits represent measuring mode. I used optocouplers because the GameShell has 3v logic levels while the Arduino has 5v logic levels. See the schematic.

I wouldn’t have been able to do this if it weren’t for this groundbreaking post:

GUI Features

Graph
The graph shows a brief history of ADC readings from the last few seconds. It automatically zooms into the upper and lower range of the visible data. Change horizontal range with left and right on the + pad.

Approximate Tolerance
The tolerance under the reading is the quantity that the measured subject must deviate by in order to move to the next ADC step. Not actually a tolerance. The meter is not extremely accurate.

Status Indicators
Progress-ring style indicators. “ADC” is the raw reading as reported by the Arduino (between 0 and 1023). “bri” and “vol” are brightness and volume. They can be changed with start and select and shift+start and shift+select. When the meter is in resistance mode, it will beep when the resistance is <= 30 ohms. “buff” is the number of samples it takes before displaying the median value. Can be adjusted with up and down.

23314842 26716985 25594422 20104673

How the Circuit Works

The 3-position-switch is what’s known as a 2P2T (2 pole 2 throw) or DPDT (dual pole dual throw). The poles in question are two separate switches that switch at the same time, packaged in the same component, but are isolated from each other. The two throws are the two positions other than the middle “off” position. One “pole” is used for telling the Arduino which mode it’s set to, the other pole is for altering the measuring circuit so that it’s in the right configuration to measure its respective electrical characteristic (volts, resistance, current). See the schematic.

How to Break It

Even though this project is completely non-destructive to the original hardware (no holes or gluing the case), there is a potential to destroy the electronics if you are not careful. Here are all of the ways you could potentially damage your GameShell that I am aware of:

  • Reversing the terminals. There is no reverse voltage protection whatsoever.
  • Exceeding maximum measuring ratings.
  • Not wiring it properly.
  • Not disconnecting the terminals before changing modes. Ex: measuring battery voltage, then switching to current mode by mistake.
  • Leaving the meter circuit switched on. It could possibly drain the GameShell battery below 0% and potentially ruin it.

Gallery

15 Likes

This is cool! i haven’t seen too much mods for the gameshell like this and i’d like to see more!

1 Like

The GUI looks professional, simple and easy to read, bee man will be proud. Well done!

1 Like

great job!

What a persistent perseverance

1 Like

You used Osh Park. Right on!

3 Likes

This is an awesome project! And a great success! I can imagine the many many hours of hard work it took to make this…

… and thanks for reference to my post :slight_smile: :heart:

3 Likes

If there is room for 45degree angles, this should be printable without supports on a good FDM machine.

3 Likes

I like it!

I tried designing it with FreeCAD but had to fall back on SolidWorks, which in hindsight somewhat counter intuitive to the whole open source idea. There are ways to import and modify STL files, which are available in the repo.

A little triangle would have to be cut out of the PCB. Most of the PCB is unused space, but there happens to be header holes and traces there. I just uploaded the KiCAD files if you want to move things around.