P10 dual function at boot
-
Hi All,
When I need to store or transport the IP67 sealed LoRa RTU units with no visible external switch to make it tamper proof, hypothetically I want to short P10 to ground for min of 30 seconds via external loop /wire dummy connector using 2 of the 3 pins of an IP67 connector that facilities a DS18B20 for normal use to force long deep sleep, just after reset/boot. I am using a miniature reed switch located in a very specific place and the magnet needs to be located direct over location to trigger a reset.
In this case the active pin, P10 is the DQ line with the internal PCB pull-up resistor.
If P10 sees 3.3V then P10 jumps to normal OneWire operation. We have developed a set of rules to detect DS18B20 data to ensure the DS18B20 is active and present and the cable/sensor has not failed, otherwise it goes into deep sleep after 5 retries and then tries once each 6 hours to see of the cable/connector/DS18B20 is present and working again. We call up a separate deep sleep state, subject to P10 receiving DQ data.
Wake up from store/transport/long sleep (as long as timer allows) would be via the LoPy reset switch, P10 no longer sees zero volts/ground and/or the DS18B20 installed into the connector for normal operation, therefore P10 is at 3.3V and code with do normal checks.
Question, I have a specific requirement at start that reads P10 as a ADC function, I assume greater than 3V, then P10 resumes normal operation using OneWire, can LoPy facilitate this quick Pin function swap?
-
Thanks. Yes I am using reed switches for reset and Mode on opposing ends of the case.
I will add another PIN for interrupt.
-
For triggering a sealed unit I've used encapsulated reed switches on the board. You just need to know where to wave the magnet. These were used to wake devices from sleep in a number of devices I've created. When the device wakes, it knew it was woken from the switch due to it being an interrupt input rather than a power up reset or timer wakeup and could perform appropriate actions as needed, for example, in the case of a recent application it enabled the bluetooth in order for a remote app to connect and perform data transfers.
Andrew