Maker Pro
Maker Pro

Can someone check this layout to see if its correct plz???

Hi,

I'm a beginner in electronic design with no courses. I've learned all i know by myself but lots is missing. So i need someone to check this out to see where i've done an error.

I have designed a module to protect a machine at my shop from overheating and stopping production.
The module use a DS18B20 as sensor and when reach 50c trigger a alarm with a buzzer and a led. A 1602 LCD show the temperature and alarm too.

I have done the design, programmed the chip, and tested it on a QL200 prototyping board. It worked flawlessly.

So i continued and designed the pcb using designspark. Now the pcb is etched and fully soldered.

I double checked all the connection and everything seems ok, but it doesn't work. The lcd light up, but nothing show as it is supposed. More than that, the buzzer start to buz after 1 min or like and is not supposed to so until the PIC16F876a tell him to do so.

So i'm a little confused. If someone can check the layout and point out the problem (that i supposed is easy to found but i lack the necessary knwoledge) i would really appreciate.

Don't know if its in the layout or in the board desigh...

Thank you,

Mikael

PS: The R8 resistor pulling the mclr up is missing on the board, i added it manually after so disregard this error, its already corrected.
 

Attachments

  • BOARD.jpg
    BOARD.jpg
    180.6 KB · Views: 177
  • LAYOUT.jpg
    LAYOUT.jpg
    64.3 KB · Views: 170
Last edited:
Welcome aboard Mikael! Cool project, glad you were able to make something you can use in your shop!!

  1. So there are two problems: The LCD has power, but no letters appear or ??
  2. And the buzzer sounds off after a minute without getting the signal from the PIC.

Not sure about the LCD, but did you check to see if U2 is damaged? Perhaps remove and replace it with another. Also check to see if the PIC is function properly, trigger the temperature detector and see if RB1 activates
 
Connection 15 and 16 appear to be back to front.
Also have you tried adjusting the LCD contrast.?
looks like some weird connection around C1 and C4 too. Didn't have time to look further yet (have to work):)
 
Last edited:
Welcome aboard Mikael! Cool project, glad you were able to make something you can use in your shop!!

  1. So there are two problems: The LCD has power, but no letters appear or ??
  2. And the buzzer sounds off after a minute without getting the signal from the PIC.

Not sure about the LCD, but did you check to see if U2 is damaged? Perhaps remove and replace it with another. Also check to see if the PIC is function properly, trigger the temperature detector and see if RB1 activates

Hi,

Thx for the reply. Yes there are 2 problem. The lcd light up but nothing appear. I tried ajusting the contrast, but the problem remain.
Yes the buzzer sound off after a min without getting the signal.

I will try to replace U2 as you said. Maybe it overheated when i soldered it to the board. I don't have time this week to check this out, i will do this weekend.

Have a nice week!
 
Hi, i've done some testing and correction and all is fine now. Execpt that the chip dont work because the oscillator not oscillate properly and i dont understand why. I changed it for another one to see if i damaged it when i solderred it but same problem. The oscilloscope show strange uneven oscillation with lots of ripple. The only problem reside in this now, but i dont know how to repair this. I think the problem reside in the design of the pcb but i dont know where. I tested all connection and all is soldered properly and all connection is fine. So i'm deadlocked on this one. Help???

EDIT: I re-checked it with the scope. The circuit is not working by itself, but surprise when i connect the scope probe to the OSC2 signal , the circuit start working. But barely. The cristal is not stable and i can't use it to communicate with the DS18B20 sensor. Any idea of what to do to stabilise the osc??? Check the scope output so you can see what i've seen. Thx
 

Attachments

  • Oscilloscope Trace.jpg
    Oscilloscope Trace.jpg
    115 KB · Views: 126
Last edited:
Hi, i've done some testing and correction and all is fine now. Execpt that the chip dont work because the oscillator not oscillate properly and i dont understand why. I changed it for another one to see if i damaged it when i solderred it but same problem. The oscilloscope show strange uneven oscillation with lots of ripple. The only problem reside in this now, but i dont know how to repair this. I think the problem reside in the design of the pcb but i dont know where. I tested all connection and all is soldered properly and all connection is fine. So i'm deadlocked on this one. Help???

EDIT: I re-checked it with the scope. The circuit is not working by itself, but surprise when i connect the scope probe to the OSC2 signal , the circuit start working. But barely. The cristal is not stable and i can't use it to communicate with the DS18B20 sensor. Any idea of what to do to stabilise the osc??? Check the scope output so you can see what i've seen. Thx

Is it possible that the PIC clock driver is overdriving the crystal? Your circuit doesn't show a resistor in series with clkout pin.
 

KrisBlueNZ

Sadly passed away in 2015
Well, your PCB could be improved, but I don't see anything wrong with it. But testing a crystal oscillator by connecting a scope to it can be a problem, especially if the scope has significant input capacitance, and especially if you connect it to the side of the crystal that connects to the input of the inverter inside the IC.

You can connect a scope through a resistor (e.g. 1 kΩ) to the OSC2 pin; you should see a clean and consistent waveform, although the amplitude will be small.

I don't see any decoupling capacitors across the PIC. Tack a 0.1 μF multi-layer ceramic capacitor (MLCC) in an SMT package (or a small THT package) on the underside between pins 19 and 20.

Another common cause of this symptom is that you made a firmware change during the time you were waiting for the hardware and accidentally broke something. In other words, the problem may not be hardware-related. Try starting a new project that just does something very simple like toggling an output, and download that to see whether it works.
 
Well, your PCB could be improved, but I don't see anything wrong with it. But testing a crystal oscillator by connecting a scope to it can be a problem, especially if the scope has significant input capacitance, and especially if you connect it to the side of the crystal that connects to the input of the inverter inside the IC.

You can connect a scope through a resistor (e.g. 1 kΩ) to the OSC2 pin; you should see a clean and consistent waveform, although the amplitude will be small.

I don't see any decoupling capacitors across the PIC. Tack a 0.1 μF multi-layer ceramic capacitor (MLCC) in an SMT package (or a small THT package) on the underside between pins 19 and 20.

Another common cause of this symptom is that you made a firmware change during the time you were waiting for the hardware and accidentally broke something. In other words, the problem may not be hardware-related. Try starting a new project that just does something very simple like toggling an output, and download that to see whether it works.
I will see to that. But the main problem is that the circuit is not working if i not probe OSC2 pin with the scope. So maybe the cristal need instead more drive??? Since the probe add 10pf to c2, if i switch to 2x 33pf instead of my 2x 22pf will it drive it high enough or i risk destroying the cristal because it is already overdriven and i need to put a resistor in serie with osc2??? I'm a littel confused on this one....
 

KrisBlueNZ

Sadly passed away in 2015
I've told you how to watch the crystal oscillator using your scope. Put a resistor between OSC2 and the scope probe. And don't try to probe OSC1.

I doubt that you're overdriving the crystal.

What is the crystal frequency?

Are you using the same type (same manufacturer and part number) of crystal now as you were using before, when it worked?

How have you set the FOSC1 and FOSC0 bits in the configuration word? These need to be set to the "HS" setting to enable the external oscillator with an HF crystal.
 
I've told you how to watch the crystal oscillator using your scope. Put a resistor between OSC2 and the scope probe. And don't try to probe OSC1.

I doubt that you're overdriving the crystal.

What is the crystal frequency?

Are you using the same type (same manufacturer and part number) of crystal now as you were using before, when it worked?

How have you set the FOSC1 and FOSC0 bits in the configuration word? These need to be set to the "HS" setting to enable the external oscillator with an HF crystal.
I have tried to check it with a resistor as you said, same thing. I reprogrammed the chip in XT mode to try and the chip was able to run at the 400KHz the osc is giving, but barely. Its a 4 MHz cristal. I de-soldered de cristal and put it in my test rig again, worked flawlessly... Take a look at the scope of the test rig.
I tried to add some capacitance up to 44pf c1 and c2 and i got a slightly better freq (some khz) but nothing more... I want to test adding a resistor in serie on the osc2 line, but this is supposed to only reduce the amplitude no??? I'm completely lost on this one.... Its pretty sure its a pcb design flaw, but i dont know where the hell... I double checked all the connection and all is ok...
EDIT: After a lot of reading about troubleshooting cristal i've found that the problem maybe that i have insuficient loop gain because the 2 board dont have the same stray capacitance. I maybe need to reduce my actual capacitance of 22pf each.
 

Attachments

  • CorrectOsc2c.jpg
    CorrectOsc2c.jpg
    136.2 KB · Views: 90
Last edited:

KrisBlueNZ

Sadly passed away in 2015
Could you upload photos of your board and the test setup please.

Have you added the decoupler?

Also you could try isolating the 0V return of the capacitors from the path between the MCU and the LCD by making a track cut and bridge like this. No guarantee it will fix anything though.

BOARD.png
 
Could you upload photos of your board and the test setup please.

Have you added the decoupler?

Also you could try isolating the 0V return of the capacitors from the path between the MCU and the LCD by making a track cut and bridge like this. No guarantee it will fix anything though.

View attachment 18091
Hi Kris,

I buyed some parts to make test this weekend. The first i made was compensating for the circuit capacitance due to the socket by lowering significantly the osc. caps. I soldered 2x 12pf to replace the 2 22pf.

The circuit is now working, but still have some problem. The circuit dont commhnicate properly with the DS18B20 digital temp sensor. On the test rig, it work flawlessly. The timing are quite tight to communicate with it. i spent 1 month tweaking my timing to make it work properly before. I have an idea of the problem, but can't tell precisely.

When i check my osc2 wave with the scope, instead of seeing a clean timing wave of 4mhz, the timing change quickly between 3,90mhz and 4,10mhz, and the wave is not stable. The wave change quickly from the positive to the negative side of the scope screen...
The Vpp is constantly changing from .5v to 1.6v., i huess this i why the frequency change like this. The problem is why does the Vpp change like this???

Maybe the cristal start oscillating, as the frequency climb the v climb to as the resistance is higher and finally overdrive and stop, and the cycle start again. Maybe thats why the comm dont work, and always restart the pic. What would you think of adding a resistance in serie with the osc2 pin to limit the V through the cristal?? And what is the value that i would use???

Its strange. Another thing i see for the first time. When this project will be finished, i will have learned a lot for my future project, thats the positive side of the problem lol.
So an idea why the trace is going crazy like this??? I guess that if i solve this problem the comm with the sensor will resume working.

Thx,

Mikael

P.S.: Yes the decoupler is soldered directly to the chip pin. I Also added a electrolytic caps at the volatge source. And for the photo i dont have a camera at hand at the moment but i'll try to find one.
 
Last edited:
Have you considered a PWM? I'm sorry but i have not read the thread in depth. And I should have Maybe this will be a a bolt from nowhere. Maybe it wont.
 
No rory PWM is not an option. I need to stabilise the oscillator of the chip of my project so i can use it to communicate via a bus with a digital temp sensor that is extremely timing sensitive. Otherwise the project would be finished and ready.

After some test, i think the problem is that i have way to much noise coming from the 5vdc power block. Si i wonder if somebody know a way to make a filter that will resolve the problem.

So how can i filter out the 350khz that is on the line???? Maybe bigger caps???

EDIT:I'll make a input filter, but i need to find how to calcule the value for the caps and inductor needed... http://en.wikipedia.org/wiki/Capacitor-input_filter
 
Last edited:
Could you upload photos of your board and the test setup please.

Have you added the decoupler?

Also you could try isolating the 0V return of the capacitors from the path between the MCU and the LCD by making a track cut and bridge like this. No guarantee it will fix anything though.

View attachment 18091

Hi kris, i've made the track cut and same thing as before. I found out that the first wave i've shown is unwanted ac from my 5vdv power supply that i need to cut off. Si i will make a pi filter to filter it out. I'll let you know if it worked.
 
No rory PWM is not an option. I need to stabilise the oscillator of the chip of my project so i can use it to communicate via a bus with a digital temp sensor that is extremely timing sensitive. Otherwise the project would be finished and ready.

After some test, i think the problem is that i have way to much noise coming from the 5vdc power block. Si i wonder if somebody know a way to make a filter that will resolve the problem.

So how can i filter out the 350khz that is on the line???? Maybe bigger caps???

EDIT:I'll make a input filter, but i need to find how to calcule the value for the caps and inductor needed... http://en.wikipedia.org/wiki/Capacitor-input_filter


Not necessarily big caps. maybe better caps? There is a formula for the size of capacitors needed to reduce, (not eliminate) Vdc/ Vac interaction but I can't remember the numbers. And I can;t find my microphone.,
 

KrisBlueNZ

Sadly passed away in 2015
If you're getting noise on the 5V from your power supply, either get a better power supply (a regulated, switching type, as used to charge phones) or use a supply with a higher voltage and regulate down to 5V using a 5V linear regulator such as a 7805 or a 78L05, or an LDO (low dropout voltage) regulator.
 
If you're getting noise on the 5V from your power supply, either get a better power supply (a regulated, switching type, as used to charge phones) or use a supply with a higher voltage and regulate down to 5V using a 5V linear regulator such as a 7805 or a 78L05, or an LDO (low dropout voltage) regulator.
I'll buy a regulator then.

But i dont understand why putting a regulator instead of making a filter to attenuate the noise... Can you explain why you prefer adding a regulator over a filter?? I try to understand to make the right choice for futur project..

Thx
 
You also need to put in the filters. 7805 is crap..Doesn't do anything to reduce ripple noticeably.Unless it has a a DC input.

How do I know? See my other tread. I'm not advertising. I just think that there are too many people out there who think that building an electronic circuit is easy
 

KrisBlueNZ

Sadly passed away in 2015
You also need to put in the filters. 7805 is crap..Doesn't do anything to reduce ripple noticeably.Unless it has a a DC input.
The 7805, like all normal regulators, NEEDS a DC input. A regulator cannot create voltage where there is none. If you put a rectified but unsmoothed voltage into a regulator, you will get gaps in the output. That doesn't mean the 7805 is crap; it means you're doing it wrong!
But i dont understand why putting a regulator instead of making a filter to attenuate the noise... Can you explain why you prefer adding a regulator over a filter?? I try to understand to make the right choice for futur project.
Yes. A regulator will remove most of the noise from a supply, as long as the supply voltage remains greater than the output voltage plus the regulator's dropout voltage at all times. A 78xx regulator has a dropout voltage of about 2.5V, so that means your input voltage must be above 7.5V at all times. If you can ensure this, then the regulator's output will be a steady and fairly clean 5V DC. Noise at the input will not pass through the regulator, because the regulator regulates the output voltage.
 
Top