Sony Arouje

a programmer's log

Archive for May 2016

Arduino system in a breadboard

with 3 comments

After successfull 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 couple of Atmega32a from the market and boot loaded using the Arduino ISP Shield. Tested the chip using a blinky sketch and it worked well.

The next task is run it standalone from an external power source. Atmega32 can handle voltage upto 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 every one says it works really well and not produce much heat. I bought couple of these regulators with fixed 5v output.

The data sheet of LM2575 provides a schema to connect the regulator as shown below.

image

[Note: 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 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.

 

Atmega32A

[Note: 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
  • Amega 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 serial port.

Let’s see how to looks in a breadboard. As you can see it’s very minimal.

IMG_1279

 

Now it’s a standalone board which can run Arduino sketch and can easily fit in my new board.

Next task will be to try programming the Atmega using the connected FTD USB to TTL adapter.

Written by Sony Arouje

May 18, 2016 at 10:37 am

Posted in Arduino

Tagged with , ,

Home made Arduino ISP Shield

with 4 comments

In recent days I started programming more on Atmega chips than Arduino boards. I use Arduino Uno as the ISP to bootload and program the Atmega chips. One of the difficulty I faced to use Arduino ISP is the wires running from Uno to bread board. If I misplace the breadboard slot while plugging a new chip, I might fry it and waste my money.

So I decided to make a shield for my Uno. It’s nothing special and not so beautiful but does it job well.

IMG_1277

 

This board is based on the Arduino ISP sketch from lydiard. I also kept a slot to plug FTDI USB to TTL adapter, which connects the Serial port of Atmega 32 plugged into the shield. Using the TTL adapter I can see the serial writes from the chip and easily debug my code.

With this board I can bootload several of my Atmega 16/32 chips and upload sketch very easily.

Written by Sony Arouje

May 16, 2016 at 11:35 pm

%d bloggers like this: