PIC Microcontroller and Reducing Noise.

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Thank you for reading my posting,
I have been working with a simple circuit involving a PIC12F617 microcontroller written in assembly. This circuit simply blinks an LED on for 1 sec and then off for 1 second and then repeats in an endless loop.
I have then taken this circuit and powered it on my distributor testing machine through a distributors 12v(14.3v) and ground.
When the power is on with NO spinning of the distributor the circuit blinks as it should, 1 sec on and 1 sec off. I then increase the rpm and see how the circuit reacts to noise.

What I found:
1) At '0' rpm the circuit works perfectly.
2) At a static rpm the circuit sometimes works for about 30-40 seconds then blinks sporadically and then just stops working at which time I return the rpm to '0' and disconnect either the ground or power and reconnect. The circuit will then blink as it should at '0' rpm.
3) I do not have BOR or POR active in my program. I did try BOR active but did not see any change.
4) I replaced the 5.1v zener on the VDD for the PIC with a 12v zener and found the circuit functioned better. This goes against my logic on this as I thought a 5.1v zener would work better for this.

Questions:
1) How can I better deal with the noise in this circuit?
2) Should I have different values for my zener diodes and/ or capacitors?
3) Is there a better way to make this circuit immune to noise?

I am using the 12v and 5.1v zener in series for a 17v total because those were the only values I had on hand.
The vertical line to the right of the PIC 12F617 is not a trace it is a line that appeared when document was copied, please ignore it.

This is working out to be a good exercise in solving issues with noise in a microcontroller circuit.

Thank you for your incite.

Peaches

100_0273.JPG
 

be80be

Joined Jul 5, 2008
2,072
100_0273.JPG Put a lot bigger cap on C1 100uf And added a ,1uf across the power VDD and VSS of the pic chip and 10uf also.
 
Last edited:

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Put a lot bigger cap on C1 100uf And added a ,1uf across the power VDD and VSS of the pic chip and 10uf also.
Thank you for your response.
Did you mean to say " Add .1uf across VDD and VSS of the pic chip" instead of ",1uf"?

I appreciate your help.

Peaches
 

be80be

Joined Jul 5, 2008
2,072
Both change C1 to 100 uf and add a .1uf and 10 to 100 uf across the vdd and vss close to the chip power pins

And Change C2 to 10uf get rid of D3
 
Last edited:

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Both change C1 to 100 uf and add a .1uf and 10 to 100 uf across the vdd and vss close to the chip power pins
Thank you for the clarification.
Am I correct to say that the increase in capacitance will act to keep the VDD steady when the zener reaches the avalanche point and sends the voltage spikes to ground? Or are there more reasons for doing this?

I am learning something new and thank you for your guidance.

Peaches
 

be80be

Joined Jul 5, 2008
2,072
100_0273.JPG The way you have it is not how the regulator output side needs a 10 uf to keep it stable
the pic needs a .1 uf to clean the power and the 10 uf to 100 uf to keep it stable.
 
Last edited:

Thread Starter

Peaches41

Joined Dec 15, 2016
70
View attachment 131697 The way you have it is not how the regulator output side needs a 10 uf to keep it stable
the pic needs a .1 uf to clean the power and the 10 uf to 100 uf to keep it stable.
I do see that it would add stability to the circuit. Therefore the 5.1v zener would not be needed on the output and your power line for the pic would be more stable and clean with the caps in parallel. Any voltage spikes would then be sent to ground before the input to the regulator. I always thought I would need to add zener diodes when working with the PIC, more so than I have in the circuit above.

Continued thanks,

Peaches
 

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Thank you to all for viewing my post,
I was able to rework my circuit with the recommended caps and found great results when functional testing the circuit on a distributor machine. Many thanks go to be80be for helping me learn how to solve this issue I was having.
I have now taken the circuit mentioned above and have removed the one second blinking led code and have reprogrammed the PIC to respond to the output on the collector.
This circuit works as shown here but I am seeing some noise on my oscilloscope trace that I am not sure how to get rid off. If you look at the lower right of the photo I have supplied in this post, you will see the trace that I am speaking of. The voltage spike(common emitter) labeled "A" appears only up to 2600 rpm (I am figuring an 8 cylinder engine here) with each pulse occurring at .002885 Seconds. After this rpm (rpm over 2600) the spike goes away.
I have probed the circuit on the base, collector, and the output pin (led blinking to show the pulse) of the microcontroller, and have seen the same result of the voltage spike after the voltage goes back to 14.3v.
I was not sure if I should add a filter cap to the base of the transistor creating a low pass filter with the voltage divider and calculate the cutoff frequency to use, or if there is another way to filter out this voltage spike.
Any suggestions would help me troubleshoot this circuit and learn how to solve these noise issues.

Many thanks,
Peaches
100_0277.JPG
 
Top