Difference between revisions of "Omnindoor"

From Sudo Room
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[File:Omnindoor-ESP32-wiring.png|thumb]]
[[File:Omnindoor-ESP32-wiring.png|thumb]]
{| class="wikitable"
{| class="wikitable"
|+ Caption text
|+ Caption text
|-
|-
! Header text !! Header text
| Pin || thing || Mode in Tasmota Configure Unit menu || connection
|-
|-
| Pin || thing || Mode in Tasmota Configure Unit menu
| 4 || lock || Relay 1 || controls the motor lock-direction relay
|-
|-
| 4 || forward || Power
| 32 || unlock || Relay 2 || controls the motor unlock-direction relay
|-
|-
| 14 || reverse || Power
| 33 || current || ADC Current 1 || measures the voltage of motor shunt resistor
|-
|-
| 33 || current || ADC Current (bottom of list)
| 36 || battery voltage || ADC Current 2 || battery voltage minus 3x6.2v zeners, 10KΩ to 5.1KΩ resistor divider
|-
| Example || Example
|-
| Example || Example
|-
| Example || Example
|}
|}


curl -u "admin:password" http://10.111/cm?cmnd=power1+1


{"POWER1":"ON"}0jake@eg:~/sketchbook/omnindoor$ curl -u "admin:password" http://10.111/cm?cmnd=POWER1+off
rules so that motor direction gets activated, with a timeout. But if current limit hits, then cancel
 
{"POWER1":"OFF"}0jake@eg:~/sketchbook/omnindoor$ curl -u "admin:password" http://10.111/cm?cmnd=rule1+1


{"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":0,"Free":511,"Rules":""}}
Rule1 ON Power1#state=1 DO backlog Delay 50; Power1 0 ENDON
rule1 1
Rule2 ON Power2#state=1 DO backlog Delay 50; Power2 0 ENDON
rule2 1
Rule3 ON ANALOG#Voltage1>80 DO Power1 0; Power2 0 ENDON
rule3 1
(100 is too low, limit sometimes trips before motor starts moving, 200 is a lot)


turn off when limit current hit
set the adc range https://tasmota.github.io/docs/ADC/ (note1: mode 6 is ADC Range, but 33 is what the software returns for some reason, so we just set 33.  note2: these numbers are not calibrate to any actual current or voltage scales, just random numbers)
AdcParam1 33, 0, 4095, 0, 100
AdcParam2 36, 0, 4095, 0, 3.3


Rule2 ON ANALOG#Voltage1>100 DO Power1 0 ENDON
in the console (or by curl) you can view the rules and adcparam


set the adc range
CMD: rule1
RSL: RESULT = {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":54,"Free":457,"Rules":"ON Power1#state=1 DO backlog Delay 100; Power1 0 ENDON"}}
CMD: rule3
RSL: RESULT = {"Rule3":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":40,"Free":471,"Rules":"ON ANALOG#Voltage1>80 DO Power1 0 ENDON"}}
CMD: adcparam1
RSL: RESULT = {"AdcParam1":[33,0,4095,0,100]}


AdcParam 6, 0, 4095, 0, 1024
"The ESP32 board has four ADC GPIO pins available (gpio34, gpio35, gpio36, gpio39) which can be used for analog inputs. These can be used to read voltage at the ADC pin or to read the module supply voltage (VCC). All analog input pins support 3.3V."

Latest revision as of 13:05, 20 November 2024

Omnindoor-ESP32-wiring.png
Caption text
Pin thing Mode in Tasmota Configure Unit menu connection
4 lock Relay 1 controls the motor lock-direction relay
32 unlock Relay 2 controls the motor unlock-direction relay
33 current ADC Current 1 measures the voltage of motor shunt resistor
36 battery voltage ADC Current 2 battery voltage minus 3x6.2v zeners, 10KΩ to 5.1KΩ resistor divider
curl -u "admin:password" http://10.111/cm?cmnd=power1+1

rules so that motor direction gets activated, with a timeout. But if current limit hits, then cancel

Rule1 ON Power1#state=1 DO backlog Delay 50; Power1 0 ENDON
rule1 1
Rule2 ON Power2#state=1 DO backlog Delay 50; Power2 0 ENDON
rule2 1
Rule3 ON ANALOG#Voltage1>80 DO Power1 0; Power2 0 ENDON
rule3 1
(100 is too low, limit sometimes trips before motor starts moving, 200 is a lot)

set the adc range https://tasmota.github.io/docs/ADC/ (note1: mode 6 is ADC Range, but 33 is what the software returns for some reason, so we just set 33. note2: these numbers are not calibrate to any actual current or voltage scales, just random numbers)

AdcParam1 33, 0, 4095, 0, 100
AdcParam2 36, 0, 4095, 0, 3.3

in the console (or by curl) you can view the rules and adcparam

CMD: rule1
RSL: RESULT = {"Rule1":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":54,"Free":457,"Rules":"ON Power1#state=1 DO backlog Delay 100; Power1 0 ENDON"}}
CMD: rule3
RSL: RESULT = {"Rule3":{"State":"ON","Once":"OFF","StopOnError":"OFF","Length":40,"Free":471,"Rules":"ON ANALOG#Voltage1>80 DO Power1 0 ENDON"}}
CMD: adcparam1
RSL: RESULT = {"AdcParam1":[33,0,4095,0,100]}

"The ESP32 board has four ADC GPIO pins available (gpio34, gpio35, gpio36, gpio39) which can be used for analog inputs. These can be used to read voltage at the ADC pin or to read the module supply voltage (VCC). All analog input pins support 3.3V."