Skip to content

Commit f73b445

Browse files
committed
first commit
0 parents  commit f73b445

File tree

325 files changed

+26768
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

325 files changed

+26768
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
### Products
2+
* [WiFi-Socket-Smart-Power-Strip at aliexpress](https://www.aliexpress.com/item/WiFi-Socket-Smart-Power-Strip-Voice-Control-Timer-Switch-Power-Strip-Outlet-with-4-AC-Outlets/32914473349.html)
3+
* AKA: SA-P402A BY-V1.1. 180823
4+
* [Wifi Smart Power Strip 4 EU Outlets Plug with 4 USBCharging Port at aliexpress](https://www.aliexpress.com/item/Wifi-Smart-Power-Strip-4-EU-Outlets-Plug-with-4-USBCharging-Port-Timing-App-Voice-Control/32939654903.html) also at [Amazon.de as AOFO ZLD-44EU-W](https://www.amazon.de/gp/product/B07SKTBC47/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)
5+
* [Koogeek Wifi Smart USB Power Strip Socket at aliexpress](https://nl.aliexpress.com/item/Koogeek-Smart-Power-Strip-4-Port-USB-4-AC-Outlets-Plug-Socket-Voor-Alexa-Google-Thuis/32932078575.html)
6+
* AKA: 0710033644644 / KLOE4
7+
8+
![vierfachdose](https://user-images.githubusercontent.com/3671232/51432807-25d86700-1c3e-11e9-871e-bffdbd35eefc.jpg)
9+
10+
### Opening
11+
To open take a very small screwdrive to pull out the six feets. Don't remove the rubber plates, it won't help.
12+
13+
![fuesschen](https://user-images.githubusercontent.com/3671232/51432805-25d86700-1c3e-11e9-9d48-bad4c086510d.jpg)
14+
15+
### Flashing
16+
You'll have to connect GPIO0 manually, the switch is connected to GPIO1. It marked the pin in the picture. Because the TYWE2S has 2mm pitch, I made a little adapter to 2,54mm pitch. Then it can easy soldered to the first four pins. From left to right 3,3V, Gnd, Rx, Tx.
17+
18+
![anschluss](https://user-images.githubusercontent.com/3671232/51432804-253fd080-1c3e-11e9-9030-80a459afe06e.jpg)
19+
20+
### Configuration
21+
Configure the USB-Charger as number five, then the next socket as number one and so on.
22+
This is the configuration:
23+
24+
![configure module](https://user-images.githubusercontent.com/3671232/51432806-25d86700-1c3e-11e9-90a1-0ad73de47a14.png)
25+
26+
* For the other model (Koogeek and AOFO) the GPIO connections are a bit different:
27+
* LED: GPIO1
28+
* Switch: GPIO3
29+
* Socket 1: GPIO5
30+
* Socket 2: GPIO4
31+
* Socket 3: GPIO12
32+
* Socket 4: GPIO13
33+
* USB: GPIO14

A4988-Stepper-Motor-Controller.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
**This feature is not included in precompiled binaries.**
2+
To use it you must [compile your build](compile-your-build). Add the following to `user_config_override.h`:
3+
```
4+
#ifndef USE_A4988_STEPPER
5+
#define USE_A4988_STEPPER // A4988/DRV8825 stepper motor (+10k5 code)
6+
#endif
7+
```
8+
----
9+
This drives is used to control stepper-motors such as [NEMA 17](https://reprap.org/wiki/NEMA_17_Stepper_motor).
10+
11+
## Connecting the motor controller
12+
The driverboard has several connectors: powering the controller (3.3-5.0 V), input (+/-) & output (1a/1b/2a/2b), the motor (up to 35V/2A), and to control the circuit (in order at the control side of the board):
13+
14+
Connector | Description
15+
:-:|-
16+
DIR|Direction of rotation
17+
STEP|Initiate stepping
18+
MS1|Microstep increment select
19+
MS2|Microstep increment select
20+
MS3|Microstep increment select
21+
EN|Enable the power supply for the motor
22+
SLP|Sleep (bridge to RST)
23+
RST|Reset (bridge to SLP)
24+
25+
### Tasmota configuration
26+
There are six GPIO [components](Components) that should be configured to free GPIOs:
27+
```
28+
A4988 DIR (170)
29+
A4988 STP (171)
30+
A4988 ENA (172)
31+
A4988 MS1 (173)
32+
A4988 MS2 (174)
33+
A4988 MS3 (175)
34+
```
35+
The minimal configuration are the `DIR` and `STEP` signals. In such a configuration the motor will be permanently powered and microstepping will be set to 1/1 (full steps).
36+
37+
### A4988 Controller
38+
Detailed information about the A4988 controller can be found in the [datasheet](http://www.allegromicro.com/~/media/Files/Datasheets/A4988-Datasheet.ashx).
39+
40+
#### Microstepping Configuration
41+
![A4988-Truth-Table](https://user-images.githubusercontent.com/34340210/66860427-2d256a80-ef5b-11e9-9979-47778140661f.png)
42+
43+
### DRV8825 Controller
44+
The DRV8825 is directly pin compatible with the A4988. The microstepping increment settings are different. Also, there is one additional option on the DRV8825.
45+
46+
#### Microstepping Configuration
47+
![DRV8825 -Truth-Table](https://user-images.githubusercontent.com/34340210/66860425-2d256a80-ef5b-11e9-95cf-6625833eea87.png)
48+
49+
## Operation
50+
Refer to the [Stepper Motor Commands](Commands#Stepper-Motors)
51+
52+
`MotorRPM` is an imprecise setting due to the implementation method. Also, if the value is too high for the combination of chosen micro stepping increment (`MotorMIS`) and the number of steps the given motor needs for one revolution (`MotorSPR`), the motor will not turn but make a whining noise. You will have to experiment some to find the optimal combination for your use case.
53+
54+
## Example project
55+
The cheap auto-feeder for my cats broke. It was a fancy plastic-thingy with voice-recording-function & programmable to feed several times a day after playing back your voice (cats don't give a sh$7 about your voice - they come when they hear the food falling into the bowl). It was never precise - a concern for the amount of nutrition it gave the cats. And it was not reliable, as the torque of the internal moving mechanism was insufficient to spin the separator/proportioning wheel through the food reliably. In addition, the batteries were always drained in a day meaning very grumpy cats when we returned!
56+
57+
Thus the wish to install a high-torque stepper-motor (with shifting gear) was born. I could power it with mains instead of relying on a battery, control it over WiFi from my home automation hub. Tasmota now offers a way to do this!
58+
59+
The **"TasmotaSmartCatFeeder"** circuit consists of a WeMos D1 mini, a A4988 controller, and two power supplies (5V&12V). This all fits into the housing of the feeder and costs less than 50€!
60+
61+
Virtually everything which has to be moved or rotated can be done now using these cheap components. It can be a window, door, shutter, cat or dog flap, a solar panel which follows the sun, a moving spotlight, PTZ-camera, or whatever.
62+
63+
### Wiring Diagrams
64+
![Nema-17_v1](https://user-images.githubusercontent.com/34340210/66860250-d6b82c00-ef5a-11e9-8897-1a4e9d7fdf21.jpg)
65+
![28BYJ-48_V1](https://user-images.githubusercontent.com/34340210/66860253-d91a8600-ef5a-11e9-9195-c816e329abb8.jpg)
66+
67+
68+
### A4988/DRV8825 Stepper Motor Control Development Boards
69+
[Banggood](https://www.banggood.com/A4988DRV8825-Stepper-Motor-Control-Board-Expansion-Board-For-3D-Printer-p-1238774.html)
70+
[AliExpress #1](https://www.aliexpress.com/item/32908836265.html)
71+
[AliExpress #1](https://www.aliexpress.com/item/32870732179.html)

ADC.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
ESP8266 has a single ADC pin available. It may be used to read voltage at ADC pin or to read module supply voltage (VCC).
2+
> When referring to the ADC pin these terms are used interchangeably: ADC (Analog-to-digital Converter), TOUT, Pin6, A0 or Analog0.
3+
4+
By default Tasmota uses ADC pin to read voltage. The signal comes from an analog [peripheral](peripherals), or sometimes from the device itself (see [Shelly 2.5](Shelly-2.5)).
5+
6+
After wiring a peripheral to A0 pin you have to configure it in **Configure Module**:
7+
8+
![ADC configuration](https://i.postimg.cc/qqYmYG3v/ADC.png)
9+
10+
#|Option|WebUI display|MQTT mesage
11+
-|-|-|-
12+
0|None| none | none
13+
1|Analog | Analog0 _%value%_ | `{"A0":%value%}`
14+
2|Temperature | Temperature _%value%_ °C (°F) | `{"Temperature":%value%},"TempUnit":"C"}`
15+
3|Light | Illuminance _%value%_ lux | `{"Illuminance":%value%}`
16+
4|Button | none | none
17+
5|Buttoni | none | none
18+
19+
The reading will show in web UI's sensor section as "_%option% %value%_" depending on the selected option. Tasmota calculates the values for temperature and light, analog values can be `1` to `1024`.
20+
21+
Example: ADC as `Analog (1)`
22+
![ADC in web UI](https://i.postimg.cc/zv9jpXsL/Analog0.png)
23+
24+
A message will be published in `tele/%topic%/SENSOR` JSON response as `"ANALOG": ` depending on the selected option.
25+
26+
Example: ADC a Light(3)
27+
18:55:09 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T18:55:09","ANALOG":{"Illuminance":8}}
28+
29+
> Careful when setting ADC as Button, if there is constant voltage on the pin it might register as a [long press](Button-usage#long-press) and reset the device to firmware defaults
30+
31+
### Rule triggers
32+
Use these triggers in rules:
33+
34+
`on ANALOG#A0div10 do ...` - when the ADC input changes by more than 1% it provides a value between 0 and 100
35+
36+
`on Tele-ANALOG#A0 do ...` - triggers on tele messages with Analog object
37+
> `MQT: tele/tasmota/SENSOR = {"Time":"2019-01-14T19:36:51","ANALOG":{"A0":1024}}`
38+
39+
Rule example: [using a potentiometer on analog pin](Rule-Cookbook#use-a-potentiometer).
40+
41+
## ADC_VCC
42+
Instead of an input, ADC pin can be used to measure supply voltage of the ESP module (*this reading in not 100% accurate*). To enable ADC_VCC feature you need to [compile your own build](Compile-your-build):
43+
44+
**If you enable ADC_VCC you cannot use the pin as analog input anymore.**
45+
46+
user_config_override.h flag:
47+
```
48+
// -- Internal Analog input -----------------------
49+
#define USE_ADC_VCC // Display Vcc in Power status
50+
```
51+
52+
53+
Supply voltage is published in `tele/%topic%/STATE` under `"Vcc":` in mV:
54+
```
55+
11:14:59 MQT: tele/tasmota/STATE = {"Time":"2019-10-31T11:14:59","Uptime":"0T18:36:12","UptimeSec":66972,"Vcc":3.423,"Heap":28,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":6,"POWER":"OFF","Wifi":{"AP":1,"SSId":"Tasmota","BSSId":"00:00:00:00:00:00","Channel":13,"RSSI":100,"LinkCount":1,"Downtime":"0T00:00:06"}}
56+
```

AM2301.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
AM2301 driver supports [AM2301 (DHT21)](https://kropochev.com/downloads/humidity/AM2301.pdf), [AM2302 (DHT22)](https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf) and [AM2321](http://akizukidenshi.com/download/ds/aosong/AM2321_e.pdf) temperature and humidity sensors.
2+
3+
> Introduced in Tasmota through [Sonoff AM2301](https://sonoff.tech/product/accessories/am2301) accessory for [Sonoff TH](sonoff-th).
4+
5+
**This driver is ONLY for **single wire** implementations of the sensor.**
6+
7+
## Configuration
8+
### Wiring
9+
| AM2301 | ESP266 |
10+
|---|---|
11+
|- |GND |
12+
|OUT |GPIOx |
13+
|+ |3.3V |
14+
15+
## Tasmota
16+
In the _Configuration -> Configure Module_ page assign:
17+
- GPIOx to `AM2301 (2)`
18+
19+
After a reboot webUI will display temperature and humidity measured.
20+
21+
![image](https://user-images.githubusercontent.com/5904370/68092438-67639700-fe8b-11e9-86df-b2acdc05f9d7.png)
22+
23+
Sensor sends a `tele/%topic%/SENSOR` JSON reponse:
24+
25+
```json
26+
{
27+
"Time": "2019-01-01T00:00:00",
28+
"AM2301": {
29+
"Temperature": 24.6,
30+
"Humidity": 58.2
31+
},
32+
"TempUnit": "C"
33+
}
34+
```
35+
### Commands
36+
[`TempOffset`](commands#tempoffset) -12.7 .. 12.7 can be used to increase/decrease the measured temperature. Will change ALL temperature sensors.
37+
38+
## Wemos DHT Shield
39+
Like the [Wemos DHT11 shield specs](https://wiki.wemos.cc/products:retired:dht_shield_v1.0.0) the DATA OUT pin of Wemos DHT22 is connected to D4 of the Wemos.
40+
41+
![image](https://user-images.githubusercontent.com/5904370/68092516-5bc4a000-fe8c-11e9-916c-ec10e7e781b0.png)
42+
### Tasmota Configuration
43+
In the Configuration -> Configure Module page, select the following:
44+
* **D4 GPIO2** : **02 AM2301**
45+
46+
<img src="https://github.com/arendst/arendst.github.io/blob/master/media/wemos/wemos_dht22_config_marked.jpg"/>
47+
48+
### Sensors
49+
Read more about [differences between sensors](http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.html).
50+
51+
![image](https://user-images.githubusercontent.com/5904370/68092629-85ca9200-fe8d-11e9-842f-803f36e8064c.png)

APDS-9960.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
**This feature is not included in precompiled binaries.**
2+
To use it you must [compile your build](compile-your-build). Add the following to `user_config_override.h`:
3+
```
4+
#ifndef USE_APDS9960
5+
#define USE_APDS9960 // Enable APDS9960 Proximity Sensor (+4k7 code)
6+
#endif
7+
```
8+
----
9+
<img src="https://i.postimg.cc/qRLyPy1n/APDS-9960-1-720x533.jpg" align=right>
10+
Broadcom APDS-9960 is a digital RGB, ambient light, proximity and gesture sensor device in a single 8-pin package. The device has an I2C compatible interface providing red, green, blue, clear (RGBC), proximity and gesture sensing with IR LED. The RGB and ambient light sensing feature detects light intensity under various lighting conditions and through various attentuation materials including darkened glass. In addition, the integrated UV-IR blocking filter enables accurate ambient light and correlated color temperature sensing.
11+
12+
## Configuration
13+
### Wiring
14+
| Breakout | ESP8266 |
15+
|----------|-----------|
16+
| VCC/VIN | +3.3VDC |
17+
| GND | GND |
18+
| SCL | GPIOy |
19+
| SDA | GPIOx |
20+
| INT/IRQ | not used |
21+
22+
### Tasmota Configuration
23+
In the _Configuration -> Configure Module_ page assign:
24+
1. GPIOx to `I2C SDA (6)`
25+
2. GPIOy to `I2C SCL (5)`
26+
27+
After configuring the GPIO's the driver will detect the APDS-9960 automatically.
28+
On first boot sensor will start in gesture mode. It will not appear in the webUI but it can be observed via MQTT messages in console:
29+
30+
```json
31+
21:34:21 MQT: tele/tasmota/RESULT = {"Gesture":"Off"}
32+
21:34:23 MQT: tele/tasmota/RESULT = {"Gesture":"On"}
33+
21:34:25 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:25","APDS9960":{"None":1}}
34+
21:34:26 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:26","APDS9960":{"Right":1}}
35+
21:34:29 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:29","APDS9960":{"Down":1}}
36+
21:34:29 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:29","APDS9960":{"Right":1}}
37+
21:34:31 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:31","APDS9960":{"Left":1}}
38+
21:34:33 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:33","APDS9960":{"Up":1}}
39+
21:34:35 MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:34:35","APDS9960":{"Down":1}}
40+
```
41+
42+
When you enable RGBC mode with `Sensor27 0` sensor will show up in web UI:
43+
![](https://i.postimg.cc/W1Cn8Gy1/APDS-9960.png)
44+
45+
and in MQTT topic (according to TelePeriod):
46+
`MQT: tele/tasmota/SENSOR = {"Time":"2019-10-31T21:48:51","APDS9960":{"Red":282,"Green":252,"Blue":196,"Ambient":169,"CCT":4217,"Proximity":9}}`
47+
48+
## Commands
49+
| Command | Value | Description |
50+
|---|---|---|
51+
| Sensor27 || Show APDS9960 gesture/RGBC mode |
52+
| Sensor27 | 0 / off | Disable APDS9960 gesture mode/Enable RGBC mode |
53+
| Sensor27 | 1 / on | Enable APDS9960 gesture mode/Disable RGBC mode |
54+
| Sensor27 | 2 / on | Enable APDS9960 gesture mode/Disable RGBC mode with half gain|
55+
| Sensor27 | 3 ...255 | Set ATIME register for different integration times|
56+
57+
### Example rules
58+
***In gesture sensing mode `Tele-APDS9960` is the trigger (APDS9960 will not work)***
59+
60+
Device will be in RGBC mode until something is close to it, then it switches into gesture mode for 60 seconds.
61+
```
62+
Rule on APDS9960#Proximity=250 do backlog Sensor27 1; RuleTimer1 60 endon on Rules#Timer=1 do Sensor27 0 endon
63+
```
64+
65+
Relay ON when ambient light is below 100 lux.
66+
```
67+
Rule on APDS9960#Ambient<100 do POWER ON endon
68+
```
69+
70+
Control ON/OFF, brightness and color temperature with gestures
71+
```
72+
Rule on Tele-APDS9960#Long do power toggle endon on Tele-APDS9960#Up do dimmer + endon on Tele-APDS9960#Down do dimmer - endon on Tele-APDS9960#Left do ct + endon on Tele-APDS9960#Right do ct - endon
73+
```
74+
75+
## Known issues:
76+
77+
1. The different PCB’s on the market seem to differ quite substantially regarding to their electrical characteristics. We have at least one case report, where this led to a malfunction on an ESP8266-board within Tasmota but in another library too. The exact technical reason can only be suspected, but it is probably related to electrical noise and/or power consumption.
78+
In the case from above the sensor measured an incorrect high proximity value, which resulted in repeated triggering of a "LONG" gesture. The solution was to decrease the gain factor for proximity and gesture. Therefore the argument 2 (`sensor27 2`) was introduced to change this at runtime.
79+
If you experience gesture sensing problems you could try this out, but if you measure proximity values <25 with nothing in front of the sensor (e.g. web interface after `sensor27 0`), then there is very likely another problem. It can be assumed, that the gesture sensitivity will suffer with reduced gain, so first try option 1 (=default).
80+
Beside that better wiring and maybe an additional capacitor over VCC and GROUND might be helpful.
81+
82+
2. The measurement of the light level is briefly described in the datasheet and the open-source-libraries use the ambient-light-value directly from the sensor or calculate a LUX-value from RGB. Both variants are usable and differentiate between low and strong light, but the absolute values are questionable and at the moment we have an uncalibrated sensor.
83+
All known solutions use a fixed integration time, which is more or less the same as a fixed exposure time in photography. In contrast the TSL2561-library uses various integration times and maybe this is possible on the APDS9960 too.
84+
To eventually achieve this in the future, the option to set this integration time at runtime was added. Every argument between 3 and 255 sets the ATIME-register.
85+
The formula is: integration time = (256-ATIME)*2,78 ms, so with the default value of 219 we get (256-219)*2,78 = 102,86 ms. That means a smaller ATIME makes the integration time longer and more photons are captured, which might be usable for (very) low light conditions, because otherwise the sensor will saturate too early. The opposite is valid for a bigger ATIME value.
86+
The change of this value only makes sense for: users who need to change the sensitivity, if the sensor resides behind dark glass or want to contribute to the development of a new LUX-calculation in the driver. If we get enough feedback, this could lead to an improvement on the software side. Feel free to open (or search for) an issue, if you have measured the APDS9960 against other devices with different ATIME-values at different light levels. This is not a trivial task though.
87+
88+
## Generally available types of breakout boards
89+
![APDS-9960](https://ae01.alicdn.com/kf/HTB19_5yc6gy_uJjSZLeq6yPlFXad/APDS-9960-APDS9960.jpg_640x640.jpg)
90+
![Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor](https://cdn-learn.adafruit.com/assets/assets/000/046/169/medium800/light_apds.jpg?1504716001)
91+
![GY-9960-LLC](https://ae01.alicdn.com/kf/HTB1kp4EpL9TBuNjy1zbxh4pepXaO/3Pcs-GY-9960-LLC-APDS-9960-RGB-Gesture-Sensor-Module-Board.jpeg_640x640.jpeg)
92+
![](https://ae01.alicdn.com/kf/HTB10vNSlhSYBuNjSsphq6zGvVXa9/RGB-Proximity-Sensor-Detection-Direction-Gesture-APDS9960-APDS-9960-Non-Contact-Module.jpg_640x640.jpg)
93+
![](https://ae01.alicdn.com/kf/HTB16R.JeUl7MKJjSZFDq6yOEpXah/APDS-9960-RGB-Ambient-Light-Short-range-Gesture-Module-Color-Module-Light-Module.jpg)
94+
95+
#### Where to get
96+
* ~ 2€ at [AliExpress](https://www.aliexpress.com/wholesale?catId=0&initiative_id=&SearchText=apds-9960)
97+
* ~ $8 at [Adafruit](https://www.adafruit.com/product/3595)
98+
99+
[APDS-9960 Datasheet](https://docs.broadcom.com/docs/AV02-4191EN)

0 commit comments

Comments
 (0)