Тёмный

ESP8266 Modbus RTU communication with Energy meter EM6400NG 

Techno Automation
Подписаться 696
Просмотров 28 тыс.
50% 1

In this tutorial I have shown how we can connect ESP8266 using MAX485 to TTL or MAX232 converter.
Protocol :- Modbus RTU.
For demonstration Schnieder make EM6400NG energy meter is used.
Example code :- github.com/ashish8284/ESP8266...
GoodweDT /Mt inverter Integration Code:- github.com/ashish8284/ESP8266...
All customization can change in settings.h file. I.e WiFi credentials, Mqtt server credentials, Mqtt payload topic etc.(for adafruit.io connectivity, efer below mentioned repo. as this feature implemented in that.)
Growatt Inverter integration Code:-
github.com/ashish8284/ESP8266...
Feture:- webpage for local monitoring, OTA enabled, Adafruit.io connectivity.
Hardware :-
MAX485 To TTL converter
MAX232 To TTL converter
ESP8266 wemosD1Mini
Modbus Library :- github.com/emelianov/modbus-e...
this library work with ESP8266 & ESP32 both chip.
Credit :- Special thanks to creator of this library :- Alexander Emelianov

Наука

Опубликовано:

 

16 апр 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 135   
@vaishakhmonti
@vaishakhmonti Год назад
This is a great tutorial. Very well done and the clear explanation about The voltage levels for different electrical standards was spot on. Cheers my friend. Well done!
@TechnoAutomation
@TechnoAutomation Год назад
Thanks
@TechnoAutomation
@TechnoAutomation 7 месяцев назад
Actually I didn't get enough time to make content due to my job. I wish to make another video on top of this for displaying data on webpage and forwarding data to mqtt . I hope I will get enough time to make it.
@sanjaybhatikar
@sanjaybhatikar Год назад
Very nicely explained, good job dude!
@TechnoAutomation
@TechnoAutomation Год назад
Thanks
@nozynoz
@nozynoz Год назад
Cheers, very well explained, great job.
@TechnoAutomation
@TechnoAutomation Год назад
Thanks
@tusharpatel289
@tusharpatel289 3 года назад
Nice video Ashish... Keep it up...
@vedanshi_61010
@vedanshi_61010 2 года назад
Great tutorial. Thank
@santoshkumar4402
@santoshkumar4402 Год назад
Thish is great knowlage now so thank u sir
@romitmisra1
@romitmisra1 2 года назад
Just excellent....
@TechnoAutomation
@TechnoAutomation 2 года назад
Thanks 👍
@Fibar2Hbar
@Fibar2Hbar 2 года назад
Good job!!!
@TechnoAutomation
@TechnoAutomation 2 года назад
Thanks for compliment.
@sajibkarmaker5244
@sajibkarmaker5244 Год назад
Nicely explained
@TechnoAutomation
@TechnoAutomation Год назад
Thanks. I am planning to make a video of reading multiple addresses from multiple slaves soon.
@yogeshitaliya473
@yogeshitaliya473 3 года назад
સરસ ભાઇ
@qzorn4440
@qzorn4440 2 года назад
very explained rtu modbus... thank you 😊 have you ever used remoteXY to make a cell=phone app?
@TechnoAutomation
@TechnoAutomation 2 года назад
I didn't use remoteXY till now.
@jeffinthomas8535
@jeffinthomas8535 2 года назад
Hi Ashish, it was a great video. I am currently using the RS485 to TTL which you mentioned at the last will you please help how to code for that converter. It would be appreciatable. Thanks in advance.
@TechnoAutomation
@TechnoAutomation 2 года назад
Hi, code will remain same for rs485 - TTL or Rs232 - TTL. You can find working code on my github account. Link is in video description.
@veerakumars8509
@veerakumars8509 7 месяцев назад
Your videos are really useful but why are you not posting videos like creating webserver and configuring MQTT sorry since its are the hot topics. I accidently got your channel Its very informative. Please post the videos on configuring servers and getting data from MQTT and displaying them in dashboard also dashboard creation. This will be really useful for all. its my request
@TechnoAutomation
@TechnoAutomation 7 месяцев назад
I'm stuck at my job & not getting enough time. By d way thanks for suggestion. Will try to spare some time to make videos.
@praveenkumaru5507
@praveenkumaru5507 2 месяца назад
This is very informative video, can you please tell how to write the value from the microcontroller to other devices if it have both r/w holding register.
@TechnoAutomation
@TechnoAutomation 2 месяца назад
Hi Praveen, I haven't tried to write data yet. But I will try and revert if I get success.
@praveenkumaru5507
@praveenkumaru5507 2 месяца назад
@@TechnoAutomation Thanks for you are reply, that's a great help Sir if you tell how to write.
@ebenolivier
@ebenolivier 2 года назад
Can the max485 run off 3.3v? Been struggling with for a week without any luck. Even with to esp32s. One as master and one as slave. I have been using 5v and direct to the pins of the esp which I assume might be the problem
@TechnoAutomation
@TechnoAutomation 2 года назад
Esp32 & 8266 is 3.3V board. If you have used 5V for Max485 then signals from 485 module is 5 V pulse. In that case you have to used voltage level shifter or Potential devider to protect ESP32 or 8266. I have tried 3.3v Max485 & 232 board which makes voltage level compatible for esp. I have also tried 5V operated Max485 with esp8266. In This case I have used potential devider for RX pin of esp8266. Tx pin of ESP can directly connected with Max485 converter. Voltage level shifter parform best if you have Different voltage operated device.
@mayurrane9656
@mayurrane9656 Год назад
i have getting problem with int RX & problem is conflicting declaration with Int Rx
@TechnoAutomation
@TechnoAutomation Год назад
Have you edited the code?? Or used from my GitHub repo ??
@mayurrane9656
@mayurrane9656 Год назад
No but I have rish EM 1330 ENERGY METER
@bubaibhattacharyya4337
@bubaibhattacharyya4337 Год назад
Hi Sir Thank you for a codes and related your presentation. Can I do the same with other meter like selec MF383A.Also one more thing about MAX485 to TTL converter, can you suggest a make or resources.
@TechnoAutomation
@TechnoAutomation Год назад
Any modbus slave data can be read by this method. & Max485 - TTL you can buy from Amazon or any other suppliers. These days there are plenty of breakout birds available in the market. Make sure you purchase 3 of them so you can have spare in case any one failed..
@ameyapawar7672
@ameyapawar7672 2 года назад
Hi Ashish, I Am currently working on something similar to the video. I am using an Arduino mega for communication between the meter and the Arduino board. But I am facing some errors in the serial monitor as it displays some garbage values in it. Can you help me with it?
@TechnoAutomation
@TechnoAutomation 2 года назад
Can you share me snap of serial monitor??? 8160408577 is my WhatsApp number
@ameyapawar7672
@ameyapawar7672 2 года назад
@@TechnoAutomation Yes Sure!
@brainded2
@brainded2 Год назад
Hi I your code worked really well with my single phase smart meter DDSU666-H but I am having trouble making it work with a three-phase smart meter DTSU666. I am constantly getting a 0xE4 response code. Any help would be appreciated. Thank you
@TechnoAutomation
@TechnoAutomation Год назад
0xE4 means no response from slave.
@brainded2
@brainded2 Год назад
@@TechnoAutomation so its my smart meter that has the problem?
@TechnoAutomation
@TechnoAutomation Год назад
@@brainded2 may be. Try to read data using 485 usb adapter in modscan or similar utility in your pc.
@brainded2
@brainded2 Год назад
@@TechnoAutomation will try this one
@karti0660
@karti0660 3 года назад
Hi Ashish, Thanks for the wonderful video. Have you by any chance worked on ER300P Energy meter data collection? If so then can you please share your thoughts about the project? Also, Im not able to find the ER300P modbus register address anywhere online. It would be very kind of anyone who could share it with me. Thanks in advance
@TechnoAutomation
@TechnoAutomation 3 года назад
Thanks dear for good compliment. For LNT energy meter I used to communicate with LNT & they provide modbus address list. So I suggest to send mail yo LNT & they will provide you modbus address mapping. Visit LNTEBG website to get mail address of your area. Also share this video to other people to support me ss we others who worked in Industrial automation & IOT field.
@karti0660
@karti0660 3 года назад
@@TechnoAutomation thanks bro for the response. I'll contact them as you have mentioned. It would be really helpful if you could do a video on communication with LNT ER300P for all of us as theres near zero help on this subject online.
@ElectricalMCU
@ElectricalMCU 3 года назад
Here in the code , Non parity setting is used can we change the code in to EVEN parity, because the device parity is fixed in my case....
@TechnoAutomation
@TechnoAutomation 3 года назад
I didn't required to change that as all slaves I used are nit fixed. I think you have to check S.begin(9600,8N1) line. Try to use 8E1 instead 8N1. & revert incase no communication.
@ElectricalMCU
@ElectricalMCU 3 года назад
@@TechnoAutomation Now I managed to change the parity to "None", but only getting result as 0.00 and Request result :0xE4 , Mem; 48680, not able to get the frequency reading from parameter address "40005" of Half Dulplex communicating mode.
@TechnoAutomation
@TechnoAutomation 3 года назад
Request Result 0xE4 which means no response from slave. You have to check Wiring & ttl to 485 converter status by tx rx led. Tx led should blink while data transmitted from esp. If slave respond correctly then rx led should blinks. I suffered lot due to faulty ttl-485 module.
@jaiminoob7825
@jaiminoob7825 10 месяцев назад
is there max485 working on 3.3 Voltage ? in video u connect with 3.3V?
@TechnoAutomation
@TechnoAutomation 10 месяцев назад
Some Chinese 485 to ttl converter works on 3.3 V out of the box. & i have checked max485 on 3.3 V on breadboard setup which works ok.
@jaiminoob7825
@jaiminoob7825 10 месяцев назад
if max485 working on 5V then which pins are needed level shifter ? @@TechnoAutomation
@TechnoAutomation
@TechnoAutomation 10 месяцев назад
@@jaiminoob7825 if Max485 powered by 5V then provide level shifter to RO(Tx) pin of Max 485
@jaiminoob7825
@jaiminoob7825 10 месяцев назад
Ok Good @@TechnoAutomation
@owaisnajam5304
@owaisnajam5304 Год назад
Hi, have you tried with multiple energy meters connected in daisy chain with different modbus addresses?
@TechnoAutomation
@TechnoAutomation Год назад
Yup. 10 device.
@owaisnajam5304
@owaisnajam5304 Год назад
@@TechnoAutomation Did you use same esp8266 code? I have to read five energy meters which will be connected in daisy chain, let's say address 1 to 5. I want to read data from all 5 from a PC which will be connected on the same wifi router where esp8266 will be connected. One question here, what we call this esp8266, gateway or slave or master?
@TechnoAutomation
@TechnoAutomation Год назад
@@owaisnajam5304 esp8266 will be master. It read data from slaves and then you can transfer those data to pc using mqtt protocol.
@owaisnajam5304
@owaisnajam5304 Год назад
Thanks for your reply. Will you kindly share your WhatsApp number with international code?
@kavansketcher3214
@kavansketcher3214 Год назад
hello sir ,how can i read data from secure elite 300 multifunction meter ,can you help me for code
@TechnoAutomation
@TechnoAutomation Год назад
Your can use code i have posted on GitHub. Change the modbus address of your modbus slave
@ankitkailashi9777
@ankitkailashi9777 3 месяца назад
sir can u pls guide me how to read data if it is modbus ascii using esp32
@TechnoAutomation
@TechnoAutomation 3 месяца назад
Hi, sorry for late reply. I didn't get chance to read modbus ascii on esp. i will check and revert if i can help. Sorry bro
@iotprojecthindi
@iotprojecthindi Месяц назад
I want to a make a home automation for my home. So that I am decide to control all the bulbs and fans through the home assistant or phone. I am not connect all relays and senaor through the wifi network because my home is big. Wifi range is to small for my home automation. So that I am decide to implement modbus for connect all relays and sensor. I thing Modbus is more reliable and easy to implement because the wired connection. I want to connect 10 node. Each nodes contains or hold the few relays and some sensor such as temp and humidity CT sensors mmwave sensor motion sensor. And each nodes connect through each other. And last node is finally connected to think client or Ressbery pi which is operated home assistant os. Please solve my problem and give the feedback
@TechnoAutomation
@TechnoAutomation Месяц назад
Modbus is a master slave communication protocol. Each node will not talk to each other directly. Only the server can talk to all devices. For home automation wifi network is the best suitable communication method. If your wife's network is limited in range then you can use wifi repeaters. Or you can use esp now which is a light weight wifi communication protocol which provides mesh networking and nodes to nodes can talk to each other.
@projectgroot9338
@projectgroot9338 3 года назад
how to use modbus with EC Sensor sir..btw nice video
@TechnoAutomation
@TechnoAutomation 3 года назад
You have to get modbus address list from manufacturer. You can use same code which I have explained in this video. Only communication parameters & read register to be changed. Try to read single register first.
@veerakumars8509
@veerakumars8509 7 месяцев назад
Hi Techno Automation,
@TechnoAutomation
@TechnoAutomation 7 месяцев назад
Hi.
@avyadav9180
@avyadav9180 2 года назад
For VFD control what is required
@TechnoAutomation
@TechnoAutomation 2 года назад
For any modbus slave device all hardware required as mentioned in video.
@avyadav9180
@avyadav9180 2 года назад
@@TechnoAutomation can you make video sir please on this
@muhammedrashid2808
@muhammedrashid2808 2 года назад
Assalam o allikum brother. I have a 18kw vfd now i am only able to on and off the vfd using esp8266 module. I want to see the vfd lcd wirelessly on my android
@TechnoAutomation
@TechnoAutomation 2 года назад
You need to read data from drive. Create webpage & host it via esp webserver api.
@TechnoAutomation
@TechnoAutomation 2 года назад
Similar project i did for energy reading display using webpage. You can refer below mentioned code github.com/ashish8284/ESP8266_MODBUS_GATEWAY_GROWATT Webpage.h is for creating webpage
@mukeshl7037
@mukeshl7037 2 года назад
Hi sir ji can we get direct program link or download link pls
@TechnoAutomation
@TechnoAutomation 2 года назад
You can find code on my github account. Link is in video description. Download code from there & tweek as per your requirement.
@mukeshl7037
@mukeshl7037 2 года назад
@@TechnoAutomation thanks sir ji
@govindsinghrathore4282
@govindsinghrathore4282 3 года назад
ModbusRTU' does not name a type this type of error it is showing
@TechnoAutomation
@TechnoAutomation 3 года назад
Do you have installed Modbus RTU library from github link which I have mentioned in video description.
@govindsinghrathore4282
@govindsinghrathore4282 3 года назад
@@TechnoAutomation yes sir
@govindsinghrathore4282
@govindsinghrathore4282 3 года назад
@@TechnoAutomation modbusrtu mb in that line it showing error
@TechnoAutomation
@TechnoAutomation 3 года назад
github.com/ashish8284/ESP8266_MODBUS_EM6400NG_SCHNIEDER Download .in & .h file from above link & try. Select bord as esp8266 only.
@govindsinghrathore4282
@govindsinghrathore4282 3 года назад
@@TechnoAutomation I'll having the selec EM2M it can work with that also
@jibanjyotibehura3565
@jibanjyotibehura3565 Год назад
Excellent video sir, can you please explain how to connect more meters and how many esp module required if we need to connect more meters. And please can you share your contact no or mail I'd. Thank you.
@TechnoAutomation
@TechnoAutomation Год назад
I have connected 10 slaves with one esp which works fine till 2 years.
@belkocik
@belkocik 2 года назад
MAX485 can be powered 3,3V from esp8266 pin? MAX485 doesn't have to be powered with 5V? Whaaaaa...?
@TechnoAutomation
@TechnoAutomation 2 года назад
Yup setup you have seen in video is 3.3v operated its Woking fine. I have made wifi gateway for Growatt Inverter which works since year without failure.
@belkocik
@belkocik 2 года назад
​@@TechnoAutomation So can I power the esp8266 nodemcu through VIN pin with 5V and then use 3v3 esp's pin and power the max485 chip?
@TechnoAutomation
@TechnoAutomation 2 года назад
Yup. Its possible. Check 485ttl converter specifications. Some module work on 5V only.
@shibotoshbhattacharjee8799
@shibotoshbhattacharjee8799 2 года назад
Need to talk to you for a project
@TechnoAutomation
@TechnoAutomation 2 года назад
Whatsapp me on 8160408577
@owaisnajam5304
@owaisnajam5304 Год назад
@@TechnoAutomation What's your complete WhatsApp number with international code +....?
@bezutec
@bezutec 5 месяцев назад
.
@jibanjyotibehura
@jibanjyotibehura Год назад
Hii sir please share your contact details, I want to discuss for some IOT projects.
@TechnoAutomation
@TechnoAutomation Год назад
8160408577. Can whatsapp me.
@Ragavenutb
@Ragavenutb 2 года назад
hello friend am trying to read the mod-bus data from Siemens APFC using Nodemcu 8266. am able to read the first input register but consecutive following register am not able to read i tried creating Mread1 instances and conversions but the second data always read 0.00.. any ways to rectify ty. ex : if (!mb.slave()) { mb.readIreg(1, 0x30040, Mread1, 2 , cbWrite); //(SlaevID,Address,Buffer,Range of data,Modus call) mb.readIreg(1, 0x30000, Mread2, 2 , cbWrite); Serial.print("V1 "); Serial.println(InttoFloat(Mread1[1], Mread1[2])); Serial.print("V2 "); Serial.println(InttoFloat1(Mread2[1], Mread2[2])); // v1 Read fine but v2 is 0.00.
@TechnoAutomation
@TechnoAutomation 2 года назад
Hi, my first suggestion is read Individual register first. I.e first read 30040 only and check data is OK or not. Then read 30000 only and check data is OK or not. If got success then refer my code on github. In that code I have read different registers by making cyclic call for individual register. github.com/ashish8284/ESP8266_MODBUS_GATEWAY_GROWATT/blob/main/Modbus_Call.h
@Ragavenutb
@Ragavenutb 2 года назад
@@TechnoAutomation yes friend the first register followed by if (!Slave) is always correct no matter what the registers address is. But the problem is second one i tried many combination possibilities but its always 0.0. I dint look at growatt. Now ill have a look . Thank You.
@Ragavenutb
@Ragavenutb 2 года назад
@@TechnoAutomation Thank You, my friend. got it to work, the trick is to use "for"statement. & do you do undertake projects ?
@TechnoAutomation
@TechnoAutomation 2 года назад
Yup.
@Ragavenutb
@Ragavenutb 2 года назад
@@TechnoAutomation pm your whatsapp no pls..
Далее
ESP8266 to monitor your electricity with SDM meters
11:11
SparkFun According to Pete #54 - How RS-485 Works
14:31
2418  Sort the People
3:06
Просмотров 5
Modbus using ESP8266 NodeMCU
8:31
Просмотров 9 тыс.
Understanding Modbus Serial and TCP IP
12:07
Просмотров 126 тыс.
iPhone 15 Pro в реальной жизни
24:07
Просмотров 407 тыс.