Continue to Site

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.

  • 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.

power supply for pic - need help.... interference problems!

Status
Not open for further replies.

SnM

New Member
i have built a project using a pic12C508A, and everything is working pretty good. I do have a problem with interference...

i do have a push button to toggle the pic between two different states. disabled has a red led on, and enabled has a yellow led on. I am powering the circuit with a 12v wall transformer, and that goes into a 5 volt regulator, which then powers the pic. The problem is when i turn on or turn off this small floresent light that is conncted to the same circuit that the 12v transformer is plugged into. if my project is set to disabled, and the light is turned on or off, it will switch to enabled mode. and if it was in enabled mode, it sometimes will lock up the chip, and both leds go off, and i need to pull the power and reset it. (no reset button, and no wdt)

i tried moving the 12V transformer to a different circuit in the house, and the light doens't cause any more interference. So i am guessing the light is causeing a surge or spike in the lines, causeing the pic to act weird. i don't think it is a power drop because when i pull the transformer out of the wall, the leds stay lit for about 3 seconds before fading away.

i guess i need help on a better power supply to run my chip. i have attached a pic of what i am currently using for a power supply.
any help would be greatly appreciated. thanks in advance!!!!!

**broken link removed**
 
For a start I would suggest replacing the half wave rectifier with a full wave one, or a bridge if you don't have a centre tapped transformer.

Also, the 100uF looks a bit small for a reservoir capacitor, 1000uF would be better. What sort of current are you trying to take from the supply?.

It would probably be a good idea to add a 0.1uF on the input side of the 7805 as well, both 0.1uF capacitors should be as close to the 7805 as possible.

PIC's are actually very tolerant of their power supply, so it usually needs to be really poor to affect it.
 
Well the transformer is just a basic wall one, so it just gives me 12VDC and GND. I am not drawing that much current, just running the pic, a relay sometimes, and two led's. I currently wired wrapped this project up. thinking about it, the .1uF cap is not as close to the regulator as possible. i should probably relocat that, and add one to the input side.

i'll then try a 1000uf cap on the output side.

any other suggestions? thanks for the quick reply. i'll modify what i got this week and let you know the outcome! thanks

steve
 
:wink:

The problem is the "small floresent light", these babys put some nasty high voltage spikes onto the mains supply, pic are suseptable to this problem, I have built many controllers for mains (temp/light/actuators etc) and this is almost 100% the problem......

As well as increasing the main cap (470-1000uf)..........

Try fitting a 10uH choke (inductor) in series along with a 1nf cap (across pins 5 and 14) as close as possible to the pic, this should sort the bugger! :wink:

Also if you are using the "brown out" feature on some pics, this will make the problem worse appear worse, the brown out has a fast response time.

Hope this helps!
 
only got 8 pins on the pic :wink: You are talking about the cap that goes between the + and ground on the pic, right? I'll try adding a choke. thanks for the tip.

also, i am not using the brown out feature.

thanks!
 
no luck yet..... :(

well i tried a:
10mH inductor in series with the .1uF cap i have going between Vcc and Gnd
changed the cap at the output of the voltage regulator to 470uF (also tried 1000uF) (also tried replacing the 100uF cap with a 1000uF one while the 470uF was at the output.)
added a .1uF cap to the input of the voltage regulator

and the small small floresent light is still causing a problem. it seems to cause the interference more when I shut the light off, than on.

any other way to keep the spike from causing problems? i thought i was safe using a voltage regulator, but how much of an actual spike do you think I am getting? I can't measure it with my dmm.

any further help would be great.

steve
 
How are you switching the light on and off, are you using a relay?.

When you turn a florescent light off the large choke in the fitting causes a large back EMF, this tends to spark across the switch contacts. You could try fitting a capacitor across the contacts to try and reduce the sparking - just like across the points in an old car ignition system.
 
the light is being turned on and off with a switch. it is not a part of my project, it is just a light that was always a part work area. don't really want to modify the light. maybe i'll see if we have a surge protector, maybe that will work...
 
:idea:

Try a 1nf not 0.1uF cap, across pin 8 and 1, this is 100 times smaller than the 0.1uF that you have tried.

**broken link removed**

Let us know how you get on!!
 
i already had a .1uF tandalum (sp?) cap there, so i figured that would still work, and save me a bit of time changing it out. i was thinking, bigger = better ha... :lol:

anyway, i'll see if i have a .1nF cap. should this be any special type? i probably only have ceramic ones this small..... by chance do you know the code number for that? all those caps have codes like 104, 103, ect.... had a chart somewhere, but i don't know where it is.

thanks
 
:!:
Sorry, forgot to mention, they are normally marked 1n (obvious or what!) but I know what you mean, I always get a mental block on caps..... thank heaven for google!! :wink:
 
Well, i tried the .1nF cap, and i get the same results.

Now, we also have a radio hooked up to the same power circuit. if that radio is turned on or off, it either switches modes, does nothing sometimes, or it crashes the program.

We tried plugging in the wall transformer into different circuits, but the same thing kept on happining. so i am thinking maybe it could be some RF interferrence?

what do you guys think? not sure what else to do...

Thanks again for any help!

steve
 
:idea:

Can you post the code for us to have a look at? the complete asm would be good, in an asm (or zip) attachment?

Does the pic "reset" with nothing attached?
 
Hi,
are there any unused input pins which are not tied to GND/Vdd ?
regards
joachim
 
How do you have the Reset pin configured?

PIC12C508A can be configured to use MCLR_n pin or reset internally. If you intended to reset internally and didn't put a pullup on MCLR_n, but forgot to set the CONFIG bit as such, that's exactly what will happen. Also, you may have used too large a resistor on MCLR_n. 1k is sufficient.

Do not put an inductor to the PIC's power pin. Inductance generally cause voltage spikes when the current changes, this is a bad thing. The regulator can do nothing to fix this and you can lock up the part. As was suggested already, just put a capacitor on the input and another on the output to the reg, as close to the reg as you can. Add a small ceramic disk cap on the PIC's power pins. Then it seems very implausible that the problem is in the PIC's power pins, look elsewhere.

Make sure you do not have any PIC inputs connected to a voltage above 5V (such as a pullup resistor on your switch being connected to the 12V source instead of the 5V).
 
well, last night i messed with it a bit. I modified it so it can run on a 9V battery. The problem was still there. Since the power is running off of a batter, the power supply doesn't seem to be the problem now. I think I am getting some interference through one of my inputs. I have a remote switch, that is connected by 10-15 feet of wire.

Thanks for your help everyone. :) I am going to look at it more tonight.
 
Hi,
if the wire of the remote switch isn't shielded it will behave like an antenna catching all 'electrical dirt' that's in the air around. This might be the reason for the strange behaviour of Your circuitry. An optocpoupler should solve the problem.
hth
regards
joachim
 
thanks, i'll look into isolating the switch with an optocoupler.

i was still able to get it to reset or "crash" with it on battery power, and with the switch not connected. i have some snap connectors a few inches out from my unit. i disconnected them and then connected them together, so it appears the switch is closed. instead of 10-15 feet of wire, it is then about 6 inches. the problem still exists, but it is harder to have it happen.

i guess these pics don't really like interference in the inputs! i'll let you guys know how the optocoupler works...

Thanks again for all the help!!!! :D

steve
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top