# Han Mqtt Adapter

### Install
1. Setup picoW with MicroPython [link](https://www.raspberrypi.com/documentation/microcontrollers/micropython.html)
2. Copy main.py and config.py to picoW root
3. Edit config.py to correct SSID, Password and MQTT broker IP

### Protocol
[link to HAN protocol](https://hanporten.se/svenska/protokollet/)

### Hardware
Han port pinout (RJ12):
1. 5V (max 250mA)
2. Data request (connect to 5V to enable)
3. Data GND
4. NC
5. Data (TX 115200 inverted open drain)
6. GND

PicoW connection:
- Connect HAN port pin 1 and 2 to pico 5V
- Connect HAN port pin 3 and 6 to pico GND
- Connect HAN port pin 5 to pico 1 (RX)
- Add pullup resistor (15k) between Pico RX pin and 3V3

![front](20220814_231222.MEDIUM.jpeg)
![back](20220814_231229.MEDIUM.jpeg)
![mounted](20220814_231330.MEDIUM.jpeg)

