Welcome, Guest
Username: Password: Remember me
General topics about hardware.

TOPIC: ATMega328 internal resonator for MySensors sensor?

ATMega328 internal resonator for MySensors sensor? 1 year 9 months ago #1089

  • PaulRB
  • PaulRB's Avatar
  • Offline
  • Junior Member
  • Posts: 30
  • Karma: 0
Hi,

I have built a MySensors sensor with a Nano 3, BMP085 pressure, SHT21 humidity and an LDR for light level, running from 3xAA NiMh cells (Bypassing the Nano's 5V regulator). This is working well with EasyIoT running on a Pi. However, the battery life stinks, because the Nano is drawing around 45mA! Hardly any current is drawn by the other components as far as I can measure. its hard to know how much with a cheap digital multimeter, it reads zero except for a split second where a few mA is drawn by one of the sensors, or the nrf24l01+ radio module.

So I have been reading up on adpating a pro mini 8MHz/3.3V for low power by removing the led & 3.3V regulator and setting the fuses for 1MHz operation. This allows it to run as low as 1.8V, giving long battery life for a MySensors sensor with 2xAA cells.

I have a question. Could I use a 28-pin DIP AtMega328 instead of the pro micro? I could program it using ArduinoISP sketch on an Nano and set the fuses for 1MHz using the chip's internal resonator/clock. I have done this with ATTiny85 for other (non-EasyIoT/MySensors) projects.

My main concern about this approach is the use of the Atmega's internal clock. I understand that it is not very stable and will change frequency with the battery voltage and local temperature. However, don't know if this will be a problem in practice. Both the SPI interface to the radio module and the i2c interface to the sensors use a clock signal provided by the master (the ATMega) and the slave devices use that clock to send/receive data. So if that frequency varies, does it really matter?

Thanks,

Paul
The administrator has disabled public write access.

ATMega328 internal resonator for MySensors sensor? 1 year 9 months ago #1104

  • HarryDutch
  • HarryDutch's Avatar
  • Offline
  • Senior Member
  • Posts: 65
  • Thank you received: 11
  • Karma: 1
Is there a special reason why you want to use a Nano for a battery powered sensor? Only more pins? I only use a Nano for my repeaters (no sleep and powered by an AC DC power supply). All battery powered sensors are Pro Mini's. When I run out of pins I use a shift register.
The administrator has disabled public write access.

ATMega328 internal resonator for MySensors sensor? 1 year 9 months ago #1105

  • PaulRB
  • PaulRB's Avatar
  • Offline
  • Junior Member
  • Posts: 30
  • Karma: 0
Hi again Harry, there is a special reason why I don't want to use a Nano for a battery powered sensor: it uses far too much current!

Sorry if I was not clear, but this is a prototype that I built using Nano because that's what I had to hand.

Now I want to make it low power to last months on batteries. EasyIoT's suggestion is a Pro Mini @8 MHz, but I was considering a ATMega328 28 pin dip instead. You can buy them with the 8MHz internal oscillator bootloader installed.

My reasons are: that they are slightly less expensive; I don't have to remove any tiny components; and the i2c pins are easilly available for protyping on breadboard.

On the Pro Mini, the i2c connectors are awkwardly placed.

UPDATE: reading the page on Low Power Sensors again, I realise it says
Other way is to switch to internal oscillator at 8MHz and divide frequency by 8. That way it will operate at 1MHz.
When I read the page before, I was thinking that the 8MHz crystal on the Pro Mini was being used but being divided by 8 to get 1MHz. But no, it is the internal oscillator.

So this answers my original question: there is no problem using the internal oscillator. Unless anyone can think of a problem with my plan?

Paul
Last Edit: 1 year 9 months ago by PaulRB.
The administrator has disabled public write access.

ATMega328 internal resonator for MySensors sensor? 1 year 9 months ago #1107

  • HarryDutch
  • HarryDutch's Avatar
  • Offline
  • Senior Member
  • Posts: 65
  • Thank you received: 11
  • Karma: 1
Now you made me curious Paul! What do you mean with the ATMega328p 28 pin dip? Any link?

If you want to know everything about power saving mcu's then this is a must read:

www.gammon.com.au/forum/?id=11497
The administrator has disabled public write access.

ATMega328 internal resonator for MySensors sensor? 1 year 9 months ago #1110

  • PaulRB
  • PaulRB's Avatar
  • Offline
  • Junior Member
  • Posts: 30
  • Karma: 0
HarryDutch wrote:
What do you mean with the ATMega328p 28 pin dip?

If you want to know everything about power saving mcu's then this is a must read:

www.gammon.com.au/forum/?id=11497

Harry, there is a picture of an ATMega328 28 pin dip on the page you linked to! 3 pictures in fact.
The administrator has disabled public write access.

ATMega328 internal resonator for MySensors sensor? 1 year 9 months ago #1112

  • HarryDutch
  • HarryDutch's Avatar
  • Offline
  • Senior Member
  • Posts: 65
  • Thank you received: 11
  • Karma: 1
Ok. Now I know what you mean. I used this dip version before. Great to build your own Arduino just the way you want. Go for it Paul and let us know your findings. Test the internal oscillator, an external oscillator and also an external resonator. Will be a great way to learn more about this wonderfull chip.
The administrator has disabled public write access.
Time to create page: 0.140 seconds
Powered by Kunena Forum