Ir para conteúdo
3DFinder
Entrar

Você está no 3DFinder

Buscamos em Thingiverse, MakerWorld e Printables ao mesmo tempo para te dar o melhor de cada uma.

Buscar mais como este
Modelo 3D D1 Mini with Reed Switch Case por JR no MakerWorld

Descrição

This is a case with a snap on back for a reed switch connected to a D1 mini that can be used as a door/window sensor.

 

The reed switch is connected to pins D2 and GND. There is the option power the D1 mini by USB or hard wire it to a 5V power supply, where the wires can pass through the top of the case. To hard wire it to a 5V supply the connection needs to be to the 5V pin and GND.

 

The D1 mini can be snapped into place inside the case, and the case has a horizontal marker at the front indicating the position of the reed switch so it can be aligned to the magnet.

 

I find these switches are ideal where there is a permanent power supply and they are incredibly reliable. They can be setup in ESPHome in Home Assistant and used to run various automations and notifications. Below is the yaml code for the switch:

esphome:
 name: "garage-door-sensor
 friendly_name: Garage door sensor 
 

esp8266:
 board: d1_mini

# Enable logging
logger:

 

# Enable Home Assistant API
api:
 encryption:
   key: "your_encryption_key"

 

ota:
- platform: esphome
 password: "your_ota_password"


wifi:
 ssid: !secret wifi_ssid
 password: !secret wifi_password
 power_save_mode: NONE

 ap:
   ssid: "Garage door sensor"
   password: "your_ap_password"

sensor:

 - platform: uptime
 
   name: "Uptime"  
 

 - platform: wifi_signal
   name: "Wi-Fi Signal Strength"
   update_interval: 30s


binary_sensor:
 - platform: gpio
   pin:
     number: D2
     mode: INPUT_PULLUP  # Uses internal pull-up resistor
     inverted: false  # Invert if using NO switch
   name: "Door"
   device_class: garage_door
   filters:
     - delayed_on: 50ms
     - delayed_off: 100ms
   on_press:
     - lambda: ESP_LOGD("Garage door sensor", "Open");
   on_release:
     - lambda: ESP_LOGD("Garage door 2 sensor new", "Closed");

 

text_sensor:
 - platform: wifi_info
   ip_address:
     name: "IP"

 

MakerWorld

D1 Mini with Reed Switch Case

Publicado em 16 de mar de 2025

1
Curtidas
5
Downloads
3
Coleções
2
Impressões
Categoria Other Tools
Tags
d1 mini esp32 reed switch case door sensor window sensor open sensor close sensor
Licença BY-NC
Ver no MakerWorld (abre em nova aba)

Gostou deste modelo? Crie uma conta grátis para salvar seus favoritos e voltar a eles depois.

Criar conta