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 woes and design issues

Status
Not open for further replies.

MrDEB

Well-Known Member
Built a BEER COOLER thermostat that works great on the bench and kinda works when installed. I replaced the 18F4520 with a second pic w/ revised program but then the LCD displays erroneous temperatures as well as weird symbols. THINKING power supply noise. Looking at my schematic, it has plenty of caps etc so why?
I think its because the 7805 is located 6 feet from the board w/ the PIC..
The whole thing works just fine on the bench so its got to be noise from the relay (controlled with uln2803) combined with the input 110vac which is powering three fans.
IMO the 7805 needs to be as close to the PIC as possible as EMF can wipe out the correct data input.
Any thought if I am on the wrong track?
 
I think its because the 7805 is located 6 feet from the board
Quite possibly. I had problems with an off-board 7805 years ago. Found it was oscillating. Extra capacitance on the output cured it. But sounds like you've covered that angle already.
 
Are you using PCB or stripboard to build your circuit ? if it is a noise problem, good earthing may help.
 
The power supply is on a perf board as well as the PIC circuit but the two are interconnected by a 6ft section of cat5 cable.
The plan now is to move the 7805 onto the PIC board.
 
What kind of relay are you using to switch your motor and are you saying your shutting the fans off
 
There are 2 good rules when using the ADC to measure anything that is slow to change (like temperature), especially with a remote sensor;
1. Put a good size cap on the PIC ADC pin, 1uF tantalum etc should be enough.
2. Add up many ADC samples over a couple of mains cycles (as the AC mains will be resonsible for much of the mV noise on the external ADC line). SO take say 10 samples over one mains cycle and repeat it a few times until you have added up say 40 samples over 4 mains cycles, then divide the total by 40. That will give you a fairly reliable average from the ADC pin over about a tenth of a second.

Of course you also need to make sure the PIC Vdd voltage remains constant and stable especially if you are using Vdd as the ADC Vref. A nice cap right at the PIC between the Vdd and Vss pins is good, at least 0.1uF.

Since you said your 7805 regulator ware remote to the PIC, I hope you had some good caps right at the PIC, like a 100uF and a 0.1uF together.
 
The ADC routines (2) are being used to input the desired temperature and the amount of delay (turn off the cooling compressor but leave the evaporator fans on) so no issue with the ADC.
The evaporator fans are running 24/7. I eliminated the delay loop but when I changed out the PIC the LCD display indicated temps in the 70's which are not correct. Ordered some 7805's and going to place the 5v reg section onto the same board as the PIC. The relay is 12v coil w/ 20a contacts. The relay is controlled using a ULN2803.
Pretty sure the issue is the 7805 is oscillating or other due to its distance from its target source. Everything works as desired on the bench so I have no fan motors operating off same mains supply. This is the only difference I see from being installed and bench testing. The weird LCD display (x//x?/(distinguishable characters that make no sense, jibberish) etc are displayed which IMO indicates a glitch in the power supply. These characters never appear while bench testing.
 
A picture is worth a thousand words

Here is a schematic of what I have on the perf board.
Maybe if I mounted it on a pcboard with a ground plan it would solve the issue but first get the 7805 on the same board as the PIC. Could also be EMF seeing how I have 5v in the same cable as the DS18B20 data wire and the Vcc to the DS18b20. BUT then it should act the same as when being installed so I am voting that the 7805 is going crazy (not stable with the fan EMF noise etc
 
If you have it like the SCH your picking up noise from relay and maybe the power supply
 
If the noise is from the relay then why do I not have issues when bench testing?
I vote the power supply noise.
I ordered some new 7805's and plan to add to the PIC board(will call it board PIC) and not the board with the UNL2803 as I have it presently(relay board).
The ULN2803 / relay/ 7805 are on one board now but removing the 7805 and placing on same board as the PIC(board PIC) hopefully will eliminate the noise. Will include some caps before it leaves the relay board.
 
Sounds like a power supply issue, romans advice sounds a logical one, you dont necessarily have to put the 7805 on the same board, though it might reduce your problem.
Does the relay have a back emf diode?
And if your swtching fans or fridge compressor motors then your load is inductive and will cause flash at the relay contacts, I've had this screw up pics before and the longer the leads are the more susceptible it becomes.
A 100nf xrated cap and a 1w 100r resistor across the relay contacts will lessen flash considerably for this sort of load.
This combined with power supply filtering 100uF cap and 100nF cap at the pic should improve things, I've prototyped pic software on breadboard a few times and the only way the chip would even boot is with a 100nF right accross the pic with the a/d converter enabled, with the a/d is disabled the cap isnt needed, I never worked out why this happens.
 
Last edited:
using the ULN2803 does not require the back diode.
The mains for the compressor are on a separate circuit. The only items attached to the mains powering this project is three evaporator fans plus the wall wart for powering the PIC project.
Whats really weird is the unit is running what looks like its right (the temperature display is correct) but swapping out the PIC w/ another PIC the temps display 75, 78, etc instead of 34, 35 etc..
Let the unit sit for an hour? and it starts displaying the correct temps but still hangs in the delay routine.
I altered the delay routine so all the PIC is supposed to do is turn on the compressor and turn off only when needed, the delay (defrost) is only for 2 minutes but on the bench all is good, installed, it hangs in the delay.
Going to try the power supply issue first then go from there. eliminate by process of elimination.
 
Sounds like a good plan of action I've had similar things happen with pics and found its a ground bounce or noise issue.
 
Status
Not open for further replies.

Latest threads

Back
Top