noise on microprocessor data line

I have a pair of Hall sensors (Allegro A1101's FYI) feeding into a PIC microcontroller (16F505) (directly into data ports) and I am having a terrible noise problem. The noise arises from the fact that a single DB9 serial cable carries both the sensor signals and power for an electric motor. There is nothing I can do to separate the motor power from the sensor wires so I need to do something at the microprocessor board.

The motor power and power for the PIC are coming from two completely independent power supplies, and the PIC has a bypass capacitor installed across its power supply pins. Currently, I have been using a .1uF ceramic capacitor across the data and ground pins where the sensor input enters the board. This, in combination with some debouncing code in the PIC has worked...alright but I still get some false signals making it into my code. The sensors output a logic zero when the magnetic field is detected and this is what I am looking for in order to send a control signal to reverse the direction of the motor.

In short, what would be a better way (hopefully not too complicated) to filter high frequency noise from the data lines? A bigger capacitor from data->ground? I have about a half second of allowable delay before the magnet completely passes up the sensor (and then we have big problems).

Reply to
jsutinen
Loading thread data ...

Hi,

Is it possible to relocate the PIC to where the sensors are?

Luhan

Reply to
Luhan

No unfortunately the sensors are located on opposite ends of a linear actuator and they travel through about 3 feet of their own cable, and then join up with the motor wiring and travel another 6 feet inside a DB9 serial cable to the test box where the PIC is.

Reply to
jsutinen

Are the hall sensors open collector ?

Graham

Reply to
Eeyore

Open drain in fact - I just looked.

You need to buffer them right where they're located ! That should fix it.

Graham

Reply to
Eeyore

Yes they are. The previous revision of the controller had pullup resistors on the data lines to the PIC but I noticed the PIC has its own internal pullup so I'm going to try leaving them off this time around (also to help determine why every couple months the PIC would burn out).

Josh

Reply to
Josh

I'd love to, but the sensors are part of a sealed cable assembly :) It somehow works in the end product, but I don't have access to the electronics that drive it there.

Reply to
Josh

The use of open collector outputs is the reason you're picking up so much noise. Try sticking 470R in as an extra external pull-up.

Graham

Reply to
Eeyore

See my other post then ! Pull-ups won't hurt your PIC btw.

Graham

Reply to
Eeyore

The internal pull-up resistors are relatively low current. About 200uA. Not suitable as a replacement for an external pull-up, especially in a noisy enviroment. Look at retaining the external pull-ups. What is the nature of the supply feeding the PIC?. Remember that if the internal trap diodes in the PIC, which limit the inputs to about 0.6v above the supply, come into play, the energy has to go 'somewhere', and on a low power circuit, may well be increasing the supply voltage to kill the PIC. Personally, I'd suggest adding a dual opto-coupler, between the lines and the PIC.

Best Wishes

Reply to
Roger Hamlett

Can you run the sensor signal differentially?

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

Good point. You can make it a current loop then.

Graham

Reply to
Eeyore

You need bypass capacitors on the motor supply, and right at the motor, and possibly some ferrite beads or chokes.

You say there's nothing you can do about the cable - can you replace the whole thing with shielded twisted pairs?

Good Luck! Rich

Reply to
Rich Grise

"...PIC would burn out" -- think about transient suppressor devices, in addition to the pullups.

Reply to
Richard Henry

As you have open drain outputs you can use an opto coupler to isolate the noise.

Reply to
cbarn24050

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.