Arduino Forum

General Category => General Discussion => Topic started by: cincy on Aug 19, 2012, 02:42 pm

Title: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 19, 2012, 02:42 pm
I am, for some reason, having a problem when taking my ATMega328 chip off the UNO board.  I am guessing my pinouts are wrong or I am just unsure which go where.  :(  I am using Pins (digital pins): 4, 8, -10, -11, 13.  That's it!  It's a pretty simple shift register, can someone help me figure out how to place the 328 directly on the breadboard to get rid of the UNO board?

Attached is the simple design.  May not look pretty because I am no layout designer... but it should serve the purpose :)
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: johnwasser on Aug 19, 2012, 08:12 pm
In addition to Power, Ground and several bypass capacitors the UNO provides a 16 MHz ceramic resonator (required) and a pull-up resistor on the Reset pin (should be optional).  Did you provide a resonator or crystal when you took the ATmega328P out of the UNO?
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 19, 2012, 08:27 pm
I put power and ground, but added nothing else :(  I thought I read that it had an internal oscillator.  Can you point me to a schematic that might show this?  I will have to purchase the oscillator, but have everything else.

Thanks for the reply.. I was thinking that could be the case, but haven't found anything supporting that thought (probably not searching well enough)
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 19, 2012, 09:30 pm
Need the 16 MHz crystal/caps or resonator if the part is to be used as an Uno.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 20, 2012, 08:21 pm
Makes sense.  I may have to make this my second revision :)  I'm running out of time!

What would you suggest to wire up RGB LED's remotely?  Example:  I will have the RGB's 12-24 inches away from the circuit.  I would LOVE to have the RGB wires pretty much covered so that I could place them in some sort of clear tube all together, but wired out one side (hope that made sense).  I drew it up and attached in case it was unclear :)
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 20, 2012, 08:28 pm
Use some ribbon cable to go from shift registers over to the LEDs.

3 of these
http://www.dipmicro.com/store/IDCC10
few lengths of this
http://www.dipmicro.com/store/WIRE28X10GR
and split it up as needed to the individual LEDs
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 20, 2012, 08:41 pm
ok, that sounds easy enough on the shift register side of things.  What would help on the ring side of things?  I am not quite sure how to get these wired without the RGB leads touching each other inside the ring.  I think that's where I am confused most after hours of searching :(
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 20, 2012, 09:09 pm
The LED leads are pretty stiff once cut short - cut them to the length needed, and solder the wires on to the pins.
Can also put shrink wrap over each pin.
Slide a length down each wire, solder the pins, slide shrinkwrap  up & heat it up.



------------------------------------------- LED1 R
------------------------------------------- LED1 B
------------------------------------------- LED1 G
------------------------------------------- LED1 CA
---------------------------- LED2 R
---------------------------- LED2 B
---------------------------- LED2 G
---------------------------- LED CA
---------- LED3 R
---------- LED3 B
next wire
---------- LED3 G
---------- LED3 CA
----- LED4 R
----- LED4 B
----- LED4 G
----- LED4 CA
- LED5 R
- LED5 B
- LED5 B
- LED5 CA

next wire, etc.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 20, 2012, 09:36 pm
Thanks!  Just picked up shrinkwire, actually... only because I saw it in the store, have a heat gun, and thought to myself I can't believe I didn't figure that out already.  Thanks again for all of your help!
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 20, 2012, 09:41 pm
No problem. Post a pic when you get it working.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: Chagrin on Aug 21, 2012, 04:55 pm
Your "off/on dip", assuming that is a switch, is wired incorrectly. You need to add a 10K resistor between pin 4 and GND so the input is not left "floating". http://arduino.cc/it/Tutorial/Button
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 21, 2012, 05:28 pm
Enabling the internal pullup means the input will be HIGH unless the switch is pressed to make it LOW.
No external resistor needed.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 23, 2012, 09:45 pm
I am so slow at this.  It's a pain in the butt to solder the ribbon cable to the RGBs and then heat-shrink properly.  I think I need more tools :)  And a magnifying glass now that I'm semi-old (42).  Now I wish I would have been 'on top of' this project when I started it.  I would have had a real PCB created and some connectors to make this much easier!
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 24, 2012, 05:22 am
Live & learn. Plan better next project.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 24, 2012, 03:47 pm
Good advice :)

Question:  I have soldered and wrapped all the RGB's.  It is possible while soldering that i burn out RGB's?  None are working, I'll have to go through the circuit again to make sure I have it wired - but wanted to check.  I assume, yes.

It could also be the ribbon cable as I elected to go with the plug:  https://www.sparkfun.com/products/10965.  It doesn't clamp down well, so possible that a wire isn't properly exposed to the pins.  Gotta check that too.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 24, 2012, 04:29 pm
Possible, yes, you'd have to keep the iron on the pins for more than a few seconds to do that.

Have small vise? Use that, with a spacer on the pin side, to squeeze it together well.
Buzz the connections from pins to LED leg, make sure you have good connections.
Also possible your breadboard connections are just on the opposite side of the clamp-on connector.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 28, 2012, 08:27 pm
ok, got everything working :)  I've attached the circuit image again and was hoping I could have some help determining powering options.  I need to power this circuit via battery.

I have 7 RGB LED's (http://adafruit.com/products/302)
I have 3 74HC595  (https://www.adafruit.com/products/450)
I have 1 DFRobot switch (http://www.dfrobot.com/index.php?route=product/product&path=36&product_id=114#.UD0Pq9ZlQbi)

I was trying to compute max current, so came up with this:

7 RGB * 120mA (peak) = 840mA
3 74HC595 * 160uA = 480 uA
1 DFRobot Switch = 100mA
Arduino UNO Board = ?


Is this how I would sum it up?  And then once I got the sum, how do I determine the right power for continuous load?

thanks again!
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 28, 2012, 08:37 pm
forgot to attach :)
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 28, 2012, 09:49 pm
Okay you need current limiting resistors between the LEDs and the 74HC595.
http://www.adafruit.com/datasheets/sn74hc595.pdf
The 74HC595 is only good for 70mA total, so if you were to turn on all 8 LEDs at once connected to a HC595, you'd want to limit the current to each to <8.75mA.

24 * 8.75mA = 210mA total for LEDs max.
Arduino, 20-30mA
IR switch,100mA if you say so link is not opening for me.

So a 1A wallwart would fit your needs easily.

http://www.dipmicro.com/store/DCA-0510

or a 2A, looks like its less:
http://www.dipmicro.com/store/DCA-0520
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 28, 2012, 09:55 pm
ok, that makes sense.

However - I need to calculate the max load and determine how long a battery pack (and what battery pack I need) would last :)

Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 29, 2012, 12:22 am
Ok, so 350mA.
How long do you want it to run for?
3 AAs, 4.5V, will run 6-7 hrs.
Get 3 C cells in a battery holder, will run for a long time.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 29, 2012, 03:27 pm
ok, I'll try that.  I was thinking to try Lithium, but wasn't sure of the calculation - so didn't know if it would help :)

I will be out from Thursday - Sunday running this thing without AC outlets, so batteries the whole time.  It won't be constant peak, but wanted to base the calculation on peak to be 100% sure I have enough batteries with me to power all (extended) weekend.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 29, 2012, 06:01 pm
ok, based upon the 350 mA peak (adding resistors), Thursday - Sunday would be 4 days and using 33,600 mA.  this would be 5 C batteries (4.2) or 3 D batteries (2.8).  Sound correct?  I would assume that there will be a lot less than peak unless I am running the RGB's full-time. 

Since it will be turned off during the day - I would realistically expect:

2 Days maximum requirements:  2 C Batteries should work powering the RGB's full-time.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: CrossRoads on Aug 30, 2012, 01:08 am
Wikipedia says
"Alkaline C batteries can hold up to 8,000 mAh,"
So 3 C-cells, 4.5V and 8000mAh, could last ~ 22 hours.
(8000/350)

Alkaline D batteries 12000-18000 mAh
So 3 D-cells, 4.5V and 18000mAh, could last ~51 hours.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: cincy on Aug 30, 2012, 04:59 pm
With 3 C-Cells, wouldn't you have 8000mAh * 3 = 24000mAh?  That's what I was basing my calculations from.
Title: Re: Circuit Design from UNO board to ATMega328 without board
Post by: johnwasser on Aug 30, 2012, 11:06 pm

With 3 C-Cells, wouldn't you have 8000mAh * 3 = 24000mAh?  That's what I was basing my calculations from.


Only if you put them in parallel.  You get three times as many watt-hours no matter how you connect them but when they are in series the voltage is three times as high.  This gives you the higher voltage but the same mAh as a single cell.