
STM32 Open Source Multimeter - lelf
http://embedblog.eu/?p=298
======
morcheeba
Professional DMMs are nice because they've thought through all the failure
cases.

This meter is nice, but the relay on the current range select (K2) is set up
so that there will be a break in the current when it switches ranges. On
inductive loads, this would cause arcing and can damage the relay. It could
also shoot through D6 into the voltage rail, potentially frying the meter. On
digital loads, this blip in power might be enough to reset the circuit you're
trying to measure. A better way to put the relay is to always have the 10 ohm
resistor in series, and switch in the 1 ohm in parallel when needed. Of course
the resistance will now be 0.909 ohms instead instead of 1, but that can be
calibrated for in software.

~~~
sambe
This would probably be good feedback to leave as a GitHub issue (or PR!).

~~~
milad_nazari
Pull requests for open hardware projects, what a time to be alive!

------
kragen
This is wonderful!

The tricky part of a multimeter is not the digital part (which is a knob in
many multimeters) but the analog part: calibration, stability, noise. (And, as
martin points out, safety.) The three-to-five-digit output here suggests an
accuracy of ±0.05% or better, which is not easy to achieve, and it turns out
at the end that the accuracy is about ±5%. (Expensive multimeters can deliver
7 digits, and for real.) In theory the STM32's ADC can deliver ±0.1% error
easily, and its internal bandgap reference ±2% (accuracy, not
reproducibility), so it ought to be possible to do better. But I happily used
analog multimeters with several percent error for many years. In fact, I still
do sometimes!

If you like this multimeter, you'll probably like the M328 "DIY hobby Arduino
voltmeter" or "AVR component tester", which you can buy prebuilt from a
variety of places. It does component identification — it's a full RLC meter,
with automatically triggered transistor and diode test modes — but is
unfortunately built around the AVR, limiting it quite a bit. And it usually
(always?) has pretty poor precision.

Is there an alternative repository to Thingiverse yet? They're run by
notorious bad actor MakerBot, so depending on them to archive our
manufacturing knowledge hardly seems prudent.

~~~
Sendotsh
> Is there an alternative repository to Thingiverse yet? They're run by
> notorious bad actor MakerBot, so depending on them to archive our
> manufacturing knowledge hardly seems prudent.

This is something very close to my heart that I’ve been wanting for a long
while now. Thingiverse is not only run by someone I don’t wish to support, but
is also a measurably crap site. It’s slow, search barely works, etc etc. Bring
up the name to anyone and you’ll instantly hear endless complaints.

But.. there’s nothing better.

The new Prusa site is Gcode only, and very limited in features. Grabcad is a
mess of annoying UI and endless low quality models, but kinda works.

We seriously need a Github for 3D designs and electronics. Allow sharing of
any filetypes, from STL and OBJ to raw CAD files, as well as wiring diagrams
and PCB schematics, richtext assembly descriptions (like Githubs readme
files), and a way to preview the model files visually like
Thingiverse/Grabcad.

There’s huge demand for a service like this and there’s income to be made by
allowing people to get parts printed or PCBs manufactured via referral to
appropriate services.

~~~
MrGilbert
> We seriously need a Github for 3D designs and electronics.

For what's worth, GitHub actually renders STL as a 3D representation, if you
click on the file, e.g. here [1]. (Just a random example, I'm in no way
affialiated with the project).

Of course, it's still lacking important features, e.g. search parameters, etc,
but... it could work.

[1]
[https://github.com/iliterobotics/3D/blob/master/Justin/Uncom...](https://github.com/iliterobotics/3D/blob/master/Justin/Uncompressed%20ball.ipt.stl)

~~~
amelius
It's cool, and there are open-source projects that can convert from STL to
WebGL, so this kind of conversion is quite accessible, and e.g. GitLab could
easily incorporate it as well (if they haven't already).

See e.g.
[https://threejs.org/examples/#webgl_loader_stl](https://threejs.org/examples/#webgl_loader_stl)

------
ChuckMcM
This looks like a fun project but I would hesitate to use it on a regular
basis. There are actual "DMM" chips[1][2] which have the correct filter
network on the inputs to avoid common pitfalls (like reading the noise level
as a DC offset) and while they typically are designed to drive an LCD display
it is easier to hook up a microcontroller to demux what they are driving then
it is to design analog circuitry that does what their front end does. So its a
trade off of where your expertise lies.

Back in the way back times Steve Ciarcia wrote an article on doing this with a
BASIC program talking to a board with a DMM chip called "Try an 8 channel DVM
Cocktail." It used the MC14433 which Microchip manufactured as the TC14433
([http://ww1.microchip.com/downloads/en/devicedoc/21394d.pdf](http://ww1.microchip.com/downloads/en/devicedoc/21394d.pdf))

[1] 3 3/4 digit -- [https://www.digikey.com/product-detail/en/maxim-
integrated/M...](https://www.digikey.com/product-detail/en/maxim-
integrated/MAX133CMH-D/MAX133CMH-D-ND/1701941)

[2] 4 1/2 digit --
[http://ww1.microchip.com/downloads/en/DeviceDoc/21459E.pdf](http://ww1.microchip.com/downloads/en/DeviceDoc/21459E.pdf)

~~~
HeyLaughingBoy
There's also this: [https://store.digilentinc.com/dmm-shield-7-function-
digital-...](https://store.digilentinc.com/dmm-shield-7-function-digital-
multimeter-shield/) from Digilent. Haven't tried it, but it looks interesting.

~~~
ChuckMcM
That is pretty cool, it uses the HY3131 chip ([http://www.hycontek.com/wp-
content/uploads/DS-HY3131_EN.pdf](http://www.hycontek.com/wp-
content/uploads/DS-HY3131_EN.pdf)) and is another example of an entity that
has the resources to design a robust analog front end just using one in a
chip.

FWIW I ordered one to see if I can get it working on one of my many ST Micro
Nucleo boards.

------
cushychicken
For anyone interested in the analog front end design, there's a great chapter
in the _Art of Electronics_ 3rd edition that goes over the design of the
analog front-end of an autoranging Fluke meter.

Pretty sure it's chapter 5.

------
zepolen
This epitomizes the difference between open source and commercial:

\- looks like crap

\- missing a ton of regular expected features

\- has a couple features that you'll find nowhere else

\- you'll spend more time getting it working than using it

But damn is it awesome.

------
joezydeco
This probably the most trivial part of this whole project, but choosing a nice
font for that LCD just makes the whole package look that much more
professional. Beautiful work.

------
ur-whale
If this project actually pulled it off properly (haven't dug deep enough to be
sure), I really like the ability to measure current and voltage
simultaneously: this is the _one_ thing I wish a fluke-level DMM could do.

~~~
fjfaase
The measurement methods for current and voltage are different. Current is
usually measured by inserting a small resitor in the circuit and measure the
voltage over the resitor. You would need at least three cables to measure both
current and voltage simultaneously. And the SMT32 would need to do
(alternating) measurements on two voltage channels.

~~~
magicalhippo
> And the SMT32 would need to do (alternating) measurements on two voltage
> channels.

The STM32 part used in this project has two ADCs that can be triggered
simultaneously, so you can actually do two readings at once.

------
yc-kraln
I am missing a hefty fuse on those inputs. The thing is a deathtrap :(

~~~
dfox
What this thing lacks is overload protection, not fuse (it even has fuse on
the current input).

Placing fuses on voltage and resistance inputs does not make much sense as the
input impedance should be high enough that any sane voltage will not cause any
damage (MCP6072's datsheet does not explicitly state the safe maximum current
through internal clamping diodes, but it is probably safe to assume that it
will be at least 1mA, which works out to 1kV on input), excluding high voltage
transient surges, which is what the Cat ratings are really about and should be
handled by some kind TVS network across the inputs or after the first
attenuator (in which case the series resistor of the attenuator might in fact
behave like a fuse).

The current circuit is somewhat more complex for overload protection. Common
solution involves placing two antiparallel accross the sense resistor such
that the fuse will reliably blow before the sense resistor and following
frontend (neat trick in many HP designs is using shorted diode bridge with the
DC-side short being actively driven by voltage follower. This causes the
diodes to be mostly fully closed outside of failure conditions and thus
minimizes any non-linearities inherent in large power diode).

------
debatem1
I love seeing STM32s in these roles. Such fun and versatile parts.

------
ncmncm
I love this project!

It's great to read about design judgment that takes off in terribly useful
directions the market can't seem to follow.

------
archontes
What a nice project.

------
rambojazz
While this is a wonderful project, it shall be pointed out that this is "open
source" in the stricter meaning of the term.

------
m0zg
No autoranging -> won't survive a week. I know because I have in the past
burned up a few analog multimeters which did not have autoranging.

~~~
Goz3rr
What? Autoranging has absolutely no impact on whether you will damage a
digital multimeter or not. If you select too low of a range it will simply
display overload but not cause any damage on a meter worth it's salt.

Now, if you connected it to something above the specification of the meter or
perhaps tried reading a voltage in ammeter mode, that's user error and
completely your own fault and wouldn't have been prevented by autoranging.

~~~
m0zg
Set the range to 0.1v and try measuring 500v. Then get back to me. Disclaimer:
I'm not responsible for your burned out multimeter.

