NodeMCU connecting by transistor

Hello, I created a project to "connect" two boards (in my case NodeMcu, but I also did it with Arduino Nano with the same result), the presented connection has a very simple task to transfer the LOW signal through a transistor from one board to another which will do the job, e.g. light it the diode. So when the photoresistor on board 1 gives a specific signal to A0, the board will turn on the high state on D7 which will start the transistor, thanks to which D1 on the second board will go into the LOW state which will be a term to light the diode on board 2. Everything works fine when the tiles are max. 50cm, but needs to be connected about 5m from each other. In general, at this distance, sometimes it does not work, it is very susceptible to "noise". Do you have any idea how to eliminate it? The cable I am using is ethernet 8r? The 3V stabilization resistor from D1 seems to help, there is much less noise, but maybe it can be done better?

When I run 3.3V or 5V through a long cable my first go to for noise isolation is an opto-isolator instead of using a transistor/resistor circuit. Are you soldering or using a breadboard for the wire connections?

But if you are using ESP8266's you can use WiFI and ESPNOW to transmit the values from one device to the other.

1 Like

soldering, esp is only an example to draw- sometimes its arduino sometimes esp, for a long time i do this in a small range and it was a good for me but now have more distance and a problem

Hi @intersect
what do you mean when you say "ethernet 8r"?
Would it be UTP Cat5/6 cable?
If it is this type of cable you can do this to reduce noise:
Use two pairs, (for example the green pair and the orange pair).
From the orange pair connect one side of the orange wire to the transistor collector and the other side to the D1 ESP pin, the white of the orange to GND, but only on an ESP .
The Green you call the GND of the two ESPs.

You can also use STP Cat5/6 cables, they have built-in shielding.

RV mineirin

Hi! @ruilviana thanks for the answer. Yes, it is a Cat5 UTP cable, I will check your solution today :slight_smile: Until now, I thought that the problem may lie in the "resistance" of the cable, which involuntarily creates the "LOW" state on D1, so I raised INPUTPULLUP D1 with an additional resistor to 3V. I left this "experiment" overnight and, surprisingly, with the 8m cable, the serial monitor did not notice any change :slight_smile: this solution probably worked, but it seems not very elegant to me, what do you think?

@intersect, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

1 Like