After successful completion of the first prototype of my Aeroponic controller, I decided to redesign the system with more functionalities. In the new design, I need external EEPROM, WiFi, and more, but I am running out of extra pins in my Nano to support all the new functionalities in my mind. I cant go to Mega, as it will increase the size of my system and cost. So I decided to experiment with Atmega32a which has 32 I/O pins and can accommodate all my new requirements. But I have to run this chip standalone without all the luxury provided by Arduino board, like USB connection, Power regulation, etc.
I bought a couple of Atmega32a from the market and boot loaded using the Arduino ISP Shield. I tested the chip using a blinky sketch and it worked well.
The next task is to run it standalone from an external power source. Atmega32 can handle voltage up to 5.5v and my Aeroponic controller runs with an external power source of 12v. So I need to use a regulator to step down the voltage from 12 to 5v. One option could be to use LM7805 but in my experiments, I could see this regulator produces a lot of heat. I come across this switching regulator called LM2575 and everyone says it works really well and not produce much heat. I bought a couple of these regulators with fixed 5v output.
The data sheet of LM2575 provides a schema to connect the regulator as shown below.
Above picture from the Datasheet of LM2575
Yesterday night I decided to combine all the parts together to create a standalone board to run the blinky sketch.
I wired LM2575 as described in the above schema in a breadboard, checked the output voltage and it was 5v. I left the system for a couple of hours to see any heat coming out. After the heat testing, I decided to connect Atmega32a to the power source and make the standalone system.
Above picture from the Datasheet of Atmega32
Here is the wiring.
- Atmega VCC to LM2575 5v output
- Atmega GND to common GND
- Atmega XTAL1 and XTAL2 to 16mghz crystal, and two 22pf ceramic capacitor from each leg of the crystal to GND.
- Atmega RXD to FTDI USB’s TXD
- Atmega TXD to FTDI USB’s RXD
- FTDI USB’s GND to common GND
The FTDI adapter allows me to see the debug information I am writing to the serial port. The blinky sketch I uploaded also write ‘Hello world’ to the serial port.
Let’s see how to looks in a breadboard. As you can see it’s very minimal.
Now it’s a standalone board which can run Arduino sketch and can easily fit in my new board.
In the next task, I will be to try programming the Atmega using the connected FTD USB to TTL adapter.