PWM signal noise on ESP32

I communicate between 2 ESP32s by outputting and receiving PWM signals using 2 commands ledcWrite and pulseIn. Everything works quite well, however, on the same ESP32 when I output a pulse value on one pin, and read the pulse value on another pin, inadvertently, that pin also has a similar value (not continuously, but it affects my results; if I connect it to the pulse from the other ESP32, then it's not an issue) even though I don't connect these two pins together.


What is connected to CN1, resp. CN2?
The use of NPN transostors male the circuitry look doubtful.

2 Likes

CN1 and CN2 are two headers on the ESP32 for connecting to another ESP32. They can be programmed to output or receive signals.
I use transistors to amplify the current, as the two ESP32s can be spaced apart about 20-80cm.

  • The Base to Emitter resistors are not necessary.
  • What are the transistor Emitters connected to ?
  • Did you want the transistor Collectors as the outputs ?
  • What is the transistor part number ?

Your circuit does not do anything meaningful :frowning:

Please show a complete diagram for a single signal definitely indicating input and output.

They are connected to another circuit, similar circuits. I want to generate signals on this circuit and read the signal values on another circuit. However, when generating signals on this circuit, the pins on the same circuit also have similar signal values.
The hardware of this circuit cannot be modified; can it be adjusted programmatically?

My circuits are used to control one of the devices as shown in the image. When I plug a wire from this device to another device, it will output a pulse to determine if I have connected the wire correctly. However, when I run this circuit, the input pins are interfered by the output pins on the same device, and those interference values occasionally coincidentally match the values I need to read!

  • The schematic in the 1st post makes little sense.

  • This would be the way an NPN transistor is wired as an inverting switch.

Please show a circuit diagram like @LarryD did.

  • If you want help, we need to see the exact interconnections of at least one ES32 output to the circuit it is driving.
    Include all the components in this circuit.

  • Draw this circuit by hand or with a schematic circuit drawing program if you have one.

Here is my circuit, all circuits are identical, they are interconnected through CN1, CN2, corresponding to GPIO 12, 13, 14, 15, 18, ... Each GPIO can be configured as INPUT or OUTPUT, OUTPUT will generate pulses using ledcWrite and INPUT will read pulses using pulseIn. My problem is that on the same circuit, when the pins read pulses without being connected to any PIN, they still have pulse values, and the pulse values are identical to the pulses generated on the same circuit. For example, if I generate pulses on GPIO 25, then I read at GPIO 12, the values are close to 25 even though GPIO 25 and 12 are not connected to each other.


Are the Opto circuits involved in this ?


Add the external connections to the Emitter Output.

"I didn't connect the wires, but there are still pulse values on the screen, it's not completely zero, some values ​​are equal to the output value."

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.