PDA

View Full Version : Electrical noise problem with PIC 16f84



Snap
- 22nd August 2007, 06:56
If you look at my other threads you can see I am working on a slot car timer. basically I trip an IR beam through a photo transistor and this allows positive voltage to pass to the pin which I programed to turn on a led when the pin is high. This worked great on the bench but when I installed it in the track the led light flickers on when ever you rev up the car. I am not one to go racing to this forum at the first sign of trouble so I have been working on this for a week now and can not figure it out I have removed the IR circuit from the equation as well as plugged the track and pic into separate wall hydro lines. There is no connection between the track and the PIC ( I now trigger the led with a switch when it is off the light will flicker from the car). It only does it with high pitched whining cars (the really fast ones). This might be EMI or a grounding problem. Could programming be the problem? Is this common with small 20 volt dc motors?
Any help is much apreciated.
Thank you
Snap

Snap
- 22nd August 2007, 07:46
I was almost asleep and I remembered I have to check the programing I think in my haste I left some pins hanging with out pull resistors. This might make the unit very sensative to static or sound. Ill check tomorrow....back to sleep
Snap

Snap
- 23rd August 2007, 00:53
Ok, I cleaned up the program and pulled the input. This DID not work!, so I started to play around with different resistors and finally I think it works now. The pull down resistor was very big 197k and I did not put a pot on the IR detect. I will learn more about what happened suffice to say an off balance input pin is very suseptable to electric noise. Next time I will post a full schematic and program.

Snap
- 23rd August 2007, 03:57
I can still get the light to flicker with DC motor noise. I give up. I hate electronics . I am going to be a carpenter and make matchstick rocking chairs.

sayzer
- 23rd August 2007, 07:50
Put 0.01uF/275V X2 type capacitor across the motor terminals.

=========================

mackrackit
- 23rd August 2007, 07:56
I can still get the light to flicker with DC motor noise. I give up. I hate electronics . I am going to be a carpenter and make matchstick rocking chairs.
Yeah, and then you will want to automate the process with a PIC.

I bet when you "rev" one of these cars you can here it on a radio and see it on a TV.

The amount of current going through these motors will also produce a far amount of EMF.
All of this you know.

Faraday Cage = Coffee Can

Place the circuit board inside a coffee can with the open end pointing away from the race track.

I say this because it is made of steel. Aluminum will work for RF, steel will work for RF and EMF.

This should route the RF and EMF around the PIC. For the same reason I use only steel enclosures around projects that will be in machine/welding shops.

Also, a capacitor to ground from the IR pin may help act as an RF filter.

Snap
- 24th August 2007, 01:45
I can't modify the cars so I tried to make a faraday cage with a king sized beer can. First I had to empty the can and several others in case I wrecked the first one cutting the top off.
I put the bread board in the can and covered the other end with foil. I poked a small hole so i could see if the light flickered and to let the power and ir detect wires in and set it up.
It seemed to make no difference what so ever.
I was about to try grounding the can to a wire attached to the ground on the outlet and desided to try the other idea of a cap on the ir pin. This greatly reduced the flicker.
I used a 10 uf electrolite cap.
The project works well enough to move in and start programming reset buttond and relays to start and stop the cars.
Thanks for the posts

sayzer
- 24th August 2007, 07:26
What about the cap accross the motor terminals?

Didn't you put one?


----------------------------------

Snap
- 24th August 2007, 13:35
Thanks for the advice but these are vintage collector HO scale slot cars and I own about a hundred of them. I can't modify them.
Snap

Snap
- 26th September 2007, 00:47
I tried everything I could think of, coffee can, caps on inputs and even caps on the rails them selves each one hellped a little bit more but not 100%. Finally I found another person who had the same problem. he suggested all the things I tried as well as explaining that the spikes were way faster then the cars. I programmed in a 7 us delay after the first signal is recieved and then wait and see if it is still there after and it worked. I could even take the board out of the coffee can. I am learning a schematic cad program and will post everything when I am done. Thanks to everyone who helped I am adding a relay start and programmed sound so Im sure I will be back .
Snap

mackrackit
- 26th September 2007, 00:54
Nice solution!

mvs_sarma
- 26th September 2007, 09:36
I can't modify the cars so I tried to make a faraday cage with a king sized beer can. First I had to empty the can and several others in case I wrecked the first one cutting the top off.
I put the bread board in the can and covered the other end with foil. I poked a small hole so i could see if the light flickered and to let the power and ir detect wires in and set it up.
It seemed to make no difference what so ever.
I was about to try grounding the can to a wire attached to the ground on the outlet and desided to try the other idea of a cap on the ir pin. This greatly reduced the flicker.
I used a 10 uf electrolite cap.
The project works well enough to move in and start programming reset buttond and relays to start and stop the cars.
Thanks for the posts

Congrats-- But it is not proper to think like hating something, the moment it is teasing you. the challenge is only the to study, implement and overcome hurdles.

Arts like carpentry etc are equally problematic to people like me - should have aptience and gain experience from failures

All the best