0
\$\begingroup\$

I currently have a circuit that the arduino pro mini checks is the button pressed, the relay will be closed to trigger the bell alarm. And a UDP Packet will be also sent to a server to notify me.

Flow chart: (Flow Chart)

Circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

However, it is a unsafe circuit as if the arduino is not working, the bell alarm will no longer triggered.

Is there a way to just detect is the wire containing current?

\$\endgroup\$
  • \$\begingroup\$ Yes, there is, BUT you need to provide more detail and a circuit diagram as the possibilities of what you really want are too broad with the information provided. \$\endgroup\$ – Russell McMahon Mar 22 '16 at 8:25
  • \$\begingroup\$ @RussellMcMahon I just modified the question. \$\endgroup\$ – mob41 Mar 22 '16 at 9:10
  • \$\begingroup\$ See addition to answer. \$\endgroup\$ – Russell McMahon Mar 22 '16 at 12:34
0
\$\begingroup\$

You need to far more closely describe what conditions are or are not acceptable to you.

Also, it will greatly help people's understanding if you advise WHY some valid conditions may occur (such as "5V present but Arduino not working")

The issue that causes the "unsafe condition" is that you are using the Arduino as a "black box" between button & bell and the black box must be working for the black box to function. You need to state your objective more clearly BUT if it is acceptable that bell is always triggered when button is pushed,then

Connect PB1 from +5V to the top of the relay coil
(point where D! and PArduinoD2 connect, and

Make PArduino D2 an input.

The Arduino can detect button press when the Arduino is running via PAD2.

As this applies +5V to an Arduino pin when the Arduino is off you could connect a resistor from the relay coil sense point to PArduinoD2. 10k is probably acceptable and 100k may be OK (higher is better if it meets port specifications.

The above differs from the original in that the bell operates as long as the button is pressed - this may be more or less that the original program controlled 0.5s. If this is unacceptable then you need to say what your ACTUAL requirements are.

You say "If the Arduino is not working ..." -> As you need 5V to operate the relay and to have the push button or Arduino operate it. why would the arduino ever not be working when 5V is available? This also needs to be stated in your requirement.

Relay operation:

You have shown the relay coil being powered by an Arduino pin set to a high level. Some low current relays can be directly operated by a microcontroller pin in this manner but in most cases the available current is too low.

There are commonly available relay modules which use a transistor at their input to provide current gain so that input current can be much lower that the relay coil current. Many of these modules are available at very reasonable cost. They usually require Vin = low to activate the relay. Many offer SPDT or DPDT output contacts so you could still use Vin = high to switch the relay OFF and use the relay NC contacts to switch the bell.

If any or all of the the terms SPDT DPDT or NC are unfamiliar I recommend studying some basic relay literature as they are commonly used abbreviations.

Wikipedia - relay

Hasco - relay terminology - useful.

A zillion useful images


Added:

The diagram you drew in response to mt comment did not match my description. I do not know why you did not do what I said.
Here is your diagram modified to match what I said. This is NOT an ideal solution but seems to do ~= what you want.
Better / more complete descriptions of what you want to do, and answering questions that people ask will get you better results.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ Thank you. I am asking about how can I make the bell is always triggered when button is pushed. But, I can't understand your explanation clearly. Can you make a circuit diagram for me? Thanks \$\endgroup\$ – mob41 Mar 22 '16 at 9:32
  • \$\begingroup\$ See above "Connect PB1 from +5V to the top of the relay coil (point where D1 and PArduinoD2 connect, and || Make PArduino D2 an input. || The Arduino can detect button press when the Arduino is running via PArduinoD2. || Your response answers none of my questions. \$\endgroup\$ – Russell McMahon Mar 22 '16 at 9:37
  • \$\begingroup\$ Your solution is acceptable. I probably understand how it works and is the circuit looks like this? Image Otherwise, I probably need your help to make a circuit diagram... \$\endgroup\$ – mob41 Mar 22 '16 at 9:55
  • \$\begingroup\$ sorry, i just misunderstood about your answer. \$\endgroup\$ – mob41 Mar 22 '16 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.