non-return flap
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 8
- Joined: 02 Jan 2021, 16:44
non-return flap
Hello everyone,
I have a non-return flap that has a siren output for alarms of 19.2 volts.
I would like to tap this and of course communicate it to my ESP, I have set it up like this.
https://ibb.co/6vPnRXx
In this circuit, 2.5V -2.6V is applied to D5, I have also measured this.
I just want to tap the status, if alarm/voltage then 1 if none then 0
https://ibb.co/k2v5rjz
https://ibb.co/c3RhqZf
if anyone knows why this does not work, please help me THANK YOU
I have a non-return flap that has a siren output for alarms of 19.2 volts.
I would like to tap this and of course communicate it to my ESP, I have set it up like this.
https://ibb.co/6vPnRXx
In this circuit, 2.5V -2.6V is applied to D5, I have also measured this.
I just want to tap the status, if alarm/voltage then 1 if none then 0
https://ibb.co/k2v5rjz
https://ibb.co/c3RhqZf
if anyone knows why this does not work, please help me THANK YOU
Last edited by acidsubway on 03 Jun 2024, 20:09, edited 1 time in total.
Re: non-return flap
The images are not working.
Maybe better to attach them to this post, so it won't be unavailable at some point in the future when this topic comes up via a search query.
Maybe better to attach them to this post, so it won't be unavailable at some point in the future when this topic comes up via a search query.
Re: non-return flap
I don't expect the remaining voltage over the white LED will be much higher than 0.6 V, so that will always be seen as a low input.
/Ton (PayPal.me)
Re: non-return flap
See voltage drop over the LED:
As you can see, the voltage drop over the LED should be about 3V when it draws about 20 mA.
However 18k resistor over 19V (not taking the voltage drop of the LED and diode into account) will only leave about 1 mA.
So the voltage drop over the white LED will not be enough.
Also you have quite a large capacitor over the LED, so it will take quite a long time for the voltage to rise.
As you can see, the voltage drop over the LED should be about 3V when it draws about 20 mA.
However 18k resistor over 19V (not taking the voltage drop of the LED and diode into account) will only leave about 1 mA.
So the voltage drop over the white LED will not be enough.
Also you have quite a large capacitor over the LED, so it will take quite a long time for the voltage to rise.
Re: non-return flap
The schematic shows the signal connected to D6 (GPIO 12), but you have configured it for GPIO 14 (D5), that seems like a mismatch
Such "great" feature of these weird D-pin numberings
Such "great" feature of these weird D-pin numberings
/Ton (PayPal.me)
-
- New user
- Posts: 8
- Joined: 02 Jan 2021, 16:44
Re: non-return flap
Thank you for looking over it.
I have measured the output voltage, which is 2.5-2.6V when an alarm occurs.
The large capacitor ensures that the voltage remains constant due to the alarm interval.
Alarm behaves 19.2V for 0.5sec then 0V for 0.5sec and so on.....
If there is no alarm, the voltage is also 0V from the device that outputs the alarm of 19.2V, due to the circuit I have at PIN D5 (sorry for the error in the drawing).
Can you suggest a better circuit?
THX
I have measured the output voltage, which is 2.5-2.6V when an alarm occurs.
The large capacitor ensures that the voltage remains constant due to the alarm interval.
Alarm behaves 19.2V for 0.5sec then 0V for 0.5sec and so on.....
If there is no alarm, the voltage is also 0V from the device that outputs the alarm of 19.2V, due to the circuit I have at PIN D5 (sorry for the error in the drawing).
Can you suggest a better circuit?
THX
Re: non-return flap
How did you measure it?
Simply applying 19V for a while and then measuring the output voltage?
So the capacitor did have enough time to get charged?
Just assume only the 18k resistor and the 1uF capacitor.
Typically you will need about 3RC time to get to the max. voltage, but since it is being charged with a higher voltage, it might be less.
1RC time is 18000 x 0.000001 = 0.018 sec, thus 3RC = 54 msec.
However you have the LED parallel to the capacitor and the LED will slowly rise the voltage drop over the LED when the current increases.
So this will take quite a while to get there.
My suggestion is to lower the resistor value from 18k to 1k8 and to add another 1N4001 in series with the LED.
This will add about 0.6V to the voltage drop of the LED.
If that's too much, you can also switch to the 1N4148 to put in series with the LED as this has a voltage drop of about 0.3V
Thus:
1N4001 --- 1k8 --- GPIO --- 1N4148 --- LED --- GND
And if you like the 1uF capacitor parallel to the diode and LED (thus between GPIO and GND).
Simply applying 19V for a while and then measuring the output voltage?
So the capacitor did have enough time to get charged?
Just assume only the 18k resistor and the 1uF capacitor.
Typically you will need about 3RC time to get to the max. voltage, but since it is being charged with a higher voltage, it might be less.
1RC time is 18000 x 0.000001 = 0.018 sec, thus 3RC = 54 msec.
However you have the LED parallel to the capacitor and the LED will slowly rise the voltage drop over the LED when the current increases.
So this will take quite a while to get there.
My suggestion is to lower the resistor value from 18k to 1k8 and to add another 1N4001 in series with the LED.
This will add about 0.6V to the voltage drop of the LED.
If that's too much, you can also switch to the 1N4148 to put in series with the LED as this has a voltage drop of about 0.3V
Thus:
1N4001 --- 1k8 --- GPIO --- 1N4148 --- LED --- GND
And if you like the 1uF capacitor parallel to the diode and LED (thus between GPIO and GND).
-
- New user
- Posts: 8
- Joined: 02 Jan 2021, 16:44
Re: non-return flap
Thank you for your answer, please take a look at the plan, is that what you meant?
https://ibb.co/cQYJk8M
THX
https://ibb.co/cQYJk8M
THX
Re: non-return flap
Yep, that's what I meant.
Please measure the voltage over the diode D2 and the LED before connecting it to the GPIO pin.
The GPIO pin may clamp higher voltages down to its 3V3, so you can't measure what is actually over this diode and LED.
You did draw it as a battery pack, but just to be sure this 19V will only be applied on moments where you need to be alarmed and/or it isn't battery powered. This circuit will draw about 9 mA when the 19V is applied.
So if you power this from a battery, you will empty the battery quite fast.
The resistor R1 will convert about 0.14 Watt into heat, so make sure to use at least 1/4Watt resistors.
Or place 2 resistors of 820 Ohm or 1k in series.
Please measure the voltage over the diode D2 and the LED before connecting it to the GPIO pin.
The GPIO pin may clamp higher voltages down to its 3V3, so you can't measure what is actually over this diode and LED.
You did draw it as a battery pack, but just to be sure this 19V will only be applied on moments where you need to be alarmed and/or it isn't battery powered. This circuit will draw about 9 mA when the 19V is applied.
So if you power this from a battery, you will empty the battery quite fast.
The resistor R1 will convert about 0.14 Watt into heat, so make sure to use at least 1/4Watt resistors.
Or place 2 resistors of 820 Ohm or 1k in series.
-
- New user
- Posts: 8
- Joined: 02 Jan 2021, 16:44
Re: non-return flap
Thank you for your answer. A battery is not the alarm transmitter, it is a control of a non-return valve for the drain.
This control always outputs 19.2V for 0.5sec when an alarm is triggered, then there is a pause to 0V again, then 19.2V again, then 0V again.
The alarm is only there in an emergency, but it can take 10h until someone switches it off, for example when I am on holiday.
I definitely measure the voltage that arrives at the GPIO, THANK YOU.
This control always outputs 19.2V for 0.5sec when an alarm is triggered, then there is a pause to 0V again, then 19.2V again, then 0V again.
The alarm is only there in an emergency, but it can take 10h until someone switches it off, for example when I am on holiday.
I definitely measure the voltage that arrives at the GPIO, THANK YOU.
Re: non-return flap
You could also look into using an optocoupler.
This is essentially a LED on one side and a transistor on the other side.
The best feature is that it will completely isolate the 19V circuit and the ESP side.
So you don't have to worry about the ground levels between the pump and the ESP board.
I would advise you to consider it as it might prevent strange issues where you connect your PC to the ESP while it is also connected to the pump.
Just place the LED of the optocoupler in series with the LED you now plan on using so you have some visual feedback.
It can replace the extra diode in the circuit.
Something like this:
Source
This is essentially a LED on one side and a transistor on the other side.
The best feature is that it will completely isolate the 19V circuit and the ESP side.
So you don't have to worry about the ground levels between the pump and the ESP board.
I would advise you to consider it as it might prevent strange issues where you connect your PC to the ESP while it is also connected to the pump.
Just place the LED of the optocoupler in series with the LED you now plan on using so you have some visual feedback.
It can replace the extra diode in the circuit.
Something like this:
Source
-
- New user
- Posts: 8
- Joined: 02 Jan 2021, 16:44
Re: non-return flap
@TD-er
sorry that I'm getting in touch so late, unfortunately I haven't found the time to deal with it yet. Now I have some air again, do you mean the coupler installed like this?
sorry that I'm getting in touch so late, unfortunately I haven't found the time to deal with it yet. Now I have some air again, do you mean the coupler installed like this?
- Attachments
-
- Untitled Sketch 2_Schaltplan.jpg (319.59 KiB) Viewed 3424 times
Re: non-return flap
Yep
And just to be sure, as you're connecting a 19V voltage, you should use a capacitor rated for a higher voltage.
When the diode and LED are connected, the voltage may never exceed the limit of the 16V rated capacitor you have in your schematic.
But if the connection of either one is flaky, then the voltage over the capacitor may exceed the 16V and that could lead to a damaged capacitor.
Well at least you will get some audio and visual feedback when this happens, but this can be rather loud and explosive.
Oh and you should also add some pull-up resistor between the GPIO pin and 3V3
And just to be sure, as you're connecting a 19V voltage, you should use a capacitor rated for a higher voltage.
When the diode and LED are connected, the voltage may never exceed the limit of the 16V rated capacitor you have in your schematic.
But if the connection of either one is flaky, then the voltage over the capacitor may exceed the 16V and that could lead to a damaged capacitor.
Well at least you will get some audio and visual feedback when this happens, but this can be rather loud and explosive.
Oh and you should also add some pull-up resistor between the GPIO pin and 3V3
-
- New user
- Posts: 8
- Joined: 02 Jan 2021, 16:44
Re: non-return flap
now I hope that I have everything right
- Attachments
-
- Untitled Sketch 2_1_Schaltplan.jpg (195.47 KiB) Viewed 3339 times
Re: non-return flap
I just realized you also need some resistor between the capacitor and the diode (D2) and LED.
Otherwise you may burn out the LED as the capacitor will discharge itself without current limiter.
Not sure what would be a good value for this resistor though, as the capacitor will likely not charge far above the voltage drop of the diode and LED>
You may need to experiment with the value of the capacitor as it can take a while for it to reach the required voltage.
N.B. you can also replace D2 with some LED for visual feedback, or simply remove it.
But to be honest, I think the capacitor does make things complicated.
Just note that this setup will pull the GPIO down when the LED in the optocoupler lights up.
If you want to have it inverted, you can connect the pull-down resistor between the GPIO and GND and the transistor between 3V3 and the GPIO
But you can of course also invert the logic in software.
Otherwise you may burn out the LED as the capacitor will discharge itself without current limiter.
Not sure what would be a good value for this resistor though, as the capacitor will likely not charge far above the voltage drop of the diode and LED>
You may need to experiment with the value of the capacitor as it can take a while for it to reach the required voltage.
N.B. you can also replace D2 with some LED for visual feedback, or simply remove it.
But to be honest, I think the capacitor does make things complicated.
Just note that this setup will pull the GPIO down when the LED in the optocoupler lights up.
If you want to have it inverted, you can connect the pull-down resistor between the GPIO and GND and the transistor between 3V3 and the GPIO
But you can of course also invert the logic in software.
Who is online
Users browsing this forum: No registered users and 13 guests