Designing an interrupt switch or circuit

In summary, an edge triggered monostable between level sensor and interrupt could satisfy your requirements.
  • #1
Forrtruck
2
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
  • #3
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.
 
  • #4
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.
 
  • #5
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

  • scan0021.pdf
    111.1 KB · Views: 169
Last edited:
  • #6
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.
 
  • #7
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/
 
  • #8
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).
 

1. What is an interrupt switch or circuit?

An interrupt switch or circuit is a device that allows a microcontroller or CPU to temporarily pause its current task and handle an urgent or higher priority task. It is typically used in electronic systems to respond to real-time events or external signals that require immediate attention.

2. What is the purpose of an interrupt switch or circuit?

The purpose of an interrupt switch or circuit is to improve the efficiency and responsiveness of a system by allowing it to quickly respond to critical events without having to constantly check for them in a loop. This frees up processing time for other tasks and reduces the overall system processing time.

3. How does an interrupt switch or circuit work?

An interrupt switch or circuit works by having a dedicated input pin on the microcontroller or CPU that is connected to the interrupt line. When an interrupt signal is received, the processor stops its current task and jumps to a predefined interrupt service routine (ISR) to handle the urgent task. Once the ISR is completed, the processor returns to its previous task.

4. What are the different types of interrupts?

There are two main types of interrupts: hardware and software. Hardware interrupts are generated by external signals such as a button press, timer, or sensor reading. Software interrupts, also known as software interrupts, are generated by the program itself to request immediate attention from the processor.

5. What are some considerations when designing an interrupt switch or circuit?

When designing an interrupt switch or circuit, it is important to consider the priority levels of different interrupts, as well as the frequency and timing of the interrupt signals. It is also crucial to properly handle and clear interrupts to avoid interrupt conflicts and ensure the proper functioning of the system. Additionally, the power consumption and cost of the interrupt switch or circuit should also be taken into account.

Similar threads

Replies
7
Views
1K
  • Electrical Engineering
Replies
5
Views
1K
  • Electrical Engineering
Replies
2
Views
2K
  • Electrical Engineering
Replies
9
Views
2K
  • Electrical Engineering
Replies
14
Views
2K
  • Electrical Engineering
Replies
7
Views
3K
  • Electrical Engineering
Replies
2
Views
1K
  • Electrical Engineering
Replies
11
Views
3K
Replies
21
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Back
Top