I wanted to open my door via fingerprints, so some mechanism for opening the door was needed.
Specifically, I wanted to open the door by pulling on the handle.
Additionally, cables where inacceptable. Hence, some low-power communication method and hardware were needed.
For this, BLEnky was the optimal tool, since it allows to use the low-power-features of the nRF52, without having to write any C code.
Actually, the only code needed was this gpioASM snippet:
label start
write_digital 100
sleep_ms 1
write_digital 110
sleep_ms 1
jump_count start 540
write_digital 000
This is the order of connections to the A4988 stepper driver:
- sleep
- step
- direction
Hence, writing 100 and 110 to the outputs enabled the driver and stepped 540 times.
Writing 000 disabled the driver.
To make the nrf51 with BLEnky run the code, I just have to send the bytes 00800001c1200101c52001b0029c0401c0 via my ESP mqtt to BLE gateway.
12 AA Batteries provide enough power to drive the stepper motor.
Comments