Replies: 20 comments 15 replies
-
|
Btw. the PWM output for controlling servos should be in the range of 1000-2000, I believe, since those are uS. |
Beta Was this translation helpful? Give feedback.
-
|
As I said, I'm quite a novice, so I think I'll need a lot of help 😅 This is my idea for the connections, it's very likely I'm doing things wrong:
My idea is to use a MOSFET module to completely shut down the servomotor when not in use and wake it up only when necessary, to save battery life. I have questions about programming both https://ble.nullco.de/ and the gpioASM part. For your example, you used the following: But as you say, the PWM output for controlling servos should be in the range of 1000-2000, but I don't know how to adapt it in code.
And I don't see Nice!Nano Promicro on the list of boards:
|
Beta Was this translation helpful? Give feedback.
-
|
You're right, the nice!nano is not on the list. Just chose a pin for the PWM output and set it to analog output. |
Beta Was this translation helpful? Give feedback.
-
|
Hello again, the project is progressing little by little. I share a video of a small test sequence: 1811d3d8-478b-4f51-bdd0-f670698664f1.MP4This is the sequence in https://ble.nullco.de/:
With 1000 uS the servomotor rotates clockwise, at 1500 uS it stops and at 2000 uS it rotates counterclockwise. My purpose, as you said before, is to control everything from Home Assistant, using an ESP32 as a Border Router, in Home Assistant it is very easy to do using them as a Bluetooth Proxy (https://esphome.io/projects/?type=bluetooth). My question is whether with the Bluetooth proxy in active mode, the ESP32 will automatically detect the Promicro NRF52840 board. If I'm not mistaken, it's the same thing you do, but I don't know what firmware you use on the ESP32, I use Esphome: Another question I have is about energy consumption. Do you use anything to optimize consumption? Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
Heyo good job so far! I am personally using my ble mqtt bridge, also somewhere on my GitHub. I am thinking a lot about HA, not sure it supports the Automation IO protocol for now. Regarding power consumption: I personally use AA batteries, since those spit out 3v. Last thing to consider it the leakage through the PWM pin when the servo is shut down, you'll have to measure that, but we'll find a solution. Lastly, generating PWM consumes a lot of power, so make sure so reset the PWM signal to 0 when not in use. BLEnky goes into system on mode by default. |
Beta Was this translation helpful? Give feedback.
-
|
Heyo, how's progress so far? There are some new considerations to make regarding power consumption, as stated in the pro micro documents. How big is your battery? |
Beta Was this translation helpful? Give feedback.
-
|
I haven't been able to make much progress since last time; I haven't had much time. I think I'll follow your advice and use AA batteries, about 8 maybe. I understand that to get 3V, I must connect two groups of 4 batteries, each group connected in parallel and between the two groups connected in series, to get 3V. I will follow the guide you made here: https://github.com/dakhnod/BLEnky/blob/main/docs/boards/PRO_MICRO.md On the other hand, I would like to know if it is possible to deactivate the LED on the top left that keeps flashing blue, which I understand must increase consumption. |
Beta Was this translation helpful? Give feedback.
-
|
the configuration you described is called 2s4p or 4p2s, not sure about the order. The LED is disabled if you apply 3V over something else than USB. I am personally using a stepper motor, and I can just disable the driver, which makes the spring in the door handle automatically unwind the string from the axis. This will probably not work for a servo, so you have to thing abour some synchronization method like an endstop. If you feed in voltage directly to the nRF51, as should be the case through the pad on the back, BLEnky provides you with the battery percentage and voltage already. |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for taking so long, but I've been short on time for this lately. I've modified the wiring following your advice. In test mode, I used a 2P2S battery configuration, so I'm feeding a maximum of 3.6V through the VDD and GND pins when the batteries are fully charged, and surprisingly, I can feed the servomotor 4.8V without any resistors or converters. 2025-04-29.19.33.56.mp4At this point, I have two options: either you give the wonderful world of Home Assistant a try and avoid having to learn how to use your MQTT BLE bridge (in Home Assistant, I use the Mosquitto broker addon for MQTT). Or, learn how to use your MQTT BLE bridge and try to integrate it somehow with Home Assistant so I can control the servomotor with the mobile app and not rely solely on the web https://ble.nullco.de/. *Another question, about the https://ble.nullco.de/, is the "Device battery level" value real with the connection I have made? |
Beta Was this translation helpful? Give feedback.
-
|
@crozo5 The battery level relies on the input voltage between 1.8 and 3.0V and is only reliable if you feed the voltage directly to the nRF through the back via. I am not against HomeAssistant, I just haven't gotten around to tapping into it. It would surely be an important milestone. For now, the MQTT bridge should be a matter of flashing the firmware, configuring WiFi, adding the MAC address to the config and posting the right MQTT message.
Sidenote: have you solved the synchronization I mentioned somehow? |
Beta Was this translation helpful? Give feedback.
-
I have connected the power supply through the back of the board, I have installed the nRF Connect app and I see that a feature called Battery Level appears with a value of 86. Does this mean that the battery is at 86%? My idea is to make a smart lock more similar to the one shown in this video https://youtu.be/4-wtu9toda0?si=vScgk6bwLyE21__O, but directly using a board with Bluetooth such as the PicoPro NRF52840 or the Xiao BLE, instead of using an ESP8266 or ESP32.
Where can I find the firmware you are referring to? Thanks |
Beta Was this translation helpful? Give feedback.
-
|
Heyo, I am referring to this project: https://github.com/dakhnod/esp32-ble2mqtt. Still, how are you planning on solving the synchronization? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I don't think I have enough level to compile it by myself 😅 hehehe
In Home Assistant (with Esphome) it's very easy, you just have to add this code: Note:
Where and how can I extract the bytes? Thanks |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
For everyone reading along: I have provided @crozo5 with a firmware containing his desired Pin. While the firmware works with the nRF Connect App and asks for the Pin, ESPHome seems to have issues with the Pin. That could be related to the bonding type which, I believe, is BT classis and not BLE with BLEnky. |
Beta Was this translation helpful? Give feedback.
-
|
To improve the Smart Lock project, I would like to connect a digital (I2C) current measurement sensor like the INA219 so that, in case the servo motor gets stuck or if I have previously opened the lock manually, leaving the lock in an intermediate position, neither completely closed (2 turns of the key counterclockwise) nor completely open (2 turns of the key clockwise), and I activate it to open or close the lock, it does not force the motor once it reaches the opening or closing stop. Is there a way with four firmware to read the Ampere measurements? |
Beta Was this translation helpful? Give feedback.
-
|
This one is tricky. While the nRF51 is obviously able to communicate via I2C, BLEnky currently only supports the BMA400 accelerometer, which is of little use to you. You may be able to use some analog measurement circuitry and read the signal through a gpio, and use a potentiometer to calibrate the threshold. I assume that using an endstop is not an option since you are doing multiple rotations? |
Beta Was this translation helpful? Give feedback.
-
|
This is my progress on this project, I continue testing with different engines and drivers. In previous comments I have already shown how I did it with a servo motor, now I will show how I will do it with a Nema14 stepper motor and with a N20 DC motor. 1) Nema14 Stepper Motor: In this case I use 3 16340 batteries in series, with which I get about 11.1V to power the stepper motor, then I use an MP1584 to go from 11.1V to 3.3V to power the MicroPro board, the A4988 driver and the WCS2702 module that I use to detect if the motor is stuck. This would be the GPIOASM code that I use: Lock: Unlock: 0.13 --> Digital Output (LDO OFF ProMicro) 2) N20 DC Motor: In this case, I used an 800mAh 3.7V LipO battery to power everything. I used the L298N Mini driver to control the DC motor, and the WCS2702 to detect stalling. This would be the GPIOASM code that I use: Lock: Unlock: 0.02 --> Digital Input (WCS2702) |
Beta Was this translation helpful? Give feedback.
-
|
Another improvement for this project that I would like to implement is to create a wireless keyboard with a fingerprint sensor. R503 Capacitive Fingerprint Reader: I saw in your video that you also use a fingerprint sensor to open the lock, I saw the link to the project that you left in the description, but I don't understand it much 😅 hehehe. Could you give me a hand? I'd like to do it with another ProMicro board. |
Beta Was this translation helpful? Give feedback.





















Uh oh!
There was an error while loading. Please reload this page.
-
This discussion is supposed to aid with the process of recreating the smart door lock from https://www.hackster.io/dakhnod/battery-powered-door-lock-opener-2aada7.
@crozo5, how's progress?
Beta Was this translation helpful? Give feedback.
All reactions