The Arduino uno is an amazing beginner tool to learn electronics, but it is hardly appropriate for miniature, hobby, and commercial projects due to its size and cost. Once you get your feet wet with circuit principles and what's on the microchip market, it's time to upgrade. I introduce to you the ATmega328, developed by Atmel, the microchip soldered onto Arduino Uno boards. The reason this chip is a good choice coming from Arduino is due to the familiar pinouts and coding language, as well as its size.
Setup CircuitTo use the ATmega328, it must always have the connections you see above. To begin setup, place the ATmega328 in the middle of the breadboard, in order for pins 1-14 and 15-28 to each have a unique rail. Now, connect a five-volt VCC to the + rail of the breadboard (if you lack a 5V VCC and have a higher VCC like 9V, you can use a voltage divider, using more resistors). I used a 9V battery and a voltage divider to achieve a 5V VCC. Connect the ground of your voltage supply to the - rail. Connect a resistor in series with pin 1 and VCC. Connect a ten microfarad electrolytic capacitor to GND and VCC (be aware of the marked polarity). Connect the 16 MHz crystal to pins 9 and 10 of the chip. Connect two 22 picofarad capacitors to pins 9 and 10 and to the GND rail.
Coding ATmega328Before coding the ATmega328, make sure the supplier you are buying the chip from has the Arduino bootloader: pre-programmed settings for Arduino compatibility. After making the connections and validating the bootloader, there are two ways to go about programming the chip. The first method is to upload code to an Arduino Uno and manually remove the chip from its DIP socket: not a good idea, as the chip and board could become damaged, and this method requires an Arduino Uno. The second method is to buy a USB-to-Serial adapter. I am using the FTDI USB-to-Serial adapter seen above. This adapter requires a USB mini type B to USB-C (if using a mac). Once you have made the connections seen above, you must download the FTDI driver software. The software download can be found on their website under the "drivers" tab. Locate your specific PC and download. Now once plugged in, their should be a pop-up for the FTDI adapter: click "allow." Then go to your Arduino sketch you wish to upload to the ATmega328, go to the "tools" tab then "ports" and click on the port labeled something like FTDI... with the adapter's serial number. After that step, you're good to go upload!
An even better way to integrate this chip into your projects is to create your own custom PCB. I will be covering that soon.
Test CodeThis is a simple blinking-light sketch. Connect an LED in series with a resistor, GND, and digital pin thirteen (see pinout above to find DP 13). If everything is working, you should see a blinking LED!
Going FurtherCheck out my projects like IAADL: an infrared-activated automatic door lock on my dashboard.
Comments
Please log in or sign up to comment.