thank you, but I am still not able to read out or to set the cal current
M5Stack support doesn`t answer my mails... and it seems that there is nobody from the company around here, I think I will change to another board with better support
Posts made by obstbauer
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Modules
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Moduleschange to a raspberry PI4 seems to be no solution too..... 
 it woud be nice if there would be a better documentation for people who want to use the units outside the m5stack universum....
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in ModulesI see really strange behaviour and I don't know the reason and I get no answers from the support..... 
 The example code from M5Stack say that the currentvalue should be divided by 100:canvas.printf("Current:%.2fmA", (float)(meter.getCurrentValue(0)) / 100.0);The values I get I have to divide by 10 to get the right current in mA.... and the other issue is that I can only use half of the measurement range, at 12.5 mA the ADC sends 65520... maybe someone has an idea ? 
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Modules@robski yes maybe in uiflow2 but the function for the c program asks for an index and a value 
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Modules@robski what value do you take for "index" in the function void MODULE_4_20MA::setCalCurrent(uint8_t index, uint16_t value)
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Modules@robski thanks for the answer so you mean if I measure with multimter 4.0 mA (which is true for the sensor) and the unit shows me 7.2 mA I should set the calibrated value to 4.0 ? Because this is not mentioned anywhere in a readme file or manual or in the description of the device, and it is not made in the example file at github 
 but I am a beginner....
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Modulesit seems that I still have a problem.... 
 I have a current reading but the value is wrong,
 I get soemthing around 7.2 mA instead of 4 mA.
 I can measure the 4 mA with a multimeter in the circuit and the sensor should send 4 mA, so this is ok, but the M5Stack unit shows 7.2 mA and I don't understand why ? Any ideas ?
 My sensor is passive, I connected 24 V to the 4-20mA unit and all three jumpers are installed
 What is the meaning of the function "getCalCurrent" ? It is neessary for the current measurement ? It is necessary to set a "ref current" ?Thank you! 
- 
    RE: 4-20 mA Unit with wemos S2 mini ESP32posted in Modules@felmue Hello, 
 thank you very much, it works !
 I addedcr.begin(&Wire, MODULE_4_20MA_ADDR, 33, 18, 100000UL);to void setup 
- 
    4-20 mA Unit with wemos S2 mini ESP32posted in ModulesHello, 
 I want to use the 4-20 mA unit with a wemos S2 mini with ESP32 chip but I am not able to get some data from it.
 I had a look at the github examples and made a program to show the current on a display. Display is working and I can find the unit with an i2c scanner.
 Arduino gives no mistakes during compiling but it doesn`t work. Any ideas ?
 Thank youHere is my code: #include <Wire.h> #include <Arduino.h> #include <U8g2lib.h> #include "MODULE_4_20MA.h" U8G2_SSD1309_128X64_NONAME2_F_HW_I2C u8g2(U8G2_R0,U8X8_PIN_NONE); const byte led_gpio = 15; // LED GPIO 15 MODULE_4_20MA cr; void setup() { Wire.begin(33, 18); // SDA pin 33, SCL pin 18 u8g2.begin(); pinMode(led_gpio, OUTPUT); } void loop() { float current = cr.getCurrentValue(0); u8g2.firstPage(); do { u8g2.setFont(u8g2_font_ncenB10_tr); u8g2.drawStr(0,20,"Strom:"); u8g2.setCursor(0, 40); u8g2.print(current); } while ( u8g2.nextPage() ); digitalWrite(led_gpio, HIGH); delay(1000); digitalWrite(led_gpio, LOW); delay(1000); }
