Benutzer-Werkzeuge

Webseiten-Werkzeuge


hardware:venta_connected

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
hardware:venta_connected [2018/10/14 00:26] reinholdhardware:venta_connected [2018/10/28 20:37] (aktuell) – [section 5] reinhold
Zeile 6: Zeile 6:
 {{ :hardware:venta_lw45:venta_lw45_00_opened.jpg?direct&400 |}} {{ :hardware:venta_lw45:venta_lw45_00_opened.jpg?direct&400 |}}
  
-Now, since I have ZigBee temperature and humidity sensors in every room, I wanted to automate the humidifier and write rules in OpenHAB that would turn on the humidifier whenever the humidity falls below a threshold and also turn it off again once an acceptable level is reached. +Since I have ZigBee temperature and humidity sensors in every room, I wanted to automate the humidifier and write rules in OpenHAB that would turn on the humidifier whenever the humidity falls below a threshold and also turn it off again once an acceptable level is reached. 
  
 ===== 2. Investigating the electronics of the LW45 ===== ===== 2. Investigating the electronics of the LW45 =====
Zeile 33: Zeile 33:
   * To light up the error LED, pin 10 need to be pulled to GND.   * To light up the error LED, pin 10 need to be pulled to GND.
  
-All these steps can be easily done by any microcontroller used in smart home applications. The only problem is the power: The VCC is 24V and the levels of the LED pins are potentiall 24V!+All these steps can be easily done by any microcontroller used in smart home applications. The only problem is the power: The VCC is 24V and the levels of the LED pins are potentially 24V!
  
 ==== 3.1 Power supply: Step-down converter from 24V to 3.3V ==== ==== 3.1 Power supply: Step-down converter from 24V to 3.3V ====
  
-Initially, I tried a normal LN7805 voltage regulator, but that heated up too much, especially considering that the WiFi-PCB would be placed inside the humidifier inside the plastic enclosure with very little air flow. Instead, I'm using a 24V to 3.3V step-down converter.+The Venta LW45 humidifier is powered by an external 24V AC power supply, which should be strong enough to also power the microcontroller on my board. We simply use the VCC line of the 10-pin IDC ribbon cable and convert the 24V to the required 3.3V of the microcontroller.  
 + 
 +Initially, I tried a normal LN7805 voltage regulator, but that heated up too much, especially considering that the WiFi-PCB would be placed inside the humidifier'plastic enclosure with very little air flow. Instead, I'm using a 24V to 3.3V step-down converter to provide the 3.3V VCC to my own board. 
 + 
 +I do not, however, separate my own circuit with optocouplers from the Venta's circuit. This means that there is some chance that e.g. a broken comparator on my board might cause 24V to be fed into the microcontroller. That is a risk I'm willing to take, as in this case I'd rather replace the whole board anyway rather than trying to track down which device is fried. 
  
 ==== 3.2 Microcontroller and WiFi connection ==== ==== 3.2 Microcontroller and WiFi connection ====
Zeile 181: Zeile 186:
  
 ^ Command ^ Description ^ Arguments ^ ^ Command ^ Description ^ Arguments ^
-|ventapower STAT | Turn device on/off | STAT=0 to turn OFF, STAT1 to turn ON | +|''ventapower STAT'' | Turn device on/off | STAT=0 to turn OFF, STAT1 to turn ON | 
-|ventalevel LVL |Switch the power level | LVL=1,2,3 => switch to level; LVL=0 => turn off | +|''ventalevel LVL'' |Switch the power level | LVL=1,2,3 => switch to level; LVL=0 => turn off | 
-|ventapowerbtn |Emulate power button press, irrespective of the current status/level | - | +|''ventapowerbtn'' |Emulate power button press, irrespective of current status/level | - | 
-|ventalevelup |Emulate UP button press, irrespective of the current status/level | - | +|''ventalevelup'' |Emulate UP button press, irrespective of current status/level | - | 
-|ventaerrorled STAT  |Set status of error LED (turning off is not possible, unless is was manually set to ON) |STAT=1 to turn error LED ON, STAT=0 to turn error LED OFF | +|''ventaerrorled STAT''  |Set status of error LED (turning off is not possible, unless is was manually set to ON) |STAT=1 to turn error LED ON, STAT=0 to turn error LED OFF | 
-|ventaerrorflash DUR |Turn error LED ON for given duration  | duration in ms |+|''ventaerrorflash DUR'' |Turn error LED ON for given duration  | duration in ms | 
 + 
 +===== 7. Controlling the Humidifier in OpenHAB ===== 
 + 
 +I'm using [[http://www.openhab.org/|OpenHAB]] as my smart home controller, together with the MQTT broker mosquitto to relay messages from/to the ESPEasy devices. In ESPEasy I have set up an OpenHAB mqtt controller. 
 + 
 +To connect the Venta LW45 to OpenHAB, all I had to do was set up some items in an ''.items'' file (the MQTT binding does not have any visual setup, as it has not been ported to the OpenHAB 2.0 way of thinkin): 
 + 
 +  Switch Venta_Power  "Venta LW45 Ein/Aus"  <power> (power) { mqtt=">[mqtt:/Venta/Venta/cmd:command:ON:ventapower 1], >[mqtt:/Venta/Venta/cmd:command:OFF:ventapower 0], <[mqtt:/Venta/Venta/Power:state:MAP(OnOffBinary.map)]"
 +  Number Venta_Level  "Venta LW45 Level"    <power> (power) { mqtt=">[mqtt:/Venta/Venta/cmd:command:*:ventalevel ${command}], <[mqtt:/Venta/Venta/Level:state:default]"
 +  Switch Venta_Error  "Venta LW45 Error"    <alarm> (alarm) { mqtt="<[mqtt:/Venta/Venta/Error:state:MAP(OnOffBinary.map)]"
 + 
 +The ''OnOffBinary.map'' transformation file contains only the mapping of 1 to ON and 0 to OFF 
 +  1=ON 
 +  0=OFF 
 +  1.0=O 
 +  0.0=OFF 
 + 
 + 
 +To control the humidifier, one can now simply use these items in either a sitemap or in a [[https://community.openhab.org/t/design-your-svg-floorplan-or-dashboard-for-habpanel-with-inkscape/38441|SVG floorplan]]: 
 + 
 +  sitemap wohnung label="Wohnung" 
 +  { 
 +    Frame item=Temperatur_Wohnzimmer  label="Wohnzimmer"
 +      Switch  item=Venta_Power   label="Luftbefeuchter" 
 +      Switch  item=Venta_Level   visibility=[Venta_Power==ON]  mappings=[1="1",2="2",3="3" label="Luftbefeuchter Stufe" 
 +      Text    item=Venta_Error   visibility=[Venta_Power==ON]  label="Luftbefeuchter Fehler [%s]" 
 +    } 
 +  } 
 + 
 +{{ :hardware:venta_lw45:venta_lw45_openhab_sitemap.png?direct&400 |}} 
 + 
 +In my floorplan SVG, the humidifier looks like this and can be controlled by a simple click on the on/off icons or the level numbers: 
 + 
 +{{ :hardware:venta_lw45:venta_lw45_openhab_floorplan.png?direct&400 |}} 
 + 
 +===== 8. Downloads ===== 
 + 
 +I will [[https://gitlab.open-tools.net/SmartHome/VentaConnected|publish all material]] (schematics, PCB board designs, code, etc.) on [[https://gitlab.open-tools.net/SmartHome/VentaConnected|our gitlab installation]]. 
 + 
 +Here are the most important files for direct access: 
 +  * Eagle schematics .sch and board .brd:  
 +    * {{ :hardware:venta_lw45:ventaconnected_esp8266_v1.0_2018-10-06.sch }} 
 +    * {{ :hardware:venta_lw45:ventaconnected_esp8266_v1.0_2018-10-06.brd }} 
 +    * {{ :hardware:venta_lw45:ventaconnected_esp8266_v1.0_2018-10-06.pdf }} 
 +  * Gerber files:  
 +    * {{ :hardware:venta_lw45:ventaconnected_esp8266_v1.00_2018-10-06_gerbers.zip }} 
 + 
 +===== APPENDIX ===== 
 + 
 +The description of the project above describes the final result of my project, after many detours, dead ends and dead microcontrollers. Here, I want to give some experiences made during the project, as well as some background why I finally made the decisions documented above. 
 + 
 +1. I'm using the LM339 and LM393 dual and quad differential comparators to detect ON-levels of ~20V, because it practically does not allow any current to flow. First I tried a simple voltage divider (even with 1M resistors), but then the LEDs were always slightly lit. Apparently the LEDs used by Venta do not need much current to light up. This is not desired, so I needed some way of detecting a HIGH signal without any current flowing. The comparator seemed like the most obvious case. 
 + 
 +2. There are multiple different voltages all over the board. The Venta itself uses 24V, which we also need to use as the VCC of the comparators (as the input of the non-lit LEDs is usually ~20-21V). The ESP8266 uses 3.3V generated by a step-down buck converter. Finally, the comparator uses a 12V signal (generated by a simple voltage divider) to detect the status of the 21V LED pins. 
 + 
 +3. In the beginning I used traditional 2N2222 and 2N3904 NPN transistors with an appropriate base resistor. This caused some issued during startup (when the venta was plugged into the wall socket), so I switched to FET transistors with a pull-down to ensure that during startup no button press is emulated by floating transistors.
  
 +4. I initially designed the whole schematics and board with an ATmega328p and a nrf24l01+ 2.4GHz transceiver to connect to a [[http://www.mysensors.org/|MySensors]] network. This worked quite well, but it has the disadvantage of the MySensors gateway as single-point-of-failure. As my MySensors network has never been really stable (i.e. sooner or later the gateway would loose connection and not react any more at all), going with WiFi seemed like the more cautious approach. If anyone is interested, here are the schematics as well as some images of the breadboard prototype and the source code of the MySensors implementation:
  
 +  * Schematics: {{ :hardware:venta_lw45:arduino:ventaconnected_arduino_v0.01_2017-12-11.sch |}}, {{ :hardware:venta_lw45:arduino:ventaconnected_arduino_v0.01_2017-12-11.pdf |}}
 +  * Board (NOT tested, routing also not optimized): {{ :hardware:venta_lw45:arduino:ventaconnected_arduino_v0.01_2017-12-11.brd |}}
 +  * MySensors arduino sketch: {{ :hardware:venta_lw45:arduino:mysensors_ventaconnected.ino |}}
 +  * Pictures: {{:hardware:venta_lw45:arduino:venta_lw45_mysensors_00_breadboard.jpg?direct&100|}}{{:hardware:venta_lw45:arduino:venta_lw45_mysensors_02_breadboard.jpg?direct&200|}}{{:hardware:venta_lw45:arduino:venta_lw45_mysensors_03_prototype.jpg?direct&200|}}
 +(In the last picture one can see the error LED dimly lit, which is caused by the use of a voltage divider rather than the LM339/393 comparator...)
hardware/venta_connected.1539469574.txt.gz · Zuletzt geändert: 2018/10/14 00:26 von reinhold

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki