Close
0%
0%

STM32 Open Source Multimeter

A multimeter, based on the STM32F103, which can measure voltage, current and power, both bipolar and in DC and true RMS.

Similar projects worth following
In short, I needed more multimeters at my lab. You can get these cheap Chinese "multimeters" from Ebay, but I don't trust them at all and they lack some of the features I want (PC connectivity, RMS, power measurement, electronic range switch, capacity measurement, ...). So I wondered, what can I achieve with circa 10 dollars worth of parts?Well, turns out the STM32F1 is pretty powerful and I managed to cram all of the above functions into this little thing! And as a little bonus, it pretty accurate (for a day-to-day prototyping at least, it's not a 200 dollar Fluke).For the impatient - watch the video on YT (https://www.youtube.com/watch?v=ohOqSMUoqBM).

Version 1.2B released

So, after a few revisions I decided to publish this project. Now I am not going to describe how everything works and all of the details, if you are interested in that, read the article on the project homepage. Here, I want more to summarize what it can do in short (more in-depth description on the project homepage) 

So, what does it do? It has six modes:

  1. Voltage mode - measures voltage with two ranges, ±6 V and ±60 V. Ranges are switched electronically, there's a hold function (to freeze the display) and you can select between DC (or average) mode and RMS (bandwidth about 3 - 10 kHz).
  2. Current mode - basically the same as voltage, ranges are ±60 mA and ±500 mA, again switched electronically, again with DC/RMS.
  3. Power mode - yep, it can do both voltage & current at the same time, so I wondered, why not make a power mode? This comes in really handy when working with power supplies (or, just today, I used it for testing a bunch of small solar panels). All 4 combinations of ranges are possible, and you can again do RMS or DC.
  4. Continuity screen - basically it tests resistance and if it's below 50 Ohm, it sounds the buzzer.
  5. Component test - this can measure resistors, capacitors and diodes (so far). Basically I use it mostly for sorting parts after prototyping or when I need to clean a pile of parts (then it comes really handy).
  6. About screen - well, it tells you the name of this project.

Furthermore, some other features:

  • fully isolated USB interface (capable of both receiving commands and transmitting data)
  • powered by li-ion (protection & charging included) or anything with a voltage of 3.2 to 5.5 volts
  • measures battery voltage and signalizes low battery
  • RTC & memory, so it remembers the mode you last used
  • voltage & current inputs protected against overrange

What it does not do:

  • it does not measure mains, nor is it meant to; I rarely use mains, so I don't need this function, and because of safety I did not even try to implement it

What it could do in the future:

  • frequency measurement (it's just a matter of writing the software for it)
  • additional voltage range (± 60 mV), coming in rev. 1.3, hopefully
  • and some other fancy stuff, it's described more in detail on the project's homepage

Frankly, I originally build this just for myself, but after seeing the results, I decided to publish it. Yeah and it also took a lot of time, so I thought it would be a pity to keep it to myself. Here's , for example, accuracy on the ±6 V range:

Note: some of the resistors during this measurement were 1 % ones, because I ordered wrong 0.1 % ones. 

But still, I'd say this is pretty good for something this cheap- for most of the range, we are well below 1 %, which is more than enough for prototyping and/or general lab work.

Do you find it interesting? It's open source, and everything is on GitHub. Some more info is (and more will be coming) on the project homepage at embedblog.eu/dmm. Currently I have PCBs of version 1.3 ordered, it will take some time for them to arrive, but I'll post an update once they do.

Also I'd love to hear your experience/opinions/questions, so feel free to comment.

  • More info about revision 1.4

    Martin08/10/2019 at 12:17 0 comments

    I've written a short blog post about some of the caveats I've stumbled upon when developing revision 1.4, and there's also some more info about revision 1.5. See here, if you are interested.

  • Revision 1.4 status update

    Martin08/04/2019 at 08:41 0 comments

    Well, as usual, I've spent much more time than I anticipated or wanted on the revision 1.4. So in this log I'd like to show where I got in the last two weeks, because rev 1.4 is still not finished.

    If you've been following this project for at least a little while, you know that I switched the microcontroller from STM32F103 to STM32F373, because the latter is optimized for mixed signal processing and has much better ADCs. This new sigma-delta ADC is what prolonged the development so much - it is actually not easy to use it at all, there is very little documentation available and honestly, some of the claims made by ST are just wrong. But yesterday I finally managed to get acceptable results:

    And I think those are more than acceptable results - the orange lines are 0,1 % tolerance. In other words, on the ±6 V range, the largest error we got was 1.6 mV. This almost makes it a true 6000 count meter, since this corresponds to the least significant digit. With this new ADC, we also have better resolution (16 bits), true differential inputs, dedicated REF pin and higher bandwidth (50 ksps).

    And now is the time for bad news: this ADC needs calibration (albeit very simple one). This is generally true for most sigma-delta based converters, even though I was hoping I'll be able to avoid it. But the results are unusable without it. It is however true that most commercial multimeters are calibrated (since most of them use sigma-delta ADCs) and also the calibration is very simple - you just measure ADC values at the top positive and top negative value and input this into a special excel spreadsheet I made.

    Another bad new is that this version won't be final - I made a few silly mistakes (as you can see from the photos) and the hardware will need to be modified a little.

    And lastly, two photos from development:

    The new case I designed - I'd say this looks 100 % better than the old one.

  • Rev 1.4 PCBs arrived!

    Martin07/24/2019 at 17:40 0 comments

    Finally, I received the long-awaited PCBs for revision 1.4 of the multimeter. I have high expectations from this version, so we'll see. I think I might have some preliminary results to share with you within a week - I started populating the PCBs immediately as you can see from the photos, so I hope to have it finished ASAP.

    The PCB is totally redesigned to accommodate the new STM32F373CCT6 microcontroller. While drawing out the PCB, I also thought in advance about the 3D printed enclosure, so I hope that this version's enclosure will look much better. I also got rid of the ungly "button board" and instead used 12 mm SMD switches, onto which you can glue 3D printed risers.

    On a different note, I finally decided to stay with Keil uVision as the projects toolchain. I spent about ten days trying out different IDEs and compilers, as I want to make this as open-source as possible. However, none of the IDE's I tried fulfilled my expectations, there was always sometimes missing. So I'll stick with Keil and try to fit the code into the 32 KB size limit of the free version.

    Stay tuned for the results!

  • Rev 1.3 voltage accuracy

    Martin06/25/2019 at 20:30 0 comments

    Today, after a long wait, the PCBs and components for the revision finally arrived. I managed to find some time to populate the boards and now I am bringing you the results of the voltage accuracy test.

    Now in the last project log I said this revision should have three voltage ranges - ±60 V, ±6 V and ±600 mV. To be honest, I kind of lied, because it has four voltage ranges, the three mentioned above and a ±60 mV one! I just wasn't sure how well will it perform, but according to my tests, it is totally usable. The only downside of this new AFE is that the lower ranges (especially the ±600 mV one) need to be calibrated with a simple offset. I'll try to remove the need for calibration in future revisions.

    But enough talking, let's see the results:

    The blue curve is the absolute error in volts, the orange curves are the maximal error margins for ±0,3 %, which is my target accuracy for this revision. Just for reference, ±0,3 % is the accuracy of the Brymen 805s, which is a 53 euro DMM! Now let's see a closeup of the sub one volt part:

    I'd say this isn't bad at all.

    And just to keep everybody informed - I hope that tomorrow I'll do tests with the new current stage and then I'll release the source. However, that will end the development of this revision and I will move onto 1.4, because this revision was intended mostly as a test for the new analog front end. Revision 1.4 will include this new AFE along with a much better processor - the SMT32F373, which offers a 16-bit delta-sigma ADC with differential inputs and external reference. This should vastly improve the accuracy, I am hoping for at least 0,1 %.

  • Rev 1.3 PCBs on the way!

    Martin06/06/2019 at 20:42 0 comments

    So, I have my batch of PCBs for rev 1.3 ordered and on the way. It will still take some time for them to arrive and for me to populate and test them, but just as a quick summary, here's what I am hoping to achieve with this revision:

    • ±600 mV range (so now there will be three voltage ranges)
    • much improved current sensing circuitry with lower sense resistances and ranges of ±2.5 A and ±300 mA
    • frequency compensated dividers for voltage sensing
    • the ON-OFF switch is now just a SPDT, because the DPDT version was hard to get
    • general layout improvements and little changes

    Also, the software still needs a lot of work, so I would like to polish it a little bit more, add autoranging, make the software remember the range you last used in given mode and also implement proper UART/USB control (so it can be fully controlled from a PC using the isolated USB interface).

View all 5 project logs

Enjoy this project?

Share

Discussions

mark.perrin1 wrote 08/12/2019 at 09:52 point

Martin, Take a look at my review of the STM32L152 based DMM.  I believe its unusual to use this MCU inside a DMM.  I wonder if the software can be pulled.  Hope you find it interesting.  Please let me know your thoughts, I've ordered an ST link to see what success i have with the com port.  https://youtu.be/xRkMdbNCBWo

  Are you sure? yes | no

George Troulis wrote 08/09/2019 at 05:48 point

Martin this is awesome, I'm using this as inspiration for my own multimeter project! I have a few questions regarding some design choices you made, looking at the schematics on the GitHub for Rev 1.2b:

1) Why did you power the STM32 with 2.5V instead of the "standard" 3.3V? Is that to make the reference voltages for the op-amps easier to work with?

2) Why did you choose to isolate the TX/RX pins from the UART/USB converter? I've never seen this UART isolation anywhere else (I've seen it for Ethernet and other things though)

3) You connected the COM banana plug to 1.25V (Sheet 2). Say you're powering your multimeter  by USB, and you're trying to measure stuff on an Arduino which is also powered by USB, making both Arduino and Multimeter share the same ground. If you connect the COM plug to the Arduino's GND pin, won't that be shorting 1.25V to ground?

4) In Sheet 3, you have a note about choosing the "charging current resistor," which you labeled R3 in the note. Did you mean to label it R13 instead?

I'm a young engineer and these insights will help me with future projects. Thank you in advance and keep up the awesome work :D

  Are you sure? yes | no

Martin wrote 08/09/2019 at 06:55 point

Hi, regarding your questions:

1) when you power the IC with 2.5 V, it will also be the top of the ADC's range (since there is no dedicated AREF pin), and this is exactly twice the reference's voltage (the reference is 1.25 V). This means we will have symmetrical bipolar input, for example ±6 V. If you used 3.3 V as power for the STM32, you'd need 1.65 V reference, which I do not think exists... Or the input range won't be symmetrical.

2) see below

3) this is exactly why TX/RX is isolated. You are not supposed to power the multimeter from USB, that's job of the battery. Normally, with SW1 open, ground and power of USB is disconnected and only the isolated serial connection works. This is the "measurement mode". Then, if you need to charge the battery, you stop making measurements and close SW1. This connects USB power to the TP4056 charging IC and it charges the battery. And yes, during charging, connecting COM and ground from for example Arduino will short it (but there is OC protection, so it should not harm it).

4) you are correct - I meant R13. I copied this part from a different project of mine and forgot to change the resistor's name :) 

I hope this helps, feel free to ask further and I hope that you project is successful!

  Are you sure? yes | no

George Troulis wrote 08/09/2019 at 10:11 point

Thank you Martin, wow you replied quick. I certainly will have many more questions coming up, I appreciate you sharing your insights :D

I looked at the schematic more carefully for (3) and realized that you did actually isolate the grounds, brilliant ;D

Also I've been browsing your V1.3 schematics on GitHub, and it seems like sch3.png is a duplicate of sch2.png :O I like the improved voltage/current measuring circuitry on V1.3 more so I might draw upon that for inspiration ^_^ thanks again!

  Are you sure? yes | no

Martin wrote 08/10/2019 at 12:21 point

For some reason I cannot directly reply to your comment below, so I'll write it here. You are correct about the Git error, dumb me must have incorrectly renamed files - I'll fix that with the next update.

Also regarding the voltage/current sensing circuitry, I've updated it even more - see my blog post.

Otherwise, as I said, feel free to ask and I'll try to reply ASAP.

  Are you sure? yes | no

sunny wrote 07/25/2019 at 01:02 point

nice job

  Are you sure? yes | no

dambusio wrote 06/20/2019 at 21:01 point

I have 1 question - project is in "C++" - but without cpp features like class etc, why? (or I miss something?)

  Are you sure? yes | no

K.C. Lee wrote 06/06/2019 at 11:06 point

You should consider having an opening to only show the displayable area for the LCD.  The LCD would look a lot more professional with about 1-2 mm left and right side covered as it blocks out the 4 distracting side-lite LEDs.  That and some counter sink or Allen stainless steel or black screws.

  Are you sure? yes | no

Martin wrote 06/06/2019 at 20:28 point

Well, you're right. This is the first revision for which I made a 3D printed case, so there are things which need to be smoothed - I agree with the screws, also I need some better way of putting stickers on it - these don't look good; regarding the LCD I am kind of thinking about switching to a larger screen, so that might change totally.

  Are you sure? yes | no

Dacon Jung wrote 06/06/2019 at 05:37 point

May I purchase the rev 1.3 with all hardware and case assembled and together the firmware flashed?

  Are you sure? yes | no

Martin wrote 06/06/2019 at 20:24 point

Hi, thanks for the interest, but as of now I am not selling these finished (or as a kit). The reason is simple - I want to spend the time available to me for developing new features and/or revisions. This might change in the future, if I feel the project is finished and there is no more work to be done.

  Are you sure? yes | no

hulkhawk wrote 06/05/2019 at 16:10 point

Really cool project, can't wait to see more!

  Are you sure? yes | no

Martin wrote 06/05/2019 at 18:04 point

Thanks, I already have rev 1.3 PCBs ordered, so there will surely be more functions and improvements...

  Are you sure? yes | no

Elliot Williams wrote 06/05/2019 at 12:13 point

This is rad! Have you considered submitting it to the Hackaday Prize?

  Are you sure? yes | no

Martin wrote 06/05/2019 at 18:03 point

Thanks! I originally thought that the Prize entries must be before June 1st, but now I read  the document again and I was wrong, that applies to the early stage. So I just submitted this to the Prize!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates