Low power window/door sensor with ATmega328 chip/4 MHz crystal on prototype brd.

Hi, I want to do something similar to the project on this site, but I want to only use an ATmega328 chip by itself, not the Arduino Pro Mini.

This will be my first project with Arduino.

I was hoping to program the chip with an Arduino Uno board and then pull off the chip and use it on a prototype board with a 4 MHz crystal (and whatever else I would need). I have been reading a lot on these forums lately and have seen information about boot loaders and such. Would I have to program it while it is running on the 4 MHz crystal (and change the bootloader and such) for this to work at all?

I also noticed that the NRF24L01+ uses a 16 MHz crystal. Will there be any problems with this project if I try to go the low power route and have only a 4 MHz for the ATmega328?


Hi, you better start with something that you understand.

What you want is complex (because of the 4MHz):

  • Have you done communcation with the NRF24L01+ before ? Which library do you want to use ?
  • Did you make a project with a so called "barebone" Arduino before ? The chip will not run on its own, unless you know the ATmega chips well.
  • Using 4MHz will make it incompatible with Arduino, you probably have to compile your own bootloade as well. Why would you want to run it at 4MHz ? I use 3 AA batteries and a (modified) Arduino Pro Mini at 8MHz. The modification is that I remove the volage regulator and the power led.
  • I'm not sure about the code on that website.

Use normal Arduino boards, and test every piece of hardware and software on its own. If that is working you can combine it for your final project. Please don't try to do your project without testing every piece of hardware and software.

I have an Atmega 328 running on a breadboard with an nRF24. The 328 runs using its internal 8MHz clock and the whole thing is powered by 2 AA cells.

I uploaded the bootloader to the 328 following this Tutorial and I program it with an FTDI cable.

I got my nRF24s working by following this Tutorial.

If you get your 328 working while installed in an Uno it will be set for 16MHz.

Nick Gammon has a good low power tutorial


Thank you guys so much! I will be reading through all the links you posted.