Show by Label

Thursday, December 19, 2024

LoRa Mail Letterbox Notification



This is the finished prototype. I will replace this picture with the finished PCB.


For quite some time, my wife asked me to "produce something useful" instead of the projects I have been busy spending time and money on.

We live in an apartment building on the 3rd floor (4 for Americans) and our mailbox is next to the entrance together with the other 39 inhabitants. It's a full metal construction with an aluminum lid.

The distance is far exceeding a WiFi connection, so a LoRa connection should solve the distance issue.

Proof of Concept

I experimented with two of the E32 433MHz boards and quickly got that up and running using Arduino Nano boards, with two simple sketches. One acting as the sender and one acting as the receiver with an acknowledgement going back to the sender to turn on an LED. Powering the sender one with a Powerbrick, I ventured a few times up and down the stairs to the mailbox to see if I could get a reliable connection from within the metal enclosure, which I did.

Extending the Proof of Concept

In order to make this more reliable and practical, I wanted to put the sender contraption into deep sleep to conserve power, and waking it up somehow when mail got delivered.

I first tried to use an LDR that would function as a wake-up for the system. Unfortunately, my first attempts failed. I think this is because the mailbox itself it dark, and opening the lid and shoving mail through the opening did not provide enough of a light differential to use it as the trigger. This is unreliable because the postman or woman stands in front of the mailbox, blocking light and that in the winter period is another obstacle.

Besides, the circuit to recognize the opening of the lid by means of an LDR would have to be powered 24x7 and that would drain the battery cell.

It would have been nice nonetheless, because all the parts could be in one enclosure.

Alas, I had to find a different method, preferably one that did not use any power but would be reliable. So, the next thing I wanted to try was to use a magnetic reed switch, typically used for signaling doors opening. I ordered one, but it turned out to be too bulky for this application. The magnet piece would have to be connected to the lid by either glue or double sided tape because I can't drill holes anywhere. This bulky magnet part would be exposed to the outside when the lid opens, and it's too easy to get nocked off with bulky packages.

The next step was to try a smaller motion activated switch by a mercury droplet, which I found after some searching on Aliexpress. I knew about the existence, but looked for a really tiny one.



The glass bulb is 11mm long and has a diameter of only 4mm.

Using a different lid opening sensor

I have been notified by a viewer of this Blog that the mercury sensor I'm using can break the glass and the very toxic Mercury can leak out. He mentioned an alternative solution by using a vibration sensor. 

Vibration sensor

I didn't know about them so I ordered a few and will try them out. I ordered the normal sensitivity one and also the sensitive version.

This is how they look on the inside: (I borrowed the picture below from Adafruit: https://www.adafruit.com/product/2384


I got the vibration sensor with the normal sensitivity and it is not working in this application. It needs quite a violent jolt to make contact, making it unreliable for the detection of the lid opening and closing. Maybe the more sensitive one works better?

I got the sensitive version, and tried that out. It indeed works a lot better, but have a look:


It produces a large number of these very fast pulses when you tilt it or tap it. For this project, that would still work, but it's not any more reliable or different enough to change it for the tilt sensor. It's more appropriate for a door or window sensor, registering a break-in attempt as an example.


Optical light sensor

I also got delivery of another optical sensor, the OPT101. Using a sensor that does not have to be fixed to the lid is a major improvement, because everything can then be built in one box, and there are no wires going to the sensor mounted on the lid.

I built a little prototype with it, and initially, it seemed to work very well, just waving my hand above it would activate it. However, when I put it in the carton shoebox that would mimic the letterbox, I did not get enough light on the sensor to make it work. It's not sensitive enough for this application, even though I increased the gain.



Optical PIR sensor

I also ordered a small IR motion detector, I saw it was used in a mailbox alarm project where the designer sold his result. It uses one of these small sensors.

When I tried it, it worked very well, even within the concocted shoebox replacement, but as I already feared, it only reacts on Infra-Red generated from warm bodies. In other words, it will only work when the postman puts a bare hand for the opening, but it does not react on any light. This will be a very unreliable detector for my particular mailbox. It may be better suited for the US mailboxes that have a much larger opening. I had high hopes for this sensor, but alas...


Tilt switch

The tilt switch I also found while searching for alternatives is so far the best replacement for the mercury switch I'm currently using. As you can see in the picture that I borrowed from Adafuit (https://learn.adafruit.com/tilt-sensor/overview), it uses two balls that roll around and make contact when the device is up-right. Same as the mercury switch.


The ones I ordered arrived and seem to work fine. I will replace the Mercury switch that is currently taped to the letterbox lid with this one soon.


Changing the processor

I had a few issues with putting the Nano to sleep, and waking it up. Also these boards are a tad too large to my liking as well, so I switched to the ESP8266 based WEMOS D1 boards. I use a number of them in my home, measuring many environmental "things" and I always have a number in spare to play with. They have enough available pins to interface to the LoRa board and they can be put into a deep sleep mode with one instruction, while they wake-up when the RST pin is momentarily pulled low.

I'm using a clone of the WEMOS D1 Mini, the GY-D1MINI. The major difference is that it uses a SCP2104 USB to UART bridge, instead of the CH340C, which calls for another USB driver on your PC.

Unfortunately, although there are many variations and models, I have not been able to find a schematic for this particular board.





The proof of concept prototype

To try out the concept, I put together the following circuit diagram, build that on protoboard, mounted it into a small plastic enclosure and mounted the contraption with double sided tape inside the letterbox.


To keep an eye on the Lipo cell voltage, I use the on-board ADC to measure the cell voltage. I used a 120K resistor that works together with the on-board attenuator to keep the voltage within the ADC range. 

To get a more reliable communication, the sender sends a text message that it has detected mail. This message gets verified by the receiver after it than sends an acknowledgement. The sender waits for the acknowledgement, but if not received after a short period, it sends the "I got mail" message again, up to 5 times. After receiving the acknowledgement from the receiver, it would also measure and send the cell voltage to the receiver. On the receiver side, I use an LED to signal a low voltage, set at 3.4V. Reading the cell voltage just after activating the LoRa board, which uses about 100mA while transmitting, ensures that the cell is at the lowest level when I measure it, although the voltage will creep back up a bit when the circuit is put to sleep again.

This worked really well until I did not get any alarms anymore. It turned out that the so called 500mAh Lipo cell drained before mail arrived so I did not get the low battery warning. Bummer! At that time, I set the cell voltage warning at 3.4V, but later I figured out that this was way too low. Due to the voltage drop over the 3V3 regulator, an ME6211 with 260mV dropout, it very well could have resulted in a voltage for the ESP8266 and the LoRa board that was below 3V, at which level they stop working reliably or at all.

First of all, the 500mAh cell capacity was inadequate to begin with, but it is what I had. I had measured the two cells I have several years ago and they showed to have a capacity of only 274mAh and 260mAh.

Because I used the on-board 3V3 regulator  on the WEMOS D1 mini, by the time the cell produced less than 4V, the 3V3 voltage regulator started to drop the voltage, so I did not get much of a useful capacity to start with. I knew that, so I ordered two new LiPo cells with 2000mAh capacity. When they arrived I put one into the letterbox.

Here is a discharging curve for the 2000mAh LiPo cells I'm now using:


This graph was generated by my DC Dynamic Load in the Battery Test mode. That recent design is described elsewhere on my Blog. It shows a couple of things. First of all the discharge curve was made with a constant 200mA (1/10th) of the rated 2000mAh for the cell. The measurement shows that it's not quite up to the specification at 1889mAh, but close enough. It took 9 1/2 hrs to discharge it from fully charged to the 3.0V cutoff setting. The sender circuit should draw about 20uA when in deep sleep, and about 100-150mA when the LoRa module is transmitting for a few seconds. 

When you look at the discharge curve, you see some hash that goes away after 210 minutes. This is only the second time I'm discharging the cell, and from other tests, I'm assuming that the hash can be attributed to the chemical reaction within the cell. This is why I use a 220uF capacitor to smoothen that.

More about the cell voltage later on.

I installed the prototype board into a small enclosure and taped it to the inside of the letterbox with double sided foam tape and used two thin wires that went to the mercury switch that I taped to the lid. I also mounted a small connector to be used for the LiPo cell such that I can replace it without opening the enclosure. The cell is also taped to the side of the letterbox.

This prototype is working really well for a few weeks now. They major issue is that normally, I do not get a lot of mail. There may be days without any. The cell voltage only gets send to the receiver when there is mail, so there is too much of an opportunity that the cell gets depleted before I get mail and I'm unaware of this. I need to find a way to avoid that.


The receiver

The receiver basically has the same ESP8266 and LoRa module, but the circuit is enhanced to give audible and visual information. The receiver is located in the apartment where we can hear it beep, see the LED's and reset the alarm.



This circuit is powered by a 5V USB wall wart connected to the WEMOS D1 mini micro USB input connector. There is a beeper/buzzer that will activate when mail is received and it will beep 5 times. An LED is turned on so you also have a visual indication that mail is received.

You can reset the alarm by a push button. 

Another LED will be turned on when the receiver is notified that the LiPo cell in the receiver module is below the cut-off voltage, I currently have that set at 4V or below.

I'm actually actually using the ADC input to measure the activity of the reset switch, because I can out of digital inputs. The D4 pin is connected to the on-board LED, so I don't want to use that.

At this moment, I'm programming the LoRa module with the standard configuration parameters at boot-up, because I have no other LoRa transmitters nearby. 

The parameters that I currently use for both devices are: 

    Adrs=0, Ser=8N1, 9600bd, Air=2.4Kbps, chan=23 and pwr=20dbm.



Enhancing the sender prototype

I needed a low voltage alarm for the LiPo cell that would wake-up the system and send a distress signal apart from the mail alarms. That took a bit more time to design, because the RST wake-up signal must be a momentary low, not a permanent one. So although I started out with a very simple low voltage indicator, testing showed that I needed a bit more logic to create a more reliable and correct wake-up signal to kiss it out of the deep sleep.

Below is the updated but still evolving schematic.




From left to right...
The LiPo voltage warning is generated by the comparator through the sense circuit R1, R2+R3 for a trigger at 3.2V. The output is going through a capacitor to create a negative going pulse that triggers the CMOS 555 timer. R6 and C4 create a pulse output of about 50mS, that needs to be inverted by an N-FET to drive the RST input momentarily low to wake-up the ESP. (I first used a transistor pair but was not happy about it and it also used quite a bit of power) I also have a voltage supervisor on order and may add that to the layout as an option. The comparator is one that I had left from another project, but you can use anything that fits the SOT 23-5 foot print.

So whenever the LiPo cell voltage is getting below 3.2V, a distress signal will be transmitted to the receiver, which in turn will switch on an LED so I can see that the LiPo needs to be swapped-out.

A cell voltage of 3V2 has enough head room for the voltage regulator to provide 3V1 to the circuits.

This section of the circuit is not yet implemented in the circuit that is now in the letterbox. It is still in prototype form on my desk (see below) because it's too finicky to implement that on protoboard. That will have to wait when I have fully tested the LiPo supply circuit and a PCB designed. More about that later.



The same Trigger input from the 555 is also connected to the activation switch that is fixed to the lid of the mailbox, in a position by which the switch gets closed when the lid is opened. This also creates a momentary negative going level on the RST input, waking it up for an "I got mail" message. This can be important when a larger package is stuffed in the mailbox that keeps the lid open. This 555 circuit will still produce a wakeup call. Without it, the ESP would be held in a permanent reset, and I would not get the "I have mail" message.

The LoRa board is connected to the ESP such that the ESP can initialize the LoRa board, and send or receive messages by using a software serial interface. That means that I can still use the Micro-USB port to upload new firmware and monitor what it is doing by using the hardware serial port.

I added a reverse polarity protection and a fuse for the Lipo connection to prevent a possible to short of the LiPo cell or destroying the components on the board when the wires to the LiPo connector are swapped. I'm using a key'd connector, but not all cells have the same pin-out.

I still measure and send the LiPo voltage every time there is a wake-up call through the on-board ADC. With the new circuit, that will happen when there is indeed mail, or when the cell voltage is too low. If I get the alarm and both LED's are on, I need to swap out the LiPo cell.

Right now, for the prototype that is in the mailbox, I first used the LiPo cell directly to feed the 5V input of the WEMOS. That worked well for quite some time, but to get more mileage out of the cell, I temporarily installed a little boost convertor module that uses the LiPo cell as the input, and I adjusted the output for a 5V1 voltage, and that goes to the 5V input of the WEMOS so there is a reliable 3V3 to power everything. I did find that the Lipo discharged after about 2 weeks already, partially due to the cold weather, but I need to investigate that further.

I added the components for the receiver to this schematic, so I can create one PCB that can be used for both, to save cost.

Using a LiPo cell to supply power

It took me a while to figure out how to do it, and it's not so obvious. Let me explain.

Supplying the +5V input?

The ME6211C33M5G on-board voltage regulator on the WEMOS D1 (and the clones) that creates the 3V3 rail, feeds the ESP8266 module itself and in this design, also the LoRa module. This is a voltage regulator that, according to the datasheet, should have a 120mV drop-out voltage at 100mA and 260mV at 200mA. I measured that the 3V3 output starts to drop at an input voltage of 3V4, which confirms that. When the LoRa is transmitting however, the current will go up, and the drop out voltage will raise with it.

This limit of at best 3V4 by directly feeding the LiPo cell into the 5V input is reducing the usable capacity of the cell to about half, see the discharge graph above. I want to try to wring some more life out of it, thereby extending the time I need to swap it out.
Technically it works, but for this application it is a no for me.

Supplying the 3V3 input?

Can I use the LiPo cell to directly feed the 3V3 voltage inputs to the ESP and the LoRa module?
The ESP-12F module which is on the ESP8266 WEMOS D1 mini, has a voltage rating of 3.0-3.6V. The E32-433T20D has a voltage rating of 3.0-5.5V. It seems the LiPo cell voltage can drop all the way to 3.1V to have a bit of a safety margin. 

Fully charged, the cell has a voltage of around 4V, which is too high for the ESP module. 
So this is also an obvious and definite no-no.

Using the LiPo with a different supply option

Using an "external" very low-drop voltage regulator will be the answer, and I already found one that is variable, because I don't need 3V3, but rather 3V1, which will be extending the cell capacity. What I found is the TPS 73101. LCSC carries the part so I ordered a few for a reasonable shipping & handling price.

Seems simple enough, but wait...
The problem to watch out for is going to be back-feeding from the 3V3 regulator on the WEMOS board when I connect the USB cable for debugging or uploading because there is no series diode or diode across the 3V3 regulator as protection on the WEMOS. The USB 5V has a series diode to prevent back feeding to the connected PC, see below. I need to make sure that the regulator I'm going to use to power everything never exceeds the 3V3 of the WEMOS regulator. That should not be a major issue because my plan is to use a 3V1 supply rail to get more mileage out of the LiPo cell.

Eliminating the USB 5V back feeding into to the circuit

This is only an issue when you connect the circuit to the PC through a USB cable for testing or uploading new firmware. It does no harm, but will mess with the voltages on the receiver board, in essence lifting them up to 3V3. If you want to prevent that from happening, there is a fix. Here is the relevant portion of the schematic that fits most WEMOS variants. There could also be a 100K resistor from the EN pin to GND on some boards.


The 5V comes in through the USB connector and is fed through a Schottky diode (D2) to prevent back-powering the PC when you apply 5V directly to the WEMOS board. (BTW, I have never seen the 500mA fuse used on all the different boards I have).

In any case, the +5V goes to the 3V3 voltage regulator U1 and also to the USB to UART chips.

The three WEMOS variants I have use the CP2104 or the CH340C USB to UART chip. Even though the 5V is going to these chips, they function without it. I tried.

So the most simple solution for the USB power back-feeding into our circuit is to remove the series diode on the WEMOS board, which will prevent the USB supply to feed the 3V3 regulator. This Schottky diode is D2 on the schematic and can be easily removed. I removed it and applied 3V3 to 3V0 to the 3V3 pin on the board to power it and everything, including the USB serial monitor still works on both of these boards.

The location of the diode is pointed to by the arrow for one of my clones.



On the other clone with the CP2104, the diode was located to the right of the 5V pin and is already removed.



With the diode removed, there is no +5V going to the 3V3 regulator on the WEMOS board anymore, so a further refinement could be to also pull the +5V pin on the connector for the WEMOS board to GND, because that will also pull the EN(able) input from the 3V3 regulator down, and disable it. I tried it and it worked, although I did not test the back-feeding by applying a voltage higher than 3V3 and see if the regulator survived.

If you want to go really go fool-proof, you could also remove the ME6211 from the WEMOS board.

Using an external voltage regulator

While searching for a variable voltage regulator with a very low drop-out voltage, I found the TPS73101. The dropout voltage for this regulator is typical 30mV to a max of 100mV at 150mA, and only has 1uA current consumption which is all great. LCSC carries the part so I ordered a few of them which will arrive soon.

The output voltage of the regulator can be set by two resistors. I was planning to use 50K (2 x 100K parallel) and two resistors in series (27K+4K7) for a 31K7 value to set the output voltage to 3.10V, which is sufficient to power the critical components. The parallel resistance is 19K4 and very close to the recommended 19K. Due to the very low drop-out voltage, I'm planning for a 3V2 alarm, so I know it's time to swap out the LiPo cell for a fully charged one.

This also means that I can draw on the LiPo cell for just about the maximum 2000mAh capacity.

The voltage regulators arrived and to try it out in the prototype, I soldered one of them on a DIP carrier board. I then found out that the adjustment to get a precise 3V10 output with fixed resistors is too finicky. You would have to use three in series to get a precise output value so I'm now using a trimmer instead. That, plus some other minor value changes resulted in an updated version of the schematic above.

I took out the sender contraption from the mailbox so I can test a few more things, especially have a more detailed look at the current consumption. When I'm satisfied, I can start to create a PCB. The current plan is to create one PCB that will accommodate both the sender and the receiver to cut cost.

Current consumption analysis

Analysis may be a big word, but I tried 4 different ESP8266 board after I noticed that the current consumption in deep-sleep was much higher than I expected. I tried all four versions that I have with my prototype. It currently, does not have the LoRa module installed. That will be next.

Here is what I found, while powering the board with 3V2 applied to the 3V3 "output".

GY-D1MINI
This board uses the SIL2104 UART and consumed around 26mA when running in setup and 6.4mA in deep sleep. This is the one that I used on the prototype on my desk and the amount of current in deep sleep got me confused. It has the ESP-12F metal can module mounted on the bottom. It also has an LED installed that is connected to the UART, that cannot be turned off in software, at least I could not find how. There is a D2 on this board that can be removed.

With 6.4mA, this board has the highest deep-sleep current consumption.




D1 Mini clone
This board uses the KH340G UART. It is what I had in the letterbox. This board has the ESP8266MOD metal can module mounted on the bottom. It consumed 20mA in setup and 195uA in deep sleep. There is an unmarked D2 on this board that can be removed.

Apart from the WEMOS D1 Mini V4 below, with 195uA, it has the lowest current consumption in deep-sleep, about double the V4 board below, but that has another significant problem.




Unmarked D1 mini clone
It looks like this board uses the KH340G UART, but the markings are removed. It consumed 19mA during setup and 250uA in deep sleep. It has the ESP8266MOD metal can module mounted on the bottom. There is a D2 on this board that can be removed. Unfortunately, I can't find a schematic for this board. I wonder where the two large diodes just above the USB micro adapter are for.




WEMOS D1 mini V4
This board uses the KH340C UART. This board has a connector for an i2c interface and a USB-C adapter. It does not have the ESP8266 metal can on the bottom but uses the ESP8266EX chip. The board also has a 32Mb SPI flash chip and an ME6211C33 voltage regulator. According to the datasheet, it has a 100mV drop-out at 100mA. 

The board consumed 19mA during setup and just below 100uA in deep sleep. This board has no "D2" installed, so the USB 5V always feeds the on-board 3V3 regulator when connected to a PC. 

With 100uA, it has the lowest current consumption in deep-sleep, about half of the best of the rest.

The major draw-back for this board is that it has a different pin-out. It is actually flipped upside down compared to the all the other boards I have, making it a tricky decision because it limits the available boards you can use. Compare the bottom markings with the boards above. It could be used in place of the others, but only when mounted upside down. These boards came without the pins connected so I could simply reverse the connector pins.





I also have an Adafruit HUZZAH but that does not have a USB connector and AI-THINKER modules which are larger, so are not candidates.


Removing D2, do or don't?
While trying all these boards, I found that there is no urgent need to remove the D2 diode, as long as the voltage rail of the letterbox sender is below 3V3, which it should. Just be careful when you are fiddling with this supply voltage and keep it below 3V3. What does happen when you leave D2 in the circuit and have the USB cable connected to your PC is that the WEMOS board will supply current from the 3V3 regulator to the receiver, and lift the voltage to 3V3. In that situation, you can't test the battery cut-out circuit or accurately measure the current consumption.

The overall current consumption of the circuit without the ESP or LoRa is 550uA at a cell voltage above 3.2V, and then goes up to 835uA when triggered. With the ESP at deep-sleep, the total consumption, still without the LoRa is below 1mA.

Just measuring the LoRa board by itself shows that when there is no activity, with the ESP in deep sleep, the LoRa board only draws 1.8 uA. When sending, it consumes at least 110mA in bursts for a very short time.  

The screen shot below was taken through a 10R resistor in series with the VCC of the LoRa board, which is fed directly from the LIPO cell, to not produce voltage sags in the 3V1 rail, which could trigger a premature low batt alarm.



Luckily, I don't need to turn the LoRa board power off in the sleep mode.

Protection fuse

I initially added a 100mA PTC fuse in series with the LiPo cell, with an attempt to avoid serious issues that can be caused by connecting a LiPo cell. What you have to take into account however is the voltage drop over the fuse, the tripping voltage and the time before it trips. I'm not an expert at all, but it looks like a 100mA PTC will trip at 200mA and will take about 2.2 seconds before it trips. (this is the part I have and looked at: a radial RXEF020 from Littlefuse) It has a resistance of 1.8Ohm at room temperature.

In deep-sleep mode, the drop is only 1.3mV, but increases to almost 150mV during the LoRa transmissions. 

That's quite a lot for this application, and I don't like the long tripping time, so I'm changing the fuse type to a fast THT Pico fuse of 250mA. Because I'll rather be safe than sorry.

Reverse Polarity Protection

The other safety measure I took was to add protection for a reverse polarity connection with the LiPo cell. I'm using a connector with a key, but not all LiPo cells come with the proper orientation of the wires. That can easily be fixed by swapping the leads in the connector, but you really don't want to have it wrong, hence the addition of a P-FET. The AO3401 has an RDSON of  60mOhm at 4.5V and 85mOhm at 2.5V, so it will be somewhere in the middle. The voltage drop of that device is not a concern.


So with everything connected and "asleep", the whole contraption consumes about 350uA, so it really depends on the amount of mail I get that will determine the life of the cell.

Rail buffering

With everything connected and working, I looked at the power rails in more detail, because I noticed a sagging when transmitting.
It turned out that I had to use a 1000uF capacitor on the 3V1 rail, and another one on the LiPo rail that supplies the LoRa board, to reduce it considerably.

This is the 3V1 rail without any electrolytes:


One 1000uF added to the 3V1 rail:


Another 1000uF added to the LiPo rail:


This was taken with my Lab Supply with 2ft leads powering the prototype with 3V3.
When I switched to the LiPo that had 4V with very short leads, this was the result:


Obviously, this is with the prototype on proto-board, which is notorious for poor connections, but still...
Something to keep an eye out for. As a result of this observation, I've added a capacitor to the base of the voltage trigger transistor, with an attempt to not let it trigger on a sagging of the rail during transmission.

There may be a potential issue with the power-up of the ESP due to this added capacitance. The chip will go through a voltage ramp-up that may cause instability. I will look at that later in more detail, but right now it does not seem to be an issue.


Next step

With the design pretty much done and functioning pretty well in both hardware and software, I can now start to design a PCB, and I started with a board outline based on the Hammond 1593L enclosure I want to use.

However, while thinking some more about the consequence of adding the large electrolytes (or a super cap) on the power rails, and the potential start-up issues for the ESP (it spends some time in the unstable zone due to the slower voltage ramping up), I considered using a voltage supervisor. While looking into possible candidate solutions, it dawned on me that I could use one as a voltage alarm, and eliminate the two transistor voltage sense circuit. Alas, I did not find any with a trigger voltage of 3.2V, and only a single one with an adjustable input that is more or less commonly available, the NCV308MTADJT1G or the equivalent NCP model. I ordered two NCP versions and will try them soon. This chip draws only 1.8uA, so is a significant enough improvement on the power budget as well. Because I was not happy with the two transistor trigger circuit, I redesigned it to use a comparator. I will try to add the layout for the voltage supervisor for the trigger so it can be used as an option. When I have the PCB, I can better determine if I need the extra electrolytes and also if the ESP will experience power-up issues.

Initially, I was planning to set the 3V2 trigger level with resistors, but after I changed the resistors to much higher values, I did some calculations for the proper values and decided to make it easier, albeit with the expense of another trimmer. That resulted in V2.3a.



The above schematic is what I used to the create a PCB. It has the optional MCP308 voltage supervisor chip that can be used instead of the TS881. Note that I'm now using the WEMOS D1 mini V4 with the flipped pinout because it has the lowest current consumption. Other WEMOS D1 boards can still be used when they are mounted upside down.

Below is a 3D view of the layout in KiCad. The PCB Gerber data is uploaded at PCBWay and I'm awaiting their sponsoring confirmation. 

The board can be used for both the sender and the receiver. Several parts can be omitted or added to suit either version.




Conclusion

We normally don't get a lot of mail, sometimes days without anything, but in the current busy Christmas period we get mail all the time, and the prototype is functioning very well. This is a keeper!



I will add more soon... Stay tuned...

As usual, I will create a GitHub project that will have all the details when I'm satisfied that the hardware works.

If you like what you see, please support me by buying me some Java: https://www.buymeacoffee.com/M9ouLVXBdw

For those that already did, thank you!



2 comments:

Anonymous said...

An alternative to the fragile dangerous mercury switch is a vibration sensor switch. It's basically a spring surrounding a pin inside a tube that resemble a capacitor. When it moves, the coil makes contact with the pin. Adafruit sells them.

paulv said...

Thank you, your are right, of course, but I was not aware of this device. I ordered a few to test.