I have recently made this 2 layer PCB, could someone check it out for any errors) and give me any tips?
Any advice or useful tips is helpful.
Also is there any way to block out the bottom layer if I am working on the top layer, other than to uncheck all those boxes?
You can use high contrast mode, default short cut
H. That makes the layer you are working on pop using colors.With that I don’t bother hiding layers if there are only 2.
Feedback on project: run ERC, there are lots of errors that can be fixed very easily.
Board can be made smaller although not by much. If you find a way to place battery under the double pin row daughterboard module (or whatever that large footprint is) you will gain a lot of space.
Also using smaller connectors will help a lot, you don’t need beefy 5.08mm pitch ones for signal wires.
I would also use 0805/0603 passives but that can be down to your soldering skill. If you can solder a 32 pin qfp you should be able to handle 0805 with ease.
Why are you powering 555s from your micro IO pin? At least put a high side mosfet there or something. What are those 555s supposed to do anyway? I’m not familiar with typical moisture sensor interfaces.
I have run ERC , no error messages , the 555 timer provides a PWM for my sensor.
The battery is already present on the bottom layer, so I am a bit confused what u meant.
I have already tried high contrast mode, what I am looking for is only to see 1 layer at a time with it’s components and with or without it’s traces.
Will look into the smaller connectors thanks for ur tips.
You can use the context menu on the Layer Manager to switch several layers on/off.
I also get lots of ERC errors. Most are for not placed “No Connect” crosses, some for missing power flags, and maybe more, but the list is too long. You have for example 2 floating reset pins. Are you sure this is safe?
Why do you put two electrolytic caps in anti series for the moisture sensors? My first guess would be that a single foil capacitor would be a better choice, but I’m not familiar with your sensor. (Ah, on the PCB they look like tantalum)
Same for C6 and C9. These lower the resolution of your (obviously capacitive) sensor, so the value should be small relative to your sensor capacitance.
Your LT1962 has a “low quiescent current”, at least according to the datasheet, but they’re lying in your face. You can fly to the moon on 30uA nowaday’s. Depending on your battery you may be able to get rid of it altogether, and feed the AVR directly from the battery.
If you power the AVR directly from the battery, you can also get rid of the whole battery voltage sens circuit. If you use AVcc as voltage reference for the ADC and then measure the internal voltage reference, you have enough info to calculate the battery voltage.
I assume you switch the 555 to lower power consumption, which is a good thing. Have you checked ripple voltages and currents on D7?
You also switch both 555’s with the same I/O pin and have some I/O pins left. If you give each 555 it’s own Power switch pin, you lower the output impedance and crosstalk between the 555 chips.
What is the (idle) power consumption of your XBee module? You may consider turning it off completely for most of the time. Your LT1962 has a shutdown pin. If you power the AVR directly from the battery, you can use that shutdown pin to switch power to the XBee.
When you do such things you must be aware of the big 10uF output capacitor. The current though that capacitor may be high enough to drag the battery voltage down to the point the AVR resets itself.
For the temperature sensors you have the AVR pins directly connected to the connectors, which exposes these pins to more “garbage” then they should be. Even a 10 ohms series resistor lowers the chance on damage from ESD. Higher resistances, inductors or real filters are better of course.
There is no mention whatsoever on what sort of battery you are using.
Are you sure the output voltage of the battery is high enough for input into your voltage regulator?
I would never use an ATMEGA without programming connector, or at least acessible pads to SCK, MISO, MOSI and Reset. Huh, where is the reset pin of your AVR?
Apparently you use the ADC for a temperature probe. Give AVcc at least it’s own decoupling cap.
Do you have your monitor in portrait mode?
Drawing the PCB in the same orientation as your monitor makes more effective use of your pixels.
2 big red caps sticking out of the bottom of the PCB. These are mechanical vulnerable, while you have plenty of PCB area. If you move them a bit so you can fold them flat to the PCB, they are much more protected. You could even use a drop of glue, or put the “flappy end” in the direction of something else sticking out so they can not hook onto anything.
You do not have a decent GND plane. For this PCB it’s probably not too important, but make a habit of using a single continuous GND plane on one side of the PCB. If you need to put any traces through the GND plane, then make these as short as possible.
Same for the Power net. Look at 3.3V:
Why do you use THT transistors for Q1 and Q2?
You can get nice “sample books” from Ali / Ebay / China with an assortment of cut tape of about 50 different transistors, and 50 pieces each for around USD20.
Since you already use components on both sides… You could make the PCB a lot smaller (about half the size) if you place the XBee module over other components, or at least use the opposite side of the PCB area of the XBee module for components.
Where is the Antenna of the XBee module? Make sure it is not shielded by copper on your PCB.
Does your XBee module fit with the screw in the mouning hole? Tolerance seems tight.
C18 is placed badly. XBee module probably has it’s own (and enough) decoupling, but if you use extra decoupling capacitors, use them right.
Note that you have cut the GND plane between the GND pin of XBee on both top and bottom of the PCB, and C18 is only connected through a narrow trace to pin 10 of XBee.
At the moment, screws through the mounting holes can easily short the planes on top and bottom. Currently these are both connected to GND so it’s not a big issue, but be careful with such things.
Your crystal (ceramic resonator?) is too far away from the AVR. put it closer. Also keep the signal wires to the crystal close to each other. There should be nothing in between them.
Have you looked at stability (Temperatur, drift, etc) of your crystal / resonator? You use this as reference for measuring the humidity sensor frequency.
The GND connection of the resonator should also be directly connected to the GND of the AVR. Now it wanders all over the place, untill the current finds some path through …
Euhm, Nice puzzle for you. Try to find the current path through your GND from your oscillator to the GND pins of your AVR. This is a very important thing in PCB design. You should always be aware of how (important) currents flow through the PCB. Do some research on why and how to do do this. Read some texts about general PCB design.
No, it does not.
In the way you have connected your sensor the duty cycle is always 50% and the information is in the frequency of the signal.
First of all thanks for providing such a detailed answer.
I have taken the soil moisture interface circuit from an online source where they have said that those electrolytic caps are present for stability and averaging of current.
Regarding my battery I am using 3 AA cells of 1.5V in series to get 4.5V, then a regulator for the ATMEGA & Xbee to provide constant 3.3V.
Regarding the power consumptions my setup wakes up only 10secs every 2 hours with the help of RTC, so both the ATMEGA, Xbee,555 timer remain in sleep state most of the time.
Are u sure that 10uF draws a lot of current , bcoz when i simulated the LDO it was a drawing current of few nA, so practically it may be around few uA.
The reset switch is present in the schematic and PCB already.
Also I am using a 6 pin header as the programming connector for the ATMEGA.
I didn’t understand what u told about the temperature sensors being ‘directly’ connected and the use of 10 ohms resistance.
Also AVcc already has a decoupling cap (C10).
Will look into the other points u mentioned under PCB.
555 timer acts as both input and output of the sensor. As u said the sensor resistance forms a part of the wave shaping network so the info in the frequency of the signal.SMX_2018.pdf (584.8 KB)
30uA quiescent Current is the specification on the front page of the LT1962 datasheet:
This 30uA is not exactly a disaster, but it will drain your AA batteries in about 4 years without doing anything else.
Oops, the DS3231 has a standby current of 110uA (@3V3) to 170uA (@5V5), so total battery life will be less than a year.
If low power is important I would remove the DS3231 altoghter and use the ATMEGA hardware timer for (rough) timekeeping. I assume the XBee is bidirectional, so you can have a more accurate clock somewhere else and sync the AVR during each measurement, Or just take a sample roughly every 2 hours without any time keeping at all, and let the “other side” of XBee generate timestamps when messages come in.
Are you aware there is a “picopower” version of the ATmege328?
Using an 8MHz oscillator is also not the best choice for this application.
Look at the ATMEGA’s datasheet for the lowest current clock options.
According to this table you can get the M328 down to about 25uA even when running on 4.5V (Directly from 3 AA’s, no voltage regulator)
I think you gen even get it further down with deep sleep modes and only using the watchdog oscillator to wake up periodically.
Jeelabs has written several articles about getting power consumption down for AVR controllers, for example:
About your PM over the 555.
Read and study the datasheet.
but Xbee still needs 3.3V, so i can’t remove the LDO right? Checked the datasheet about the oscillator, so what I have understood is that if i choose a lower frequency my power consumption will reduce, but will it affect the working of the chip?
Also one of my team member tells me that once the A328 goes into sleep mode the watchdog can’t wake it up periodically even hour… RTC needs to fire the interrupt.
I am looking into the jeelabs link, thanks for that.