I am trying to read data from a DDS238-1 ZN energy meter using an ESP8266 microcontroller. To communicate with the energy meter, I have connected it to the ESP8266 through a TTL to RS485 module. I am using the SoftwareSerial library to communicate with the energy meter.
The issue I am facing is that when I try to read data from the energy meter, I am getting zero values for voltage, current, and other parameters. However, I have another DDS238-1 ZN energy meter that is working well, and I can successfully read data from it using the same setup.
I have tried using the dds238.h library, but it also gives me zero values. To debug the issue, I have checked the wiring, the baud rate (which is set to 9600 bps), and the Modbus address of the energy meter, but everything seems to be correct.
AFAIK the energy meter doesnt produce Serial data - just pulses.
All you need to do is connect the meter pulse to the digital input pin (set as input pullup) and count the pulses.
My own system the energy meter doesnt produce a pulse output, so I count flashes using a photodiode and transistor; but the transistor just pulls the data pin low momentarily, just as a passive pulse output would.
Thank you for your response.
Actually i have previously installed dds238-1 ZN module at my home and i am getting data through RS485 communication, I had purchased that module from ali express , i have recently purchased two more module from taobao Taobao link the same model. But this time the same confiuration, same code and same circuit connection are not working.
If everything is the same except the dds238-1 ZN module, I would suspect the module. If this however is a different setup with another ESP8266, another RS485 converter and another dds238-1 ZN module (and maybe a different breadboard?) you have changed 3 (or 4) variables in your hardware; each of them can be faulty or the wiring can be faulty (measure it (e.g. bad contact).
i have tested using multimeter, all connections are proper as i have given in circuit diagram, is there anyway i can get modbus addresses of DDS238-1 zn?
I was a bit confused because you have not provided a link for this module.
Have you read this: Description
The meter is designed to measure single phase two wire AC active energy and suitable for users of secondary circuits with flat rate tariff or single phase electric equipment with narrow interior space. It is produced by SMT (Surface mounting technology) process and is in accordance with international standard IEC62053-21. RS-485 data communication terminal is available upon request to perform remote data collection.
Features
By pressing the button, display with backlighting available
Active energy is measured bi-directionally and total, forward and reverse electricity can be showed.
Interval electric quantity display and reset mode available
Realtime current, voltage, active power, reactive power, power factors and frequency measurement and display.
Remote meter reading is available through RS485 communication interface. The baud rate of data communication is 1200bps~9600bps, conform to MODBUS-RTU.
Passive pulse output, conform to DIN43864 standard