Thank you! Will look into that and make necessary adjustmentsThe load capacitance of a circuit is complicated and it's not usually equal to the value of the capacitors.
Y1 is a crystal not an oscillator. An oscillator is formed from the amplifier in the microcontroller, the capacitors and the crystal. I would suggest you use a packaged oscillator instead and connect its output to Xtal1 on the microcontroller. You can leave Xtal2 not connected or you could reconfigure and use that pin for something else.
If you do use a crystal, add a resistor in series with the Xtal2. Leave C8 connected to Y1, and that should be connected to the other end of the resistor that is connected to Xtal2.
The values of C7 and C8 and the resistor will all affect power consumption and gain margin. If you make the crystal oscillate too strongly, that will use extra power but if you have too little power going to the crystal, it may not start reliably. Crystals will vary in how easily they will start, so minimising the power too much can lead to problems.
If you run a crystal at the wrong load capacitance, the only problem is that the frequency will be a bit wrong, and that may not be important in your application. A fundamental crystal will change by 10 - 50 ppm per pF of load capacitance change. The amount it changes depends on the motional capacitance of the crystal, which is measured in fF (femto Farads) but isn't always quoted by the crystal manufacturers (and sometimes they get the units wrong).
You should optimise the circuit for power consumption and stability, and then find what load capacitance you have ended up with, and buy a crystal to match that.
It really is a lot easier to buy a packaged oscillator.
Hello, I replaced the crystal with XO53 and this looks better right?The load capacitance of a circuit is complicated and it's not usually equal to the value of the capacitors.
Y1 is a crystal not an oscillator. An oscillator is formed from the amplifier in the microcontroller, the capacitors and the crystal. I would suggest you use a packaged oscillator instead and connect its output to Xtal1 on the microcontroller. You can leave Xtal2 not connected or you could reconfigure and use that pin for something else.
If you do use a crystal, add a resistor in series with the Xtal2. Leave C8 connected to Y1, and that should be connected to the other end of the resistor that is connected to Xtal2.
The values of C7 and C8 and the resistor will all affect power consumption and gain margin. If you make the crystal oscillate too strongly, that will use extra power but if you have too little power going to the crystal, it may not start reliably. Crystals will vary in how easily they will start, so minimising the power too much can lead to problems.
If you run a crystal at the wrong load capacitance, the only problem is that the frequency will be a bit wrong, and that may not be important in your application. A fundamental crystal will change by 10 - 50 ppm per pF of load capacitance change. The amount it changes depends on the motional capacitance of the crystal, which is measured in fF (femto Farads) but isn't always quoted by the crystal manufacturers (and sometimes they get the units wrong).
You should optimise the circuit for power consumption and stability, and then find what load capacitance you have ended up with, and buy a crystal to match that.
It really is a lot easier to buy a packaged oscillator.
Yes, there are software solutions to help with low power but wanted to add some hardware as well. I believe the arduino can be on standby mostly and read temp and the rest when buttons are pressedIt's certainly a simpler design.
On the low power aspect, you might want to look at being able to run in different modes at different times. As temperature and humidity can't change very quickly, the biggest power reductions can be achieved by minimising the current during the times between measurements.
If you can reduce the microcontroller clock speed in the times between measurements, that will save power. I don't know what the clock arrangements are, but if you can use some other clock source you may be able to turn off the oscillator most of the time.
Thank you for this comment because it reminded me that I did not add buttons which I have now. Also re arranged the board for easier routing:It's certainly a simpler design.
On the low power aspect, you might want to look at being able to run in different modes at different times. As temperature and humidity can't change very quickly, the biggest power reductions can be achieved by minimising the current during the times between measurements.
If you can reduce the microcontroller clock speed in the times between measurements, that will save power. I don't know what the clock arrangements are, but if you can use some other clock source you may be able to turn off the oscillator most of the time.
Thank you for this! Will look into itHi M,
I wonder if this will interest you?
CTrigBoard - Ultra low power ESP8266 IoT platform - Electronics-Lab.com
The trigBoard is an IoT project that does one thing – it pushes you a notification...www.electronics-lab.com
thank you for this detail! Yes, the plan is to have everything sleeping unless a button is pressed but I saw that the power led would consume some power and that the original voltage regulator did not have great standby current so I tried to change that one a bit too tho what I have there isn’t the most low power option, some reason is hard to find kiCAD footprints. Will take all this advice into consideration as well!One obvious improvement would be to power down the sensors when not in use, easily done with an I/O pin on the micro. I'm pretty dubious about Diver300's worry about the crystal oscillator as well, I don't really see too many issues there?.
However, I would (and do) have used a PIC for the processor - they have a plethora of low power enhancements, ideal for low power applications. First off I'd use the internal oscillator, no real need for a clock crystal, but add a 32KHz crystal on TMR1, this runs in sleep and provides VERY low power consumption. I've no idea if you can do similar things with AVR devices or not?.
I do a lot of low power stuff, as we're looking for 5+ years battery life - basically turn EVERYTHING you can OFF when not in use, and put the processor to sleep - be particularly aware that some I/O pins 'may' cause slight leakage unless you disable the internal peripheral - such as a serial port, the default is HIGH, and this can cause current leakage (so disable the serial port - or anything else suspect) and set the pin low before going to sleep.
Then TMR1 is set to generate 1 second interrupts, this works a software RTC, and can be used for periodical readings (so in your case, taking humidity readings however often required). Likewise, I/O pins can be set to generate interrupts when they change state, go high, go low, or both - this can be used for various external events, including any key presses for changes etc.
Running a slower clock speed uses less power, but if you're in sleep it doesn't matter - as the faster it runs, the faster it executes the ISR, and the faster it goes back to sleep.
Incidentally, before you get too carried away chasing an odd microamp here and there, you'll find it impossible to get anywhere near the claimed power consumptions in the datasheets (I've been there, chasing those mythical figures) - also the 'generally accepted target current' is less than 100uA which meets the 5+ years battery life for the types of batteries data loggers generally use.
BTW, if you want a power LED, just flash it briefly every now and again, once a minute for 0.1 seconds lets you know it's all working, and uses hardly any power.
The points I raised about the crystal oscillator were more about the question of what capacitance to use than the power consumption.One obvious improvement would be to power down the sensors when not in use, easily done with an I/O pin on the micro. I'm pretty dubious about Diver300's worry about the crystal oscillator as well, I don't really see too many issues there?.
Lastly:
Don’t leave any unused I/O pins floating. Pull them to ground via a 10k resistor.
How do you see the MAX604 that's there right now?MicroChip make some great LDO regulators with low quiescent currents, look at the MCP1700 series - I use the MCP1700-3302 3.3V regulator in our loggers. Be aware though, the pin connections are different to the normal 78L05 series
Just wanted to put here that this is the most recent state as I forgot to add connectors for the eventual energy harvester and for bootloading the atmega328p. I do want to ask if having those pins for bootloading are necessary? I could put the atmega on a breadboard to bootload then put it on the pcb right? Or do I need some of the capacitors and resistors connected to it?MicroChip make some great LDO regulators with low quiescent currents, look at the MCP1700 series - I use the MCP1700-3302 3.3V regulator in our loggers. Be aware though, the pin connections are different to the normal 78L05 series
Typical quiescent current for the MCP1700 is only 1.6uA, it's 15uA for the MAX604 - but the MAX604 is pretty low.How do you see the MAX604 that's there right now?
Thank you. It seems the better / lower the quiescent current, the lower range of input voltage the regulator can take, is that right?Typical quiescent current for the MCP1700 is only 1.6uA, it's 15uA for the MAX604 - but the MAX604 is pretty low.
So the MCP would look like this right?Typical quiescent current for the MCP1700 is only 1.6uA, it's 15uA for the MAX604 - but the MAX604 is pretty low.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?