<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node]]></title><description><![CDATA[<p dir="auto">The trigger to start this project was remarking, for the umpteenth time in the morning, that the door had been unlocked again all night.<br />
Replacing the mechanical locks on the 4 doors by electric locks was out of the question, too expensive and the need for electric cables that were not present.</p>
<p dir="auto"><strong>So, how to detect if a mechanical lock is closed?</strong></p>
<p dir="auto">The internet is an incredible source of ideas:<br />
<a href="https://community.home-assistant.io/t/how-i-made-my-dumb-locks-a-little-smarter/55174" rel="nofollow ugc">https://community.home-assistant.io/t/how-i-made-my-dumb-locks-a-little-smarter/55174</a><br />
<a href="https://community.home-assistant.io/t/i-made-a-simple-lock-sensor-with-xiaomi-door-sensor-some-battery-holders-and-a-soldering-iron/49445" rel="nofollow ugc">https://community.home-assistant.io/t/i-made-a-simple-lock-sensor-with-xiaomi-door-sensor-some-battery-holders-and-a-soldering-iron/49445</a><br />
With this idea, let the bolt close a contact, I could use the standard window/door sensor node!<br />
So I made my version by using springs I found in my junk bin mounted on a piece of wood, namely the wooden stick of an ice cream 😊<br />
My first prototype was working, but not really a piece of art ☹</p>
<p dir="auto"><img src="/assets/uploads/files/1609186609491-20201104_172524-resized.jpg" alt="20201104_172524.jpg" class=" img-fluid img-markdown" /><br />
Remember to always drill holes because the wood of the stick splits very easily.</p>
<p dir="auto">I did use battery springs for my other nodes, they are stronger and easier to use.</p>
<p dir="auto"><strong>The battery-based windows/door sensor node : hardware</strong></p>
<p dir="auto">I had never built a battery based node before, so as a first step,  I did read the site article on the MySensors site: <a href="https://www.mysensors.org/build/battery" rel="nofollow ugc">https://www.mysensors.org/build/battery</a></p>
<p dir="auto">Luckily, I already had Pro Mini's and enough RFM69HW radios in stock.<br />
Today I know that I did probably the wrong choice by using the Pro Mini’s. They are good in low consumption, but a bare bone 328P used like in this topic <a href="https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node">https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node</a> is still better...<br />
But we will see how far these Pro Mini’s will take us on 2x AA batteries!</p>
<p dir="auto">My first node was based on the idea to use the same enclosure as in the above topic. In Belgium these cable ducts are known under the name Legrand and I had a still a piece of more then 1 meter lying around, a surplus from the renovations.</p>
<p dir="auto"><img src="/assets/uploads/files/1609186820986-20201109_114415-resized.jpg" alt="20201109_114415.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1609186842068-20201104_122033-resized.jpg" alt="20201104_122033.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1609186862670-20201104_172513-resized.jpg" alt="20201104_172513.jpg" class=" img-fluid img-markdown" /><br />
Because I used a Pro Mini and not a bare bone 328P, I was obliged to use 2 covers of the cable duct instead of a cover and base. The base of the cable duct was not broad enough for the Pro Mini.</p>
<p dir="auto">With the hardware tricks of the MySensor battery node site article on the Pro Mini, I could obtain a current consumption of 133µA in deep sleep (Modified Pro Mini, RFM69HW and the open contact).</p>
<p dir="auto">To minimize the current with a closed contact, I did not use the internal pull-up resistor of the 329P (internal pullup resistor value around 30KOhm), but an external 1M ohm resistor. With closed contact and deep sleep, I have now around 136µA.</p>
<p dir="auto"><img src="/assets/uploads/files/1609186989559-arduino-pro-mini-lock-battery-sensor.jpg" alt="Arduino Pro Mini Lock Battery Sensor.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto"><strong>The battery-based windows/door sensor node : software</strong><br />
Besides the hardware modifications done at the Pro Mini, you can also do software modifications to save power consumption.<br />
In the same topic <a href="https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node">https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node</a>, the author <a class="plugin-mentions-user plugin-mentions-a" href="/user/m26872" aria-label="Profile: m26872">@<bdi>m26872</bdi></a> mentioned the use of a new bootloader with a 1MHz internal clock and a BOD (cpu brown out) disabled.</p>
<p dir="auto">Today (2020-12-28) we can use the github project MiniCore <a href="https://github.com/MCUdude/MiniCore" rel="nofollow ugc">https://github.com/MCUdude/MiniCore</a> to program our Arduino Pro Mini with the new bootloader. See the readme of the project MiniCore on Github. It explains everything: the theory, the installation and the Getting Started.</p>
<p dir="auto">After installing MiniCore, I used following configuration:</p>
<ul>
<li>board : ATmega328</li>
<li>clock : internal 1 MHz</li>
<li>BOD : BOD 1.8V</li>
<li>EEPROM : EEPROM retained</li>
<li>Variant : 328P / 328PA</li>
<li>Bootloader : Yes (UART0)</li>
</ul>
<p dir="auto"><em>Remark 1</em><br />
I did not disable completely the BOD. Why? I did read on forums that the processor could write garbage into the memory when below 1.8V, so for safety’s sake, I did set it to 1.8V.<br />
<em>Remark 2</em><br />
There are reports that using the Arduino Pro Mini at internal 1Mhz gives sometimes problems with the MySensors library. It was not clear to me if it was with the 1.x version of MySensors or the 2.x version, so I did take my chance and used 1MHz with the 2.3 version of MySensors. Till now, no problems!</p>
<p dir="auto">You must program the bootloader with an ISP. I used my ‘Arduino as ISP’. See <a href="https://forum.mysensors.org/topic/11444/using-an-arduino-uno-as-isp-for-programming-5v-and-3-3v-boards-without-soldering-the-needed-connections">https://forum.mysensors.org/topic/11444/using-an-arduino-uno-as-isp-for-programming-5v-and-3-3v-boards-without-soldering-the-needed-connections</a></p>
<p dir="auto"><em>Remark</em><br />
If your pro mini is already connected to the RFM69HW radio, D11, D12 and D13 are used as MISO, MOSI and SCK for the radio.<br />
These pins are also used to program the bootloader.<br />
This will affect each other. The ISP programmer will not be able to detect the device ID and will fail. You must disconnect these 3 lines from the radio module, the time to (re)program the bootloader.</p>
<p dir="auto"><img src="/assets/uploads/files/1609187159564-20201111_171045-resized.jpg" alt="20201111_171045.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">You can find the used sketch at <a href="https://github.com/ericvb/MySensorsArduinoSketches/tree/master/sketches/ArduinoProMiniLockDoorBatterySensorWithEncryptionGithub" rel="nofollow ugc">https://github.com/ericvb/MySensorsArduinoSketches/tree/master/sketches/ArduinoProMiniLockDoorBatterySensorWithEncryptionGithub</a></p>
<p dir="auto">So in a nutshell:</p>
<ol>
<li>first program the bootloader via minicore (Arduino IDE : burn bootloader)</li>
<li>download the sketch via your normal USB to TTL programmer using the rx, tx, dtr, gnd pins (Arduino IDE : Upload)</li>
</ol>
<p dir="auto"><strong>The battery-based windows/door sensor node : 3D printing enclosure</strong></p>
<p dir="auto">Because I had to use the cover of the cable duct as base for the Pro Mini, I decided to design a case with approximately the same dimensions.<br />
The dimensions were dictated by the available space in the PVC door frame, the dimensions of the Pro Mini, the RFM69HW, the 2 AA batteries and the minimum possible printed thickness still solid by my 3D printer:</p>
<ul>
<li>Length : 200mm</li>
<li>Width: 20mm</li>
<li>Height: 17mm</li>
</ul>
<p dir="auto">You can find the design (open source FreeCAD) and STL files at: <a href="https://www.thingiverse.com/thing:4659402" rel="nofollow ugc">https://www.thingiverse.com/thing:4659402</a><br />
The last months the thingiverse website has many problems, designs are not visible, 404 messages, etc.<br />
Post a note if you don't find the 'thing'</p>
<p dir="auto"><img src="/assets/uploads/files/1609187396106-20201105_211946-resized.jpg" alt="20201105_211946.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1609187407779-20201106_091734-resized.jpg" alt="20201106_091734.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1609187417275-20201112_131521-resized.jpg" alt="20201112_131521.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1609187431786-20201114_133327-resized.jpg" alt="20201114_133327.jpg" class=" img-fluid img-markdown" /><br />
<img src="/assets/uploads/files/1609187442451-20201114_161832-resized.jpg" alt="20201114_161832.jpg" class=" img-fluid img-markdown" /><br />
The sensor is fastened with Velcro strips to prevent damage to the door caused by using fixing screws.</p>
<p dir="auto"><strong>References</strong></p>
<p dir="auto">Via following links, you can find more information about minimal power consumption, bootloaders, etc.<br />
Low power Pro Mini</p>
<p dir="auto"><a href="https://www.mysensors.org/build/battery" rel="nofollow ugc">https://www.mysensors.org/build/battery</a><br />
<a href="https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node">https://forum.mysensors.org/topic/2067/my-slim-2aa-battery-node</a><br />
<a href="https://forum.mysensors.org/topic/486/my-2aa-battery-sensor">https://forum.mysensors.org/topic/486/my-2aa-battery-sensor</a><br />
<a href="https://iot-playground.com/blog/2-uncategorised/10-low-power-door-window-sensor" rel="nofollow ugc">https://iot-playground.com/blog/2-uncategorised/10-low-power-door-window-sensor</a><br />
<a href="https://iot-playground.com/blog/2-uncategorised/9-arduino-low-power-sensor" rel="nofollow ugc">https://iot-playground.com/blog/2-uncategorised/9-arduino-low-power-sensor</a><br />
<a href="http://www.gammon.com.au/power" rel="nofollow ugc">http://www.gammon.com.au/power</a><br />
<a href="https://www.iot-experiments.com/arduino-pro-mini-power-consumption/" rel="nofollow ugc">https://www.iot-experiments.com/arduino-pro-mini-power-consumption/</a><br />
<a href="https://forum.pimatic.org/topic/383/tips-battery-powered-sensors/" rel="nofollow ugc">https://forum.pimatic.org/topic/383/tips-battery-powered-sensors/</a></p>
<p dir="auto">Battery consumption</p>
<p dir="auto"><a href="https://forum.mysensors.org/topic/10426/ds18b20-on-2xaaa-battery">https://forum.mysensors.org/topic/10426/ds18b20-on-2xaaa-battery</a><br />
<a href="https://andreasrohner.at/posts/Electronics/How-to-modify-an-Arduino-Pro-Mini-clone-for-low-power-consumption/" rel="nofollow ugc">https://andreasrohner.at/posts/Electronics/How-to-modify-an-Arduino-Pro-Mini-clone-for-low-power-consumption/</a></p>
<p dir="auto">Specific commercial hardware</p>
<p dir="auto"><a href="https://www.canique.com" rel="nofollow ugc">https://www.canique.com</a>   (power efficient board with RFM69HW)<br />
<a href="https://www.tindie.com/stores/easysensors/" rel="nofollow ugc">https://www.tindie.com/stores/easysensors/</a><br />
<a href="https://www.tindie.com/products/vysocan/rfm69-radio-node-mini/" rel="nofollow ugc">https://www.tindie.com/products/vysocan/rfm69-radio-node-mini/</a></p>
<p dir="auto">Use of bootloaders</p>
<p dir="auto"><a href="https://www.iot-experiments.com/arduino-pro-mini-1mhz-1-8v/" rel="nofollow ugc">https://www.iot-experiments.com/arduino-pro-mini-1mhz-1-8v/</a><br />
<a href="https://forum.mysensors.org/topic/7296/how-to-burn-fuses-so-that-pro-mini-3-3v-would-go-down-to-1-8v-solved/17">https://forum.mysensors.org/topic/7296/how-to-burn-fuses-so-that-pro-mini-3-3v-would-go-down-to-1-8v-solved/17</a><br />
<a href="https://forum.mysensors.org/topic/3018/tutorial-how-to-burn-1mhz-8mhz-bootloader-using-arduino-ide-1-6-5-r5">https://forum.mysensors.org/topic/3018/tutorial-how-to-burn-1mhz-8mhz-bootloader-using-arduino-ide-1-6-5-r5</a><br />
<a href="https://forum.mysensors.org/topic/3657/mymultisensors/144">https://forum.mysensors.org/topic/3657/mymultisensors/144</a><br />
<a href="https://forum.mysensors.org/topic/5478/how-to-get-longest-battery-life/42">https://forum.mysensors.org/topic/5478/how-to-get-longest-battery-life/42</a></p>
]]></description><link>https://forum.mysensors.org/topic/11499/checking-mechanical-locked-doors-by-a-battery-based-windows-door-sensor-node</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 14:55:43 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/11499.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Dec 2020 20:38:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Sat, 03 Sep 2022 06:14:52 GMT]]></title><description><![CDATA[<p dir="auto">Offtopic, but I like your bricks on your house</p>
]]></description><link>https://forum.mysensors.org/post/112964</link><guid isPermaLink="true">https://forum.mysensors.org/post/112964</guid><dc:creator><![CDATA[bjacobse]]></dc:creator><pubDate>Sat, 03 Sep 2022 06:14:52 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Thu, 01 Sep 2022 11:58:35 GMT]]></title><description><![CDATA[<p dir="auto">We are approximately 2 years later, a little follow-up :-)</p>
<p dir="auto">I had already noticed for a week of so that my 3 oldest sensors (including my prototype sensor) were no longer sending their status consistently. After checking the reported battery levels of the sensors I saw that there were around 50%, so that was normal... (50 % of 3V is 1.5V :-) , below the BOD of 1.8V)</p>
<p dir="auto">So the sensors with this design worked for about 20 months on 2 normal AA batteries of 1.5 V, not bad :-)</p>
]]></description><link>https://forum.mysensors.org/post/112957</link><guid isPermaLink="true">https://forum.mysensors.org/post/112957</guid><dc:creator><![CDATA[evb]]></dc:creator><pubDate>Thu, 01 Sep 2022 11:58:35 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Fri, 14 May 2021 02:56:20 GMT]]></title><description><![CDATA[<p dir="auto">This record is really detailed, thanks for sharing.</p>
]]></description><link>https://forum.mysensors.org/post/110233</link><guid isPermaLink="true">https://forum.mysensors.org/post/110233</guid><dc:creator><![CDATA[Ivanli]]></dc:creator><pubDate>Fri, 14 May 2021 02:56:20 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Tue, 04 May 2021 08:05:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/evb" aria-label="Profile: evb">@<bdi>evb</bdi></a> said in <a href="/post/110154">Checking mechanical locked doors by a battery-based windows/door sensor node</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/p359" aria-label="Profile: p359">@<bdi>p359</bdi></a> I have republished it and now I get the 'thing', no 404 anymore.<br />
Can you try again?</p>
</blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/evb" aria-label="Profile: evb">@<bdi>evb</bdi></a> , you're a champion, thanks so much, appreciated.</p>
]]></description><link>https://forum.mysensors.org/post/110161</link><guid isPermaLink="true">https://forum.mysensors.org/post/110161</guid><dc:creator><![CDATA[p359]]></dc:creator><pubDate>Tue, 04 May 2021 08:05:00 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Mon, 03 May 2021 15:16:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/p359" aria-label="Profile: p359">@<bdi>p359</bdi></a> I have republished it and now I get the 'thing', no 404 anymore.<br />
Can you try again?</p>
]]></description><link>https://forum.mysensors.org/post/110154</link><guid isPermaLink="true">https://forum.mysensors.org/post/110154</guid><dc:creator><![CDATA[evb]]></dc:creator><pubDate>Mon, 03 May 2021 15:16:27 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Mon, 03 May 2021 09:56:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/evb" aria-label="Profile: evb">@<bdi>evb</bdi></a> said in <a href="/post/108575">Checking mechanical locked doors by a battery-based windows/door sensor node</a>:</p>
<blockquote>
<p dir="auto">You can find the design (open source FreeCAD) and STL files at: <a href="https://www.thingiverse.com/thing:4659402" rel="nofollow ugc">https://www.thingiverse.com/thing:4659402</a><br />
The last months the thingiverse website has many problems, designs are not visible, 404 messages, etc.<br />
Post a note if you don't find the 'thing'</p>
</blockquote>
<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/evb" aria-label="Profile: evb">@<bdi>evb</bdi></a>, I'm seeing a 404, if you're able to link somewhere, would be interested to look at the files.  No drama if not, cheers</p>
]]></description><link>https://forum.mysensors.org/post/110151</link><guid isPermaLink="true">https://forum.mysensors.org/post/110151</guid><dc:creator><![CDATA[p359]]></dc:creator><pubDate>Mon, 03 May 2021 09:56:15 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Tue, 29 Dec 2020 08:55:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/canique" aria-label="Profile: canique">@<bdi>canique</bdi></a> The lock mechanism is a standard mechanical lock with a bolt and a normal key.<br />
When you turn the key for closing the lock, the bolt comes forward and pushes the two springs inwards, shorting the two springs.</p>
<p dir="auto">I'm using normally FreeCad for designing mechanical engineering things (Blender for more artistic things, like my fontain basin: <a href="https://www.thingiverse.com/thing:3374672" rel="nofollow ugc">https://www.thingiverse.com/thing:3374672</a>).<br />
Because I'm not designing much, I spend most of my time remembering and finding out how to do things again ;-)<br />
If I count every minute together with all the retries and corrections, 2 days, so let's say 16 hours?<br />
(not counting the print time of the prototypes).<br />
An experienced mechanical designer, when he have all the specs, can do this in less than an hour ;-)</p>
]]></description><link>https://forum.mysensors.org/post/108580</link><guid isPermaLink="true">https://forum.mysensors.org/post/108580</guid><dc:creator><![CDATA[evb]]></dc:creator><pubDate>Tue, 29 Dec 2020 08:55:29 GMT</pubDate></item><item><title><![CDATA[Reply to Checking mechanical locked doors by a battery-based windows&#x2F;door sensor node on Mon, 28 Dec 2020 22:51:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/evb" aria-label="Profile: evb">@<bdi>evb</bdi></a> I wonder what the lock mechanism looks like. Is it a key? Or some knob that you turn around?</p>
<p dir="auto">How long did it take you to design the case?</p>
]]></description><link>https://forum.mysensors.org/post/108578</link><guid isPermaLink="true">https://forum.mysensors.org/post/108578</guid><dc:creator><![CDATA[canique]]></dc:creator><pubDate>Mon, 28 Dec 2020 22:51:52 GMT</pubDate></item></channel></rss>