Designing an interrupt switch or circuit

Click For Summary

Discussion Overview

The discussion revolves around designing a circuit or switch to trigger an electric imp device from deep sleep based on a liquid level sensor detecting water. The focus is on ensuring the device can wake, log data, and return to sleep while managing power consumption effectively.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes the need for the electric imp to wake from deep sleep when a liquid level sensor detects water, emphasizing the importance of power efficiency.
  • Another suggests using an Arduino microcontroller as a potential solution, referencing resources on low-power Wi-Fi data logging.
  • Some participants express uncertainty regarding the specific requirements of the device, questioning whether it is a standalone unit or an interface to an existing device.
  • One participant proposes using an edge-triggered monostable circuit to manage the interrupt signal from the level sensor, noting the importance of the duration of the interrupt pulse.
  • A suggestion is made to sketch a logical state machine to manage the device's states, highlighting the need for a handshake mechanism between the device and server to acknowledge interrupts.
  • Another participant clarifies the behavior of the electric imp's WAKE pin, correcting an earlier misunderstanding about its operation.
  • There is a recommendation to define a state machine first and then explore implementation options, with a proposed state chain for the device's operation.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the requirements and functionality of the device. There is no consensus on a single solution, and multiple approaches are proposed, indicating ongoing debate and exploration of ideas.

Contextual Notes

Some participants mention the complexity of managing power consumption and the need for a clear system definition. There are also references to external resources and commercial solutions that may not fully align with the specific requirements of the electric imp.

Who May Find This Useful

This discussion may be useful for individuals interested in low-power circuit design, sensor integration, and the use of microcontrollers in battery-powered applications.

Forrtruck
Messages
2
Reaction score
0
I need to trigger an electric imp to wake from deep sleep on the event that a liquid level sensor is exposed to water and send an alert to a user. This device periodically wakes up out of a deep sleep state and connects to a server to log sensor data (temp, humidity, light, water level in the tank) via wifi.

I then would like the device to go back to deep sleep even though the water will still be present. This behavior will have to repeat every time the water level sensor goes from low to high (every time the user fills the tank). I am aware that the interrupt can only be triggered when the interrupt pin state transitions from low to high, and that the device can only go to sleep when the pin goes low again, hence the challenge. This is a battery powered application so power consumption is at a premium.

Can anyone suggest a solution?
 
Engineering news on Phys.org
I'm not sure what level your requirements are at.
Are we defining the device, or the interface to an existing device? (I'm thinking the former)

A stand-alone wifi connected uP attached to a sensor? A raspberry Pi seems like a logical choice, but I don't know about sleep currents.
There are Arduino based solutions you can search for.

Powering down the wifi will be an issue also. I think you are talking a pretty complex multistage system if power is really an issue.

Here are some commercial solutions:
http://www.monnit.com/ProductManagement/FilterResult/?productCategoryID=1
https://www.amazon.com/dp/B00FG9Y2MC/?tag=pfamazon01-20

Here is a high level treatment of the issue
http://www.digikey.com/en/articles/...wireless-water-leak-alarm-system-for-home-use

Here is a project that uses an arduino interfaced to a raspberry Pi
http://www.instructables.com/id/ESP8266-WiFI-water-leak-sensor/

You need to look over all the above, do your own searches, and finalize your system definition.
 
Add a edge triggered monostable between level sensor and interrupt? Might be able to do it with just a resistor, capacitor and diode. Depends how long the interrupt pin must be high for.
 
Forrtruck said:
This is a battery powered application so power consumption is at a premium.
You should sketch a logical state machine like the attached:

There are 4 states, and change of state will take place when

LOL = LOw Level of water
or
INTACK = Interrupt acknowledeged

change locical value.
The state machine will change the value of

INT = Interrupt.

The problem is: How short may this interrupt pulse be? When has it been detected/acknowledged?
A "work around" is to make a "handshake" between the device and the server with signals: Interrupt and interrupt acknowledged. When the server signals, that it has detected/acknowledged the interrupt, the interrupt signal can be removed, ready for another cycle.

Having sketched the state machine, you can design an asynchronous logic network, consisting of about 8 nand-gates. Are you familiar with Karnaugh maps?

Using MOS-technology, the current consumption will be a few μA, if not nA.

PS: The two binary digits in the circles are the binary "address" of the state.
 

Attachments

Last edited:
meBigGuy said:
I'm not sure what level your requirements are at.
Are we defining the device, or the interface to an existing device? (I'm thinking the former)

A stand-alone wifi connected uP attached to a sensor? A raspberry Pi seems like a logical choice, but I don't know about sleep currents.
There are Arduino based solutions you can search for.

Powering down the wifi will be an issue also. I think you are talking a pretty complex multistage system if power is really an issue.

Here are some commercial solutions:
http://www.monnit.com/ProductManagement/FilterResult/?productCategoryID=1
https://www.amazon.com/dp/B00FG9Y2MC/?tag=pfamazon01-20

Here is a high level treatment of the issue
http://www.digikey.com/en/articles/...wireless-water-leak-alarm-system-for-home-use

Here is a project that uses an arduino interfaced to a raspberry Pi
http://www.instructables.com/id/ESP8266-WiFI-water-leak-sensor/

You need to look over all the above, do your own searches, and finalize your system definition.

I'm using an electric imp right now which is both the MCU and the wifi chip. My question is more about an external circuit that will satisfy the electric imp's requirements for waking from deep sleep by an interrupt pin (transition from low to high wakes it, transition from high to low puts it to sleep). The problem is that the water will still be present when I want it to go to sleep, but it must be able to do the same thing over again the next time the water goes from low to high.
 
Electric IMP is a cool device. Nice choice.

I think you described the WAKE pin a bit incorrectly. The WAKE pin must be low for the SW to go to sleep. The high-to-low transition does not put it to sleep. It just cannot go to sleep unless the pin is low.

Look at what CWatters suggested, an edge triggered one-shot that generates a wake pulse whenever the sensor goes from low to high, or a capacitively coupled detector (differentiator) that implements that function.
Here is an example using a 555, but the differentiator input circuit to the 555 may be all you really need.
http://www.electroschematics.com/11032/edge-triggered-555-monostable-multivibrator/
 
Define a state machine first, and then look for ways to implement it. It seems to me that you have something like the following state chain:

(water low, IMP asleep)→(water high, IMP asleep)→(water high, IMP awake)→(water high, IMP asleep)→(water low, IMP asleep)

Since you have two states that looks the same, you must introduce an extra state variable somewhere (possibly set when the IMP is awake and reset when the water is low).
 

Similar threads

Replies
7
Views
3K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 51 ·
2
Replies
51
Views
5K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
20
Views
6K