diff --git a/README.md b/README.md index 585fae3..f8ce5e9 100644 --- a/README.md +++ b/README.md @@ -25,25 +25,26 @@ The 3D models for the case are [here](STLs). ### Connecting the components -![Photo of schematics](https://github.com/adonno/tagreader/blob/master/Schematics/tag_reader_schematics_v1.png) +![Photo of schematics](Schematics/tag_reader_schematics_v2.png) There are not too many components to connect, but it does require soldering. You will need the following: - [Solder](https://s.click.aliexpress.com/e/_dT3S62j) - [Soldering iron with a fairly thin tip](https://s.click.aliexpress.com/e/_dXaI6nz) -- [About 40cm of thin wire (at least 6 different colors)](https://s.click.aliexpress.com/e/_dZvoYoB) +- [About 40cm of thin wire (at least 5 different colors)](https://s.click.aliexpress.com/e/_dZvoYoB) Also make sure that you have set the switches on the PN532 to the following: -- Switch 1: Off (down) -- Switch 2: On (up) +- Switch 1: On (up) +- Switch 2: Off (down) -This enables the PN532 module to communicate with the D1 over SPI, and is required for the modules to work together! +This enables the PN532 module to communicate with the D1 over I2C, and is required for the modules to work together! To flash the reader firmware to your D1 Mini you point ESPHome at [tagreader.yaml](tagreader.yaml). -**The tag reader requires ESPHome 1.15.2 or later.** +> :warning: The tag reader requires the *dev* version of ESPHome until `1.16.0` is released with the `pn532_i2c` component. -If you're new to ESPHome, we recommend that you use the [ESPHome Home Assistant add-on](https://esphome.io/guides/getting_started_hassio.html). +~~If you're new to ESPHome, we recommend that you use the [ESPHome Home Assistant add-on](https://esphome.io/guides/getting_started_hassio.html).~~ +The dev version of ESPHome is available after you add the ESPHome add-ons repository (https://github.com/esphome/hassio) to the Home Assistant Supervisor ![Open Case](docs/open-case.jpg) diff --git a/Schematics/Tag Reader Schematics.fzz b/Schematics/Tag Reader Schematics.fzz index c6d4719..4731917 100644 Binary files a/Schematics/Tag Reader Schematics.fzz and b/Schematics/Tag Reader Schematics.fzz differ diff --git a/Schematics/tag_reader_schematics_v1.png b/Schematics/tag_reader_schematics_v1.png deleted file mode 100644 index 7fc9cfd..0000000 Binary files a/Schematics/tag_reader_schematics_v1.png and /dev/null differ diff --git a/Schematics/tag_reader_schematics_v2.png b/Schematics/tag_reader_schematics_v2.png new file mode 100644 index 0000000..e7f6376 Binary files /dev/null and b/Schematics/tag_reader_schematics_v2.png differ diff --git a/tagreader.yaml b/tagreader.yaml index b3fb93f..3569795 100644 --- a/tagreader.yaml +++ b/tagreader.yaml @@ -26,6 +26,13 @@ esphome: api.connected: - logger.log: API is connected! - rtttl.play: "success:d=24,o=5,b=100:c,g,b" + - light.turn_on: + id: activity_led + brightness: 100% + red: 0% + green: 0% + blue: 100% + flash_length: 500ms # Define switches to control LED and buzzer from HA switch: @@ -42,6 +49,8 @@ switch: # Enable logging logger: + # level: VERY_VERBOSE + # level: VERBOSE # Enable Home Assistant API api: @@ -63,18 +72,12 @@ api: # Enable OTA upgrade ota: -# Enable SPI interface -spi: - clk_pin: D0 - miso_pin: D1 - mosi_pin: D2 +i2c: + scan: False + frequency: 400kHz -# Configure the PN532 module -pn532: - cs_pin: D3 - update_interval: 2s - - # What happens when a tag is read +pn532_i2c: + id: pn532_board on_tag: then: - homeassistant.tag_scanned: !lambda 'return x;' @@ -98,7 +101,7 @@ pn532: # Define the buzzer output output: - platform: esp8266_pwm - pin: D8 + pin: D7 id: buzzer binary_sensor: @@ -113,7 +116,7 @@ rtttl: light: - platform: fastled_clockless chipset: WS2812 - pin: D7 + pin: D8 default_transition_length: 10ms num_leds: 1 rgb_order: GRB