Thursday, September 24, 2015

Standalone Atmega328P On A Breadboard

Standalone Atmega328P On A Breadboard

   With this project I wanted to be able to be able to program a Atmega328P chip on a breadboard.  This is the same chip used on several of the Arduino boards. I used the simple Blink program to blink the blue led.


Parts List
NOTE - I ordered most of this on E-Bay and most of it came from China.  You may have to wait a week but for the prices it's worth the wait. Actually if you ordered in states it might take just as long.

1 - Breadboard - MB-102 MB102 830 Point Solderless PCB Bread Board - you can get off E-Bay for around $3 which includes shipping.   Of can be used over and over.
1 - Breadboard Power Supply - MB102 Breadboard Power Supply Module 3.3V 5V For Solderless
1 - Breadboard - plugs right on top of the breadboard to power the rails on both sides - $.90 off E-Bay and with free shipping.  I really love this device.  You have jumpers for each rail for either 3v or 5v which you can select for each side if you need both voltages.  Also you can power it via a 9v battery like I have or via usb to your computer.
1 - 9V Battery Plug - DC 9V Battery button power plug - $1.36 of E-Bay for 2 with free shipping. 
1 - 9V Battery - Obviously you can buy them wherever they are cheapest around you.
1 -  USB to TTL adapter - There are several out there.  It's always a good idea to get on that supplies 3v and 5v output.  You could use it to actually power the breadboard but I wanted to be able to power it without the USB cable plugged in.  On E-Bay for $.16 with free shipping.  No, that's not a typo, 16 cents.
1 - Atmega328P-PU - Atmega328P-PU with Arduino Bootloader - $1.59 off E-Bay with free shipping.  You can find some deals sometimes for multiples in anticipation of making several standalone units.
1 - 16Mhz Crystal - 16Mhz Crystal Oscillators HC49S Quartz Low Profile - $.75 for 10.
2 - 22pF Caps - 22 50V Monolithic Ceramic Chip Capacitor - $1.79 off E-Bay for 50 pieces.
1 - LED - I just happened to have a bunch of blue LEDs around.  Most of the time you use a resistor to keep the LED from drawing too much current and burning out.  But the ones I have didn't seem to draw too much.  Of course the LED was just for demonstrating purposes to show it worked.  It could be eliminated and the circuit used in other ways.

 For a more of a standalone setup you can put the components on a small perf board.  That's my next step.  For that I need the following:
1 - Perfboard -
1 - LM7805 5V Regulator - L7805 LM7805 Voltage Regulator +5V 1.5A LDO - 5 pieces for $.99 with free shipping off E-Bay.
2 - 10uF Electrolytic caps - 10uF Radial Lead Electrolytic Capacitor - find some low voltage ones like 6-20V.  Radial just means the leads are on one end.  You can get 100 for like $5 off E-Bay.
1 - Atmega328P-PU - Atmega328P-PU with Arduino Bootloader - $1.59 off E-Bay with free shipping.  You can find some deals sometimes for multiples in anticipation of making several standalone units.
1 - 16Mhz Crystal - 16Mhz Crystal Oscillators HC49S Quartz Low Profile - $.75 for 10.
2 - 22pF Caps - 22 50V Monolithic Ceramic Chip Capacitor - $1.79 off E-Bay for 50 pieces.
1 - Momentary Pushbutton -  Mini Micro Momentary Tactile Push Button Switch 6*6*5mm 4pin - $1.77 for 100 on E-Bay.  Hope you make a LOT of projects. lol  But hey, for that price who cares.  You pay a lot more for 1 at a lot of electronics places.
1 - 10k Resistor - 10k ohm 1/4w resistor - $1.10 for 100 pieces off E-Bay

I'm going to add a schematic later but you can look up on Google for "Arduino on a breadboard schematic". 
I do like THIS one the best.  Just ignore the stuff on the right side of the schematic.

STAY TUNED! I WILL BE ADDING MORE TO THIS LATER!

Friday, May 22, 2015

My 4WD Robot Smart Car Chassis with Arduino On Board

I wanted to start off using the Leonardo.  Mainly to show that I could use one of the most basic of Arduino to run my car.  I ended up having to get a library ported for the Leonardo as the standard one didn't support it. 

Chassis Without Wheels

Side View

Top View
 
The down side of using the Leonardo is the fact that the max frequency to run the PWM is low so you hear the high pitch whine on the motors. 
 
Here I switched out the Leonardo with the Mega 2560.
 
With Meg 2560 Installed

 


Friday, May 1, 2015

My Inventory of Arduino Boards

 Why do I like Arduino?  I've worked with 8080 type processors in the past and even through various other processors and microcontrollers.   I've worked with the PIC microcontrollers.   But what I love about Arduinos is a lot of the hard work is done for you.  I don't have to dig through datasheet details, pinouts, and code trying to make something work.

 While I've done that many times in the past developing test sets, circuit boards, and interface circuitry and loads of other projects I'm at a time when I don't have the luxury of that much time.  So now when I develop I prefer to be able to put components together for an idea on a project and jump into coding.

 The coding on the Arduino boards is very easy compared to what I've had to do in the past.  Again a lot of the libraries take the hard work out of making something as simple as turning on an LED or port a lot easier with just a simple line of code.

 So here is my current inventory of Arduino boards.  I will list the shields separately elsewhere.
I changed some of the pictures so you get an idea of actual size.  They look big until you compare them to a hand. 




 Iduino Uno - An Arduino Uno Clone - ~$6


 Most of these boards I got off E-Bay.  I watch and get an idea what the lowest prices for them are going for and try to get one as low as I can.  Of course making sure they don't get you on shipping.  Even the ones I get from overseas get here as fast if not faster than in the US.

   I love the fact the Arduino boards are so reasonable that you can get a ready-to-go system pretty much right off the bat.  The prices are approximately the going rate on E-Bay.  Of course it depends on shipping etc.  But they can be much higher on some electronics sites.

Arduino - Leonardo - ~$5.25


 Iduino Due - Arduino Due Clone - ~$18

Arduino Mega 2560 in a case


Mega 2560 Pro Mini v.1.0 - ~$15


Atmega328 Pro Mini - ~$2.39

STM32F103C8T6 - ~$8.48



Board Comparison



Board CPU Core Op Volt Clock Flash SRAM EEPROM Length Width Weight Digit I/O Analog In Analog Out DC Curr. 3.3v pin DC Curr 5V Pin
Uno ATmega328 8-bit 5V 16Mhz 32Kb .5boot 2Kb 1Kb 2.7" 2.1" 25g 14 6PWM 6 10-bit 50mA
Due AT91SAM3X8E 32-Bit 3.3V 84Mhz 512Kb 96Kb 3.99" 2.1" 36g 54  12PWM 12 12-bit 2 DAC 12-bit 800mA 800mA
Mega 2560 ATmega2560 8-bit 5V 16Mhz 256Kb 8Kb boot 8kb 4Kb 54 15PWM 16 10-bit 50mA

Nano
ATmega328 8-bit 5V 16Mhz 32Kb 2boot 2KB 1kB 1.77" .7" 5g 14 6PWM 8 10-bit
Leonardo ATmega32u4 8-bit 5V 16Mhz 32Kb 4boot 2.5kb 1Kb 2.7" 2.1" 20g 20 12 10-bit 50mA

STM32   STM32F103C8T6 32-bit 3.3V             72mhz     64Kb                 20Kb                        2.1        .8"  



   Most features will depend on what your needs are.  My suggestion is start with a smaller board to see what you can and can't do with it if you're not sure.  A lot of work can be done in a small amount of memory.


   There is one feature you MUST be aware of.  That is the 3.3V on the Due.  This means that the maximum voltage the I/O pins can handle is 3.3V.  If you try to input 5V logic levels or voltage of 5V into these pins you will more than likely damage the board.   Also if you use shields there are some built specific to the Due's 3.3 volt requirements.  If you use this board do be careful in selection of what components you connect to it.  If you're not sure ask on one of the forums.