• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Noisy Long Wire effect my Microcontroller Digital input

Status
Not open for further replies.

ksaomar

New Member
Hello all

I am using my Microcontroller to read a status of digital input, but when I put long wire to read the status, my MC can not read a clear value, sometimes it ON and sometimes it is OFF, when I measure the value by the oscilloscope, I can see a square wave from 0V to 2.5V, with 60 HZ. :confused:

Help me guys to eliminate this? (You can see the design in the attachment)

Thanks in Advanced

Omar
 

Attachments

Leftyretro

New Member
Hello all

I am using my Microcontroller to read a status of digital input, but when I put long wire to read the status, my MC can not read a clear value, sometimes it ON and sometimes it is OFF, when I measure the value by the oscilloscope, I can see a square wave from 0V to 2.5V, with 60 HZ. :confused:

Help me guys to eliminate this? (You can see the design in the attachment)

Thanks in Advanced

Omar
Try moving the digital input wire to between the LED and resistor, that may help lower the impedance to the input when the switch is open.

Lefty
 

Mikebits

Well-Known Member
You need a proper driver and wire arraignment. Check out Rs422.
 

colin55

Well-Known Member
Simply lower the input impedance of the microcontroller-line by putting a 1k on the anode of the LED to 0v and a 100n across the 1k.
 

Mikebits

Well-Known Member
Simply lower the input impedance of the microcontroller-line by putting a 1k on the anode of the LED to 0v and a 100n across the 1k.
That would slow the rising edge of the signal and may cause a double clock situation.

Without knowing the nature of the input to the MCU it is hard to say.
 
Last edited:

mvs sarma

Well-Known Member
Hello all

I am using my Microcontroller to read a status of digital input, but when I put long wire to read the status, my MC can not read a clear value, sometimes it ON and sometimes it is OFF, when I measure the value by the oscilloscope, I can see a square wave from 0V to 2.5V, with 60 HZ. :confused:

Help me guys to eliminate this? (You can see the design in the attachment)

Thanks in Advanced

Omar
why not use an opto isolator and the transistor would be on the Microcontroler as emitter follower. the LED and additional resistor can be on the Diode path of opto coupler.
 

Mikebits

Well-Known Member
Problem is that you will still have losses in wire and induced noise on a single wire. Differential pair is best way to overcome noise induced into the wire. Single wire transmission has inherent problems, and other modes of long distance signal transmission must be used, eg. RS422.
 

mvs sarma

Well-Known Member
Problem is that you will still have losses in wire and induced noise on a single wire. Differential pair is best way to overcome noise induced into the wire. Single wire transmission has inherent problems, and other modes of long distance signal transmission must be used, eg. RS422.
Opto sees a lower impedance and the noise won't be there.

I had an occasion to solve such problem, where an FET's gate was facing 5.5KM of Underground cable and was never working. after inclusion of Opto with 10mAs current , the issue was sorted and around 50 such telecom signaling circuits were stablized, Mikebits.
 
Last edited:

ksaomar

New Member
Thank you guys for these answers, I posted it only three hours ago, and I got all these replies, I really appreciate it.

Leftyretro:

I will do what you suggested in your post, but the problem is where the square wave comes from?

House0Fwax

The wire is 3 to 5 meters long, and no I did not use shielded wire. I will use the a shielded wire, and I hope it solve the problem.

Mikebits

RS422 is used for serial communication, I am not sending any data. It is just like any DIP switch in any board, the difference is that the DIP switch is 5 meters far from the board.

mvs sarma
I could not visualize your design, could you please draw it and post here.

Nigel Goodwin

This design is found in most of the boards with DIP switches, and if you think this is bad!!, please let me know any better design.
 
Last edited:

Nigel Goodwin

Super Moderator
Most Helpful Member
Nigel Goodwin

This design is found in most of the boards with DIP switches, and if you think this is bad!!, please let me know any better design.
Check my tutorials - you're feeding a long wire directly into a high impedance CMOS input - this is just asking for disaster.

As already suggested, a simple pull-down resistor should be used in all cases, or preferably a pull-up resistor, with the switch pulling the input low instead of high - that's the more normal way of doing it (there are various advantages in doing it that way).
 

ksaomar

New Member
Thanks a lot guys, it works now very well.

I put a pull down resistor, but there was still some little sparks, but when I put 100nF across the resistor, all the sparks are gone and I have a clean signal.

I really appreciate what you are doing guys.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top