CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

5V parasite problem on long wires and environmental effects
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ufkyldrm



Joined: 21 May 2018
Posts: 27

View user's profile Send private message

5V parasite problem on long wires and environmental effects
PostPosted: Fri Jul 27, 2018 11:30 am     Reply with quote

Hi guys.

I'm using pic on some industrial projects. Getting pulse from sensors with reed switch is one of them.

I'm getting wrong pulse signal because of environmental effects or cable length.

Is there any way to get this signal without parasite?

My wires are 10 meter but are surrounded by power cables for big machine. So they have magnetic field.

24v circuit with relay can be solution for that?

I heard capacitors can be used for that, do u have any filter solution?
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 11:35 am     Reply with quote

Big question. What type of wire?. Shielded cable?. Twisted pair?. Makes a huge difference.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 11:49 am     Reply with quote

I can run 10 to 15 MILES of solid copper wire and not get 'corrupted data', have so for 30 years.Industrial buildings, some with rooms FULL of arc welders and other 'noise' sources.
As Mr. T asks, what type of wiring AND what data speed / protocol / signalling are you using ?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 11:51 am     Reply with quote

Also, have you had a look (with an 'scope) at the interference signal from your big machine?
Will give you an idea of the size of problem you're dealing with.


Mike
ufkyldrm



Joined: 21 May 2018
Posts: 27

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 11:52 am     Reply with quote

Ttelmah wrote:
Big question. What type of wire?. Shielded cable?. Twisted pair?. Makes a huge difference.


My cable is on link Smile

https://www.igus.com.tr/product/1108
ufkyldrm



Joined: 21 May 2018
Posts: 27

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 11:58 am     Reply with quote

temtronic wrote:
I can run 10 to 15 MILES of solid copper wire and not get 'corrupted data', have so for 30 years.Industrial buildings, some with rooms FULL of arc welders and other 'noise' sources.
As Mr. T asks, what type of wiring AND what data speed / protocol / signalling are you using ?


thank u for your interest.

my cable is on link.

https://www.igus.com.tr/product/1108

I'm not using protocol for getting data. I'm getting direct pulse signal from mechanic water meters with reed switch, Just on off data.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 11:58 am     Reply with quote

Can you draw a simple diagram of your wiring arrangement?
Grounds, terminating components etc.

Mike
ufkyldrm



Joined: 21 May 2018
Posts: 27

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 12:08 pm     Reply with quote

Mike Walne wrote:
Can you draw a simple diagram of your wiring arrangement?
Grounds, terminating components etc.

Mike


Hi Mike

my diagram in on link.

https://www.google.com.tr/search?tbm=isch&sa=1&ei=vF1bW5HoOsaPsgH67KSIDg&q=arduino+reed+switch+&oq=arduino+reed+switch+&gs_l=img.3..0i19k1j0i30i19k1l2j0i8i30i19k1.158106.158106.0.158304.1.1.0.0.0.0.159.159.0j1.1.0....0...1c.1.64.img..0.1.158....0.DwsNBYMyw2U#imgrc=SV9vNvuFCmjWhM:
elcrcp



Joined: 11 Mar 2016
Posts: 62
Location: izmir / Turkey

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 12:37 pm     Reply with quote

That is a problem commonly seen on industrial applications. Although there are several solutions suggested, what I would suggest is what I did.
-Use shielded cables and connect shields to common ground at one end (prefably on main circuit)
-Connect filter capacitors (in parallel) from picofarads to milifarads at main power input on your circuit
-(Optional) Use filter coils at both ends of signal cables like these ones https://www.ebay.co.uk/p/10pcs-5mm-Clip-on-Noise-Ferrite-Core-Ring-Bead-Filter-RFI-EMI-Cable-Clip/8014413332?iid=173142890423
First two option together solves the problem generally.
_________________
There is nothing you can't do if you try
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 12:42 pm     Reply with quote

Quote:

Can you draw a simple diagram of your wiring arrangement?
Grounds, terminating components etc.


Ok Agree wholeheartedly with this question.

I'm getting the suspicion, you are just using the reed relay to pull the signal either up or down, and possibly just a pull up resistor taking it the other way.
Is this correct?.
Where is the power for this coming from?.
Draw the wiring.
How is it connected at the PIC end?.
What cores of this wire are used for what?. (Two core wire).
How is the shield connected?. Are you drawing power through the shield?.
ufkyldrm



Joined: 21 May 2018
Posts: 27

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 1:16 pm     Reply with quote

Ttelmah wrote:
Quote:

Can you draw a simple diagram of your wiring arrangement?
Grounds, terminating components etc.


Ok Agree wholeheartedly with this question.

I'm getting the suspicion, you are just using the reed relay to pull the signal either up or down, and possibly just a pull up resistor taking it the other way.
Is this correct?.
Where is the power for this coming from?.
Draw the wiring.
How is it connected at the PIC end?.
What cores of this wire are used for what?. (Two core wire).
How is the shield connected?. Are you drawing power through the shield?.


Im just using reed switch to on off signal, thats all. Smile dont be suspicion.

Power is coming from 5 V arduino autput on machine panel. Arduino has other mission on the machine. Im just using its 5V supply and gnd. Is there a problem?

Im using two core wire.

I solders cable shield to the gnd.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 2:05 pm     Reply with quote

So from the circuit, you have the wire shown coming out of the top of the Arduino board as one core in the cable, and the ground as the other?.
What resistor value?.
Which end of the cable is the shield connected?.

The resistor value wants to be low. The shield should be connected just at the PIC end. Then given this is not going to be a fast signal, a reasonable capactor between the signal and ground at the PIC end.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Fri Jul 27, 2018 2:12 pm     Reply with quote

Mr. T. and I suspect that you are not understand the nature of the problem you're facing.
I do not think you are being devious in any way.

You started by complaining of problems caused by a "big machine".
But you are not supplying the necessary detail of your system.
You've told us that your components are as below :-

Code:

5V ----WWWWWW----------      ----------------------------------         ------|
                 |               One of twisted pair cores                    |
               \                                                              |
   Reed Switch  \            ----------------------------------         ------|
                 |                Other twisted pair core                     |
                 |                                                            |
0V---------------------      ----------------------------------         ------|
                                        Screen

    Signal Source               Screened Twisted Pair Cable                PIC



However, you are not telling us HOW they are connected.
I've left blank spaces for you to fill in.

Mike
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Sat Jul 28, 2018 2:38 am     Reply with quote

I'm particularly suspicious there may be connections at both end of the shield, which can then result in current flowing in the shield, which can make it worse than useless. Also that the actual drive may be something like 4K7 or 10KR, which means that the line when pulled (up?) by this, is quite high impedance.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jul 28, 2018 7:16 am     Reply with quote

I had a look at his link..
Quote:
my diagram in on link.

He has a 10K pullup on one side of the reed switch, gnd on the other.

At the very least he needs a filter cap (say .68mfd) at the PIC side of the connections. I suspect a fair amount of 'bounce', maybe add a .01 mfd across the reed switch itself.

I'd probably replace the 10K with a 1K pullup, depending on the current capacity of the reed switch. Better to drive 'hard' rather than 'soft'.

Eliminating EMI or 'noise' is 1/2 engineering, 1/2 black magic and 1/2 good luck.

Jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group