![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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!!!!! ![]() | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| :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!
__________________ Regards MATT! | |
| |
| | (permalink) |
| 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! | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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... | |
| |
| | (permalink) |
| :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. http://www.electronic-supply.com/capconversion1.htm Let us know how you get on!!
__________________ Regards MATT! | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| :roll: LOL, NO a 1nf not 0.1!! and a ceramic is fine, probably best actually! http://www.ee.washington.edu/circuit...apacitors.html This may help!
__________________ Regards MATT! | |
| |
| | (permalink) |
| that is what i ment to type :wink: lol, thanks. | |
| |
| | (permalink) |
| :!: 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:
__________________ Regards MATT! | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| :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?
__________________ Regards MATT! | |
| |