How to measure 4-20mA signal (PT100, Pressure Transmitter) with microcontroller ( ESP32 |Arduino).
How to measure temperature using ESP32 (or Arduino) and RTD temperature sensor.
How to measure pressure using ESP32 (or Arduino) and pressure transmitter.
How to code the signal value (4~20mA) of PT100 and pressure transmitter to ESP32 (or Arduino).|4-20 mA signal measurement with Micro Controller.
Mathematical formula used when converting 4~20mA output signal to pressure or temperature value.
How to code 4~20mA output signal as pressure or temperature value.
00:00:00 materials
00:01:18 I will show you one more with different product specifications.
00:01:38 Arduino IDE is available, and libraries and examples are also shared.
00:01:49 The operating voltage is 3.3v. It is different from Arduino.
00:02:01 Shunt resistance requires 165 ohms. A tolerance of 0.1% or higher is recommended.
00:02:53 Here is the program code written.
00:03:00 The code is very simple and easy.
00:03:07 The important thing is to know how the sensor works.
00:03:18 Before looking at the code, let's take a quick look at "PT100 temperature output process".
00:03:51 The progress is made sequentially as indicated by the arrows.
00:04:11 The first thing to look at is the pt100 temperature sensor.
00:04:25 The resistance of PT100 increases almost in direct proportion, as the temperature changes from -200℃ to 850℃.
00:04:48 As you can see, the graph is almost a perfect straight line.
00:05:18 And the standard IEC 60751 is specified as follows.
00:06:19 The second thing to look at is the Transmitter.
00:06:36 Transmitter is manufactured by determining the scope of use by the maker.
00:06:53 Check the product label and purchase according to your needs.
00:07:08 The transmitter corrects the collected signal, linearizes it, and outputs it as an analog signal.
00:08:05 The third step is shunt resistor installation.
00:08:11 The Arduino (Uno) uses 250Ω and the ESP32 uses 165Ω.
00:08:25 When voltage signals are used for long-distance signal transmission, problems such as voltage drop and noise occur.
00:09:11 The fourth step is MCU internal operation, ADC process.
00:09:17 The input analog DC value is converted into one of 4095(4096ea) steps of digital resolution.
00:09:57 This is the last step.
00:10:05 Code the part checked in red by applying the interpolation formula.
00:10:26 The linear interpolation formula for calculating the X value is:
00:11:13 Now let's take a quick look at the program.
00:15:10 The esp32 development board has different pin maps for each manufacturer.
00:15:20 Please use the analog pin you want.
00:15:47 Connect the ESP32 to the PC using a USB cable.
00:15:58 Compile and upload the code written in Arduino IDE.
00:16:40 A problem has occurred.
00:16:56 Oops! Transmitter power is not turned on.
00:17:40 The changing temperature value is coming up well.
00:17:59 I will heat it with a lighter so that I can clearly see the temperature change.
00:18:33 Next, we will measure the pressure by connecting a pressure sensor.
00:18:41 Since the basic code is the same, you only need to change the variable name.
00:22:19 At atmospheric pressure, 0 bar, that is, the ADC value is 819, so it is normal considering the tolerance..
00:22:38 Oops!! Rising higher than 819, but showing -OVER.
00:23:00 Found the error part.
00:23:24 Compiling and uploading again.
00:24:17 It's working fine now.
00:24:46 Let's gradually increase the pressure.
00:25:20 This video ends here.
Ещё видео!