Here are the steps:
1. Prepare the following components: Arduino Uno with the USB cable, PZEM-004T v3 and an extension cable with plugs. Wiring as shown in the following link: https://ibb.co.com/cwrnj7h
2. Instal the PZEM004Tv30 library to read PZEM-004T v3, download the library at this link: https://github.com/mandulaj/PZEM-004T...
3. Open Examples in the File menu, select PZEM004Tv30, and select PZEMSoftwareSerial.
4. To make the data sent to the Arduino IoT Cloud more concise, edit the program, especially the Serial.print instruction, and also change the baud rate from 115200 to 9600. To make things easier, replace the program in the PZEMSoftwareSerial example with the program in this link: pastebin.com/raw/etdG9sTj
5. Connect the Arduino Uno to the computer, and upload the program.
6. Open this wokwi project: https://wokwi.com/projects/3992422030...
7. Replace the Device_Login_Name and Device_Key codes with the Device ID and Secret Key codes obtained from Arduino IoT Cloud. For that, open https://cloud.arduino.cc.
8. Create an Arduino account, then Sign In.
9. Create a Thing with 1 Cloud Variables. Name it PZEM_data, Character String type, Read Only and Periodically.
10. Connect to the device, select Device: ESP32 Dev Module, don't forget to save the pdf file containing the ID and secret key for the device.
11. Create a Dashboard for the PZEM_data variable with the Messenger widget
12. Open the Wokwi program, replace the ID and Secret Key with the ID and Secret Key found in the downloaded pdf file.
13. Run the Wokwi program, and the Arduino IoT Cloud Dashboard by clicking the View button (eye image). Wait until the Wokwi Serial Monitor displays the words "Connected to Arduino IoT Cloud".
14. So that the data in the Messenger widget can be displayed in the form of graphs and gauges, connect the PZEM Cloud variable to the Google Sheet via Webhook. Install add-on Webhooks for Ssheets.
15. Open a new sheet in Google Sheet, give it a name, create a webhook link with the Webhooks for Sheets add on.
16. Paste the webhook link in the Arduino IoT Cloud Thing page.
17. After the data from the webhook appears on Sheet1, delete the data that is not needed, leaving the data in 3 columns, namely in the values_0_name, values_0_value and values_0_update_at columns.
18. To separate PZEM_data into 6 values, eliminate data duplication, and sort the data based on time, as well as display the data in graphs and gauges, use the following formula:
1. Sheet1 D2 =arrayformula(if(C2:C="","",split(C2:C,"TZ")+7/24))
2. Sheet1 F2 =arrayformula(if(D2:D="","",value(D2:D)+value(E2:E)))
3. Sheet1 G2 =arrayformula(if(F2:F="","",(F2:F-$F$2)*100000))
4. Sheet1 H2 =arrayformula(if(B2:B="","",split(B2:B,",")))
5. Sheet2 A1 =unique(Sheet1!A:M)
6. Sheet3 A1 =query(Sheet2!A:M,"select H,I,J,K,L,M,G where G is not null order by G asc")
7 Sheet4 A1 =index(Sheet3!A:A, counta(Sheet3!A:A))
For further information, please visit this blog: https://bermainwokwi.blogspot.com/p/k...
Информация по комментариям в разработке