My basementButtonOn() callback changes pin D1 to HIGH.
In my case, I renamed everything "BasementButton". Just replace the Switch-es in that file with whatever you want to make a switch. You'll see all this in the sample wemos.ino code. Make your callback for both On and Off and put whatever you want in the callback: bool kitchenLightsOn() Add to Loop section (kitchen->serverLoop() ) 5. Initialize your switch (kitchen = new Switch("kitchen lights", 81, kitchenLightsOn, kitchenLightsOff) upnpBroadcastResponder.addDevice(*kitchen) ) 4. Low speed fan cut off (avoiding overheat of Fan stator). State saving feature to resume fan speed level even after power interruption. Both local and wifi controlled (Push button & Smartphone wifi). Define your switch (Switch *kitchen = NULL ) 3. Wemos D1 mini adds WiFi functionality for this regulator.
Set your SSID and password to your wifi 2. Basically, all you need to do in this file is:ġ. The only file that needs to be modified is the wemos.ino file. Then bring up the wemos.ino file in the arduino ide.
Put this code where all your other arduino projects are located. This is an easy way to interface it with the amazon echo.įirst, go to. The reason for the WEMO is that it is WIFI enabled - and, you can use some easily available code to make it behave like a wemo belkin switch. Next, you have to get the WEMO working with the Echo.
There are some steps to get the WEMO working with the arduino IDE, and you can follow them in this excellent instructable. You can use the Arduino IDE to program the WEMO. In fact, I could have controlled 4 solenoids instead of just the one, but one was all I needed for this project. There was no reason that I connected to Input/Output 2, I could have done Input/Output 1. I soldered male pins to the end of each solenoid wire. solenoid wires - black to WEMO ground, any color to L293D output2 pin (6) - NOTE: I used wire with a 2-pin female connection at the end. battery cap wires - black to WEMO ground, red to L293D Vs pin (8) 5. Yellow wire from WEMO D1 pin to L293D input2 pin (7) 4. Black wire from WEMO ground to L293D ground pin (5) 3. Red wire from WEMO 5V to L293D Enable pin 2. Then I soldered wires to to the board to make connections: 1. However, I discovered, that the L293D does not plug into the headers with a good connection, so I soldered it directly onto the board. Originally, I also soldered female headers for the L293D to plug into. This particular board is nice because it is laid out like a breadboard with rails and sets of holes that are connected.įirst, I soldered female headers onto the perfboard for the WEMO to plug into. You get a much lower power consumption, but you are limited to lower maximum input voltages of 6V instead of 12V for the NodeMCU.I soldered this together on the perfboard. A major influence has the ME6211 3.3V voltage regulator of the WeMos D1 Mini. In comparison to the ESP8266 NodeMCU, we see that the WeMos D1 Mini has a much lower current consumption during the light and deep sleep power modes. In the light sleep power mode, the current consumption is only 0.68mA because the WiFi module and the system clock are disabled and in the deep sleep mode, you can reduce the current drain to 0.17mA so that also the CPU is disabled. The ESP8266 has several power saving modes that you can use to further reduce the power consumption. If you have any suggestions, let me know in the comment section under this tutorial. Currently I have no explanation why the power consumption of the WeMos D1 Mini with an empty script is higher as during a WiFi scan.
Unfortunately, I measured a higher power consumption of 72mA with an empty Arduino script and a 5V power supply. But be aware that if the voltage gets higher than 3.6V you can damage the ESP8266.ĭuring a WiFi scan with a 5V power supply the current consumption of the ESP8266 WeMos D1 Mini is 68mA.