Das sprechende Multimeter - Teil 1 - AZ-Delivery

A multiple measuring device that measures voltage, electricity and resistance, perhaps still checks diodes and transistors - some still check L and C - belong to the basic equipment of every workshop, every repair café, it also uses every professional. DMMS are in use millions of times - no doubt.

So what may be the motivation to build this "commodity" yourself instead of it for a few € uro buy - WO should it be benefit? This question answers a brief overview of the technical requirements that have been placed on the TDMM:

Technical data sheet TDMM

-          Voltage measurement DC +/- 0… 85 V, with test tip up to 850 V

-          Electricity measurement DC +/- 0… 5a (option 20a)

-          Performance calculation from U and I

-          Resistance measurement approx. 0 Ω - 0.5 MΩ; Passage

-          All measurements are made at the same time, including the display of the measurement results

-          Expansion to AC voltage measurement Veff and VRMS

-          Announcement of selected measured values ​​by voice output in German (option: English); End individually selectable for each measuring value type (except dperformance)

-          Accuracy 3 ½ places;  +/- 1 LSB

-          Option: Limit value monitoring and limit value message

-          Data output via USB UART, via web (MQTT) and on OLED display

-          Expandable as a remote -controllable laboratory device e.g. for automated measurements

Motivation and use

The idea came about at work in the repair café, which is always exciting, but sometimes a bit stressful. Often you don't have a helper who can read measured values ​​and work with two test peaks in your hands on the defective device while trying to make a measured value read out. If the measuring device could speak, it would be fine. At the moment I could not find a device that speaks measured values.

In addition to the motif "speaking DMM" (= TDMM), it was important to us to develop a compact device that carries out all measurements at the same time. This is useful, for example, if you want to measure voltage and electricity on a test subject without using two measuring devices. If you then learn how much performance is being "fried", it can be quite useful. At the same time, one observes a variable resistance value, For example, a PTC or switch.

The third motif was the integration of the TDMM into an existing network to document measured values, e.g. to save in an SQL database. These functions are useful if you want to monitor a process or to completely automate an attempt.

The structure of this blog series

The project took three months of intensive work and was rebuilt several times. In this way, it is presented for several contributions. The theme schedule looks like this:

1. Contribution (following here):

-          The ad converter ads1115 with its possibilities and its application in the TDMM

-          Measurement of tensions +/- 85V with a preliminary stage, but without an autorange function.

-          Data output on the OLED display

-          Formatted data output via USB

-          Data output for further processing

2. Contribution:

-      Current measurement

-      Performance calculation

-      Calibration of the TDMM for voltage and electricity

-      Resistance measurement and passage tester

3. Occupation:

-      The TDMM learns to speak; What to consider

-      Technology of the DFPlayer

-      Experience with the DFPlayer and information for use

4. Contribution:

-      Measure AC voltages, Veff, VRMS

-      Tensions> 85 V Measure

-      Power supply with Lion battery

5. Contribution:

-      The TDMM on the net

-      Dealing with MQTT

-      Alternatives to bring the measurement data into the network; Examples of this

6. Contribution:

-      Measurement examples with the TDMM

-      Programming of "virtual measuring devices"

The somewhat more extensive opening credits could not be avoided. Let's get in the first part of the project now!

Hardware

For the 1st part of the projectS the following components are required:

Measurements with the 16 bit analog/digital converter ADS1115

We take a closer look at the ADS 1115, because we still have a lot to do with it.

The ADS1115 offers:

-    4 inputs A0… A3 for analog signals that in the range of 0 ...  VDD be measured.

-      Negative tensions can be done with the "single -ended" inputs A0 - A3 not be processed. At these inputs Vhe ends up at most -0, 3 V (see data sheet).

-      However, two inputs for a so -called difference can be combined. With a special input circuit that we calculated and tested for the TDMM, we can easily measure positive and negative tensions with a operating voltage of 3.3V (the ADS115 can also be 5V).

-      The ADS1115 has a built -in PGA ("Programmable Gain Amplifier"), which reinforces the input signal and falsifies a maximum of 0.01%. This is an excellent value. We only use the PGA here with "Gain 0", because due to the entrance level we do not need a auto-function that switches measuring areas! This is an advantage over classic technology, because we save ourselves a classic weak point and a lot of work. Nevertheless, we reliably get an accuracy of 3½ areas +/- 1 LSB.

-      When measuring resistance, we use all options of the measuring amplifier and thus get very precise measurement results in another area without us VIEL effort beto drive must. Without a doubt a very big advantage of the PGA compared to simpler ADCs.

-      A precise source of reference is integrated on the chip. This is also important for the accuracy.

The converter's readable data sheet comprises 53 pages: ADS1115 Details See also the AZ documentary for the Breakout Board with lots of useful information: AZ-Info to the ADS1115

The input stage for +/- voltage measurement

This assembly receives your input signal via a socket for the button head (shown here) or via two classic 4mm sockets for banana plugs. The prototype has both connections. There is a resistance of 1mΩ behind each M. For this I use the resistances from the AZ resistance range, because they are metal-layer resistances of the accuracy class 1%.  That is very neat. We later compensate for small differences in the chapter "Calibration".

Let's take a closer look at the circuit. The 1 MΩ input resistors R1, R2 are connected to 47 kΩ R3, R4. Both 47 kΩ resistors lie with a connection at the output of an operating amplifier MCP601 (alternatively ½ MCP602). We immediately clarify why this is so.

We see that the connections A0 and A1 of the ADS1115 are their input signal over the two voltage parts 1Cover mΩ / 47kΩ. The input voltage weD thus divided in a ratio of 21.27: 1. Of course, this is only the case if the connection 6 of the operating amplifier represents a mass connection. And maybe you don't see that immediately.

The MCP601 is switched as a buffer with a reinforcement of 1. With this you can get an output with an impedance on connection 6 0 expect. WhichS Signal drives this buffer? You can see that when you look at the non-inverting input 3. A voltage divider with R5, R6 apparently provides him with exactly half the operating voltage 3.3v/2 = 1.65 V. Now it becomes clear what this circuit is used for. The resistance network is exactly "in the middle" of the measuring range compared to the operating voltage. The zero point of the circuit "hovers" at half the operating voltage and thus delivers a virtual mass.  There is also one hereE potential Weak point: The supply voltage must be "clean" and stable. Tantal-support on the power supply may be necessary.

This circuit meets several requirements:

-      The input of the ADS1115 is quite good before overvoltages protected. Wouldn A0 / A1 used directly - without a preliminary stage -  In order to measure tensions up to 3 V, for example, every “accident” can be an unpleasant consequence for the convertern have. The Preliminary stage offers good protection for these cases.

-      Any polarity measurements are possible. Here again as a reminder: In the "Single Ended" company, negative tensions are only permitted up to -0.3 V.

-     We receive an input with high impedance. Specifically, these are 2x (1mΩ + 47 kΩ), so almost exactly 2.1 MΩ. At the same time, the converter is impedance, which is 22mΩ in the "Gain (0)" setting. That falsifies the messunG minimal, but We calibrate the device. You can measure the input resistance at the inputs with a digital multimeter and as a result, as expected, receive exactly this 2.1 MΩ.

- With a high input impedance, a measuring device is much more sensitive to the ubiquitous humming and interference signals than with low impedance. However, this only applies to "single-ended" measurements, i.e. with a pole to mass and the measuring line, e.g. on A0. Due to the difference measurement, we almost completely eliminate this problem.  The ADS1115 has a CMR (Common Mode Rejection) of 100 dB, i.e. onen FActor 1: 100000. This means that it almost completely suppresses interference signals that achieve both measuring lines. That is the idea of ​​the differential amplifier. With this input stage, the basic problem is solved, good measurement results are almost guaranteed.

Without wanting to ward off: try SYou can do how far you can drive the sensitivity and measurement accuracy of the ADS1115 if you use the PGA with a different gain setting. Attention: Each setting changes the measuring range and impedance. But the gimmick is worth it. You can find good explanations and examples in the Library for ads1115.

View of the Breadboard part 1 of our project

You recognize the voltage divider with its resistors and the operating amplifier. It is worth it, first onel this part build up, for theal The I2C wiring is pretty simple.

After switching on, first measure the voltage to PIN 6 of the MCP601. It should be half the operating voltage: 1.65 V. Es Ist Important that She the Measure and monitor 3.3 V of the operating voltage. We always need them later, e.g. for resistance measurement.

The sketch

Our first sketch is very easy. He should familiarize us with the concept of the entrance level and represent the result of a voltage measurement on the OLED display.

// TDMM - The Talking Digital Multimeter - 
// Michael Klein 2024 - Made for AZ Delivery Blog
//  
// Thanks to: rob.tillaart for https://github.com/RobTillaart/ADS1X15

#include <Ads1x15.h>
#include <U8G2Lib.h>

// Setup OLED display
U8g2_sh1106_128x64_noname_f_hw_i2c U8G2(U8G2_R0, /* reset =*/U8x8_pin_none); u8g2_uint_t offset;
u8g2_uint_t Width;
const char *text = "-TDMM-";
int16_t VAL_00 =0; int16_t VAL_01 =0;

Ads1115 Ads(0x48);

void set up() {
  Serial.Begin(19200);
  Serial.print(__File__);
  Serial.print("Ads1x15_lib_version:"); Serial.print(Ads1x15_lib_version);
  
  Ads.Begin();

  IF (!Ads.Begin()) {
        Serial.print("Address ads1115 or 0x48 not found");
      }
      IF (!Ads.Isconnected()) {
        Serial.print("Address 0x48 not found");  
      }
  Serial.print("AD1115 is Properly Connected.");
  
  Ads.setgain(0);

  U8G2.Begin();
  U8G2.set font(u8g2_font_ncenb14_tr);
  U8G2.setcursor(20, 20);
  U8G2.print(text);
  U8G2.buffle();
  delay(3500); // Show start screen
}

void loop() {
  VAL_01=0;
  for (intimately X=0; X<10; X++){
    VAL_00 = Ads.readadc_Differential_0_1();  
    VAL_01=VAL_01+VAL_00;
    delay(2); // Delay 2ms
  }
  VAL_01=VAL_01/10; // Mean Value
  float volts_01 = Ads.tovoltage(VAL_01)*22.74; // multiplier 
  String voltsstring = String(volts_01);
  Serial.print("U:"); Serial.print(voltsstring); Serial.print("Volt");

  U8G2.clear buffer();
  U8G2.set font(u8g2_font_ncenb12_tf);
  // display measured value on display
  U8G2.setcursor(0, 20);
  U8G2.print("U =");U8G2.print(voltsstring);U8G2.print("Volt");

  U8G2.buffle();

  delay(2000);
}

The sketch can also be loaded from the repository:
https://github.com/michael5411/TDMM_talking_digital_multimeter 

At the beginning we tie the library for the ADS1115 and the OLED display. Then the default settings for DAs Oled-Display set up. The associated library covers many similar displays. Anyone who deals with the library will know a lot of setting options and skills of this versatile displayNLserve. In addition, many font sets of all kinds.

After we have set a few variables, we form an instance "ads" with the ADS1115 on its standard I2C address and go toM setup () over.

Ads.begin ( ) Starts the ADC, which will be tested in the next lines. If the I2C connection is successful, it reports this via the serial connection, even if it has not been possible.

The subsequent attitude Ads.setgain (0) can also be omitted. I inserted them to facilitate experiments with the PGA. After the gain set, a read is needed before the setting can be effective. Changed The resolution in the entire measuring range and the measuring range becomes more precise, ABEr kLeiner. The ADS1x15 library Doku also offers good explanations for this.

The following lines apply to the OLED display and show a possibility of many to design the start screen.

Each loop passage takes place, the mean of which is formed from 10 measurements. The measurement process starts in the loop (  ) with that the variable VAL_01 on 0 is set.

Then the tension measurement through the query of the measurement result begins in the following loop VAL_00 = ads.reeadadc_ Differential_0_1 ();   There is nothing more to do to get the raw value. VAL_00 is an integer value. The loop runs 10 times during the measured value in VAL_01 Together and divided by 10 at the end.

The 2MS-Delay supports the "Single Shot" mode and avoids "Glitches", which can otherwise be seen on the scope. With this measurement method we get precise, stable measured values.

VAL_01 is our integer value, as it is delivered by ADS1115. The comfortable function Ads.tovoltage (val_01) calculated from the integeR-WErt of VAL_01 in the float format the voltage value and after multiplication with 22.74 transfers to the final result variable volts_01.

The 22.74 results from the voltage divider 1 MΩ/ 47 kΩ (1000000: 47000 = 21.276). The theoretical value differs from 22.74 because 22.74 already our is calibrated. With this value, all errors of the input voltage divider, a perhaps not entirely perfect setting of the 3.3 are Volt etc., kompensed.

This value will be a little different for every practically realized TDMM. If you already want, you can calculate your personal "perfect factor". Otherwise we devote ourselves in part 2 of the calibration.

Edition on the OLED display

The following edition on the OLED display begins with one Clear buffer () Instruction. The logic of the OLED requires that the respective content of the display buffer are shown. The buffer is first deleted, then re -described.

Around the Measurement data to present, verLet's turn a slightly smaller step type with 12 pt. We put the cursor on the position (0.20) and can then be commanded u8g2.print (…) hand over our measured value. The instruction U8G2.Sendbuffer ()  ends this cycle.

We use a fraction of the possibilities that the display offers. It is fun to look at the library and some of the endless many examples.

Outlook and other posts

We have oneen Easy introduction to build a small measuring device with little effort. So far it has only revealed a small part of its charm.

In the next blog post we measure the electricity by a consumer, whereby voltage and current measurement completely independent from each other are. The measurementen are completely "earth -free" among themselves. Such a measurement is not possible with a classic DVM. We can in the same circuit, or in two completely different circuits, measure without any problems.

At the same time we will be the performance p = u * I calculate and display.

So that our measurement results are as perfect as possible, we will later compare you with a very high -quality laboratory device and check whether our TDMM works cleanly. Whether, for example, the displayed intervals always remain the same with the same tension differences. Measurement accuracy is the other size that interests us alongside linearity.

As the next measurement size, we are interested in the resistance and the selection of a suitable method to measure it. It sounds easy at first. But it is not. We learn outh Why.

This article will certainly contain a lot of new things again and some surprises.

Until then

Your Michael Klein

DisplaysEsp-8266Projekte für anfänger

4 commentaires

Jörg

Jörg

Dann schau mal bei reichelt.de
Grüße Jörg

Norbert Schrills

Norbert Schrills

Hallo Rene,
siehe https://www.ebay.de/itm/234542360484
4 X MPC 601 für 7,20 €

Michael Klein

Michael Klein

Hallo Rene,

wenn Sie zeitnah bei eBAY mit dem Suchbegriff „MCP601“ suchen, finden Sie gerade ein Angebot für 4 Stück zum Preis von 7,20 € / Gratislieferung als DIL-Bausteine.

Tatsächlich tut fast jeder simple OpAmp den gewünschten Dienst: Halbe Spannung / niedrigste Impedanz. Den TL074 hatte ich schon dafür erprobt, auch den OPA2227 / 2228.

Also eine sehr gute Frage – danke, ich hätte gleich dran denken sollen :-)

Herzliche Grüße
Michael Klein

Rene

Rene

Das gefällt mir. Gibt es eine Alternative zum OPV MPC601? Den gibt es aktuell nur zu sehr hohen Transportkosten bei Mouser oder Arrow.

Laisser un commentaire

Tous les commentaires sont modérés avant d'être publiés

Articles de blog recommandés

  1. ESP32 jetzt über den Boardverwalter installieren - AZ-Delivery
  2. Internet-Radio mit dem ESP32 - UPDATE - AZ-Delivery
  3. Arduino IDE - Programmieren für Einsteiger - Teil 1 - AZ-Delivery
  4. ESP32 - das Multitalent - AZ-Delivery