#Need help with esphome wiring mosfet and electric lock

1 messages · Page 1 of 1 (latest)

boreal sparrow
#

I am trying to uild a electric lock for testing usage. I have an power adapter from 230 to 12V connected to an Mosfet trigger module. From the trigger module the electric lock is connected that needs 12V and connected esp to it.

switch:

  • platform: gpio
    id: mag_lock
    name: "Lock Switch"
    internal: false
    pin: GPIO17
    restore_mode: restore_default_on
    icon: mdi:magnet
    on_turn_on:
    • lambda: id(schacht_luke).publish_state(LOCK_STATE_LOCKED);
      on_turn_off:
    • lambda: id(schacht_luke).publish_state(LOCK_STATE_UNLOCKED);

lock:

  • platform: template
    name: "schacht_lucke"
    id: schacht_luke
    lock_action:
    • switch.turn_on: mag_lock
    • logger.log: "Door Locked!"
      unlock_action:
    • switch.turn_off: mag_lock
    • logger.log: "Door Unlocked!"

This is my ESP code, i think it works because i can click lock or unlock and see an led on the Mostfet board toggle on/off. But the lock is not doing anything. Not sure if i did something on the wiring wrong or maybe miss something in the code. Can anyone help here?

boreal sparrow
#

Or does this kind of lock not work with Mosfet and just needs an relay switch? Does anyone then has a wiring diagram for me?

hidden hearth
#

measure the voltage on the output pins to see if the 12v is switching when you toggle the switch, also confirm that 12v is going in on the inputs

boreal sparrow
#

How should I measure it with what tool? Anything from Amazon you can recommend?