B4R Question Floating signal. What can I do? (Solved)

jvrh_1

Active Member
Licensed User
Hello, I am trying to develop a Project based on @XorAndOr Project (https://www.b4x.com/android/forum/threads/home-control-4.148024/) adding an extra functionality. I whish that when somebody press the ring button, a notification arrive to my B4A App but I have a problem.

When I press the ring button, the notification arrive but, sometimes I recieve some notification without anybody press the button. It is due to a floating signal.

Some memers of our forum say to me that I have to read information about Pull-up and Pull-down resistors. After that, I have implemented this solutions on my board Esp8266 and I got two results:

  • Relays doors does not work.
  • nothing happen. I recieve the notification, but sometimes recieve notification without anybody press the ring button.
I do not know that I doing bad. In the attached files, you can watch:

  • My original diagram with out notification system (only the relays doors)
  • My original diagram connected to notification system without resistors (I recieve the notification, but sometimes recieve notification without anybody press the ring button.
  • My original diagram with pull-up resistor (does not work and the relays do not work now)
  • My original diagrma with pull-down resistor (does not work and the relays do not work now)
I understand circuit theory, but when I implement these schematics on my board, it don’t work. Reading Please, I need help. I have waste a lot of time, but It does not work….. I know that B4R has got a ".MODE_INPUT_PULLUP" instruction but, it does not work for me.
 
Last edited:

XorAndOr

Active Member
Licensed User
Longtime User
When I press the ring button, the notification arrive but, sometimes I recieve some notification without anybody press the button. It is due to a floating signal.
I usually take small steps.
1) I put a small button between esp pin and ground
2) I leave it on "standby" and wait if it stays in standby correctly, waiting for the commands
3) action the various relays and I notice if the relays work...but I observe if some message FCM arrives wrong while I was commanding the relays.
4) I start pressing the message button and see if everything is ok
5) I will repeat several times, giving time for the message to arrive
6) if everything is ok, I focus on the intercom button
I hope it can help you find the problem and to us to understand if the problem is on the ESP side or on the intercom side
sry google T.
 
Upvote 0

jvrh_1

Active Member
Licensed User
I usually take small steps.
1) I put a small button between esp pin and ground
2) I leave it on "standby" and wait if it stays in standby correctly, waiting for the commands
3) action the various relays and I notice if the relays work...but I observe if some message FCM arrives wrong while I was commanding the relays.
4) I start pressing the message button and see if everything is ok
5) I will repeat several times, giving time for the message to arrive
6) if everything is ok, I focus on the intercom button
I hope it can help you find the problem and to us to understand if the problem is on the ESP side or on the intercom side
sry google T.
Hi,

Finally, I solved It. Now, I am using a condenser, not a resistor. Now works perfectly. Thanks for your help.
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
For a button you don't really need any additional circuitry at all. The pins of Arduino and ESP have internal Pull-Up resistors, these must be activated only. And the button must of course switch against GND in this case.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
For a button you don't really need any additional circuitry at all. The pins of Arduino and ESP have internal Pull-Up resistors, these must be activated only. And the button must of course switch against GND in this case.

In an ideal world "For a button you don't really need any additional circuitry at all", but in the real world we know that unwanted signals (voltages) may be induced into wires connecting a button to the device, particularly if the wires are long and/or not shielded. Internal pull-up resistors alone may not eliminate unwanted effects from such signals and so I'm not surprised other means such as a condenser (capacitor) has eliminated the problem.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Common naming of the process is "filtering".
And the filter may be hardware one (capacitor), or software one: statistical measurements, making several signal reading during some time period, and making decision (for ex. using the average value of reading sum).
 
Upvote 0

MaFu

Well-Known Member
Licensed User
Longtime User
In an ideal world "For a button you don't really need any additional circuitry at all", but in the real world we know that unwanted signals (voltages) may be induced into wires connecting a button to the device, particularly if the wires are long and/or not shielded. Internal pull-up resistors alone may not eliminate unwanted effects from such signals and so I'm not surprised other means such as a condenser (capacitor) has eliminated the problem.
This should not be a problem even with a longer line. The line is always "high" due to the internal pull-up and only goes "low" by pressing the button. Radiation should therefore not interfere.
But I admit: I have not used a button with several meters of cable yet. But the installation of a capacitor is of course not wrong in such a case.
 
Upvote 0

jvrh_1

Active Member
Licensed User
Esto no debería ser un problema incluso con una línea más larga. La línea siempre está "alta" debido al pull-up interno y solo baja "al presionar el botón". Por tanto, la radiación no debería interferir.
Pero lo admito: todavía no he usado un botón con varios metros de cable. Pero en tal caso, por supuesto, no está mal instalar un condensador.
Theoretically It is not neccessary a condenser but, in the practice is the unique way to do that the project works well.
 
Upvote 0
Top