mirror of https://github.com/arendst/Tasmota.git
added project with Wemos D1 Mini and 1602 I2C lcd display
parent
7d2cef5060
commit
120621b26e
|
@ -40,4 +40,68 @@ Configure the GPIO's for hardware serial connection as shown below.
|
|||
|
||||
<img src="https://user-images.githubusercontent.com/10942270/50730409-5653d780-114d-11e9-9ce0-05074c4d08b7.png" height="400" />
|
||||
|
||||
# Connected Power Meter using PZEM-004T, Wemos D1 Mini and a 1602 I2C display
|
||||
|
||||
## Parts needed
|
||||
- Wemos D1 Mini
|
||||
- PZEM-004T
|
||||
- Resistor 1k
|
||||
- [Enclosure](https://www.itead.cc/smart-home/sonoff-ip66.html)
|
||||
- Power cable
|
||||
- Little PSU (search for "700ma 3.5w 5v" on usual stores...)
|
||||
- I2C 1602 LCD Display (I had issues with green one, i2c address 0x3F, while no problems with blue ones, address 0x27)
|
||||
- Mammuth Clamps
|
||||
|
||||
## Preparation
|
||||
Install Tasmota on the Wemos D1 Mini and confirm it is functional before connecting the PZEM-004T to its serial interface. You need to compile your own firmware, as none of the actual pre-made binaries have support for both display and PZEM sensor module.
|
||||
|
||||
To compile (I used Core 2.3.0), edit these files:
|
||||
- sonoff_post.h: look for line (about 230 or so) starting with "**#ifdef USE_DISPLAYS**" and comment out the "**#undef USE_ENERGY_SENSOR**" that follows near there, so it should be like:
|
||||
```
|
||||
//#undef USE_ENERGY_SENSOR
|
||||
```
|
||||
- user_config_override.h: before last **#endif**, add this line
|
||||
```
|
||||
#define USE_DISPLAYS
|
||||
```
|
||||
- my_user_config.h: uncomment line with "**//#define USE_CONFIG_OVERRIDE**" so it's like:
|
||||
```
|
||||
#define USE_CONFIG_OVERRIDE
|
||||
```
|
||||
|
||||
## Tasmota config parameter
|
||||
|
||||
Set module as GENERIC (18), then GPIOs as in image:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/21192010/51801083-671dd780-2239-11e9-885d-ac338d739441.png" height="400" />
|
||||
|
||||
- use the "**I2CScan**" command to detect your device address, then set it with: "**DeviceAddress XXX**" (where XXX is the decimal converted address found)
|
||||
- set "**TelePeriod 10**" to have the display refresh every 10 seconds (you can't go under this value...)
|
||||
- set "**DisplayModel 1**", and "**DisplayMode 0**"
|
||||
- finally, add a Rule to display values (I choose these ones):
|
||||
```
|
||||
rule1 on tele-ENERGY#Power do DisplayText [z] [x1y0]%value%W endon on tele-ENERGY#Today do DisplayText [x8y0]%value%Wh endon on tele-ENERGY#Voltage do DisplayText [x1y1]%value%V endon on tele-ENERGY#Current do DisplayText [x8y1]%value%A endon
|
||||
```
|
||||
- remember to enable the rule, with "**rule1 1**"
|
||||
|
||||
## Images and Wiring diagram
|
||||
|
||||
**DANGER - MAINS VOLTAGE**. Be sure to crimp connectors and use heat-shrinking tube wherever possible/needed, and tightly secure any screw.
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/21192010/51847810-bb4db800-231c-11e9-9d25-b93591115351.png" height="400" />
|
||||
|
||||
How it looks, from web gui:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/21192010/51801658-2924b180-2241-11e9-8bc0-b456ac3c234f.png" height="400" />
|
||||
|
||||
How it looks, from closed box (set contrast using the little trimmer/pot on back of display, and i cut a bit of corners from display to have it flush with border, and used 2 exagonal plastic standoffs with nuts and bolts to secure it to trasparent top):
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/21192010/51847823-c3a5f300-231c-11e9-8755-a7787327e5c5.png" height="400" />
|
||||
|
||||
Mains IN, mains OUT, all sealed:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/21192010/51847837-c99bd400-231c-11e9-9b7b-2d68bd177b21.png" height="400" />
|
||||
|
||||
Wiring Diagram, check other images in this page for more info about the 1K resistor needed to reduce voltage from 5V to 3V3 for the serial connection.
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/21192010/51847858-d4eeff80-231c-11e9-9c13-41172a6924ee.png" height="400" />
|
||||
|
|
Loading…
Reference in New Issue