Schematic to perfboard, need some advices

Hi guys!
I'm going to solder my first perfboard "hardware" project. It's a quite simple RGB lamp controlled by buttons and via bluetooth.
I'm not really sure about a couple of things.... Here's my schematic:

In the schematic there's a part missing ( a potentiometer wired to analog input , a pushbutton( hardware debounced) wired to DigitalPin2 that handles an interrupt, and a bluetooth module that sends and receives datas to and from a phone.) but that part is quite ready-to-go so i don't have big doubts about it. ( Please don't mind which Atmega328p pins i wired to the transistors 'cause i made it randomly)

My doubts are:

  1. I'm sourcing power from a wall power supply ( 12 V ,1 A ) .....the led strip is directly wired to the source, the standalone atmega328p and all the other devices are powered from the 5V coming from the 7805. with the rule of thumb, Atmega + Bluetooth + button + potentiometer are drawing about 400-450 mA...instead , my rgb led strip ( 60 cm) is going to draw about 300-350 mA.... the question is..... dropping 12 to 5 with 7805 is going to make it really hot? ( please note that all this circuit, the strip excluded, is going to be placed in a small plastic box)....So, do i need some type of heatsink ? maybe an intermediate 7809 could lightweight the 7805 work?

  2. Do i need any blocking diode between the power source and the 7805 ( or maybe between the 7805 and the atmega chip) to prevent damages ?

  3. is there any outstanding problem that i cannot see?

Why is your atmega + bluetooth + pot + button drawing 400- 450mA? That seems way too high. I don't know how much the bluetooth should draw, but the other components should total less than 50mA.

The diode is a good idea, just in case, one day, someone other than you plugs in an incorrect power supply with the opposite polarity. Pretty unlikely really.

I think you should have some more caps in there. Perhaps a 10uF on the output of the 7805. And a large as possible one, like 1000uF accross the led strip. Also a 0.1uF as close as possible to each of the 5V inputs of the Atmega.

Paul

Hi Paul, and thanks for your fast answer!
You mean something like this?

I placed a 100nF on the OUT of the 7805 because it's the configuration suggested by the datasheet.
So you suggest also to to place a cap between +5V and GND before every device ? ( bluetooth, pushbutton, potentiometer...etc etc ) ?
Regarding your "Bluetooth-drawing-doubt" , i also guess it draw less but in an old datasheet i read, there was reported that it can draw about 300 mA during the device connection, than the working current is much smaller.

Please let me know if i made any stupid mistake in this schematic, it's 2:11 am in my timezone so my mind is non really reliable :smiley:

D1 is upside-down.
You don't want to forward-bias that diode in normal operation.

Everytime I see "nF', nanofarad, I think of hectograms and dekalitres (or hecto- or deka- anything)

I'm running an Atmega328 on perf board 24/7 with a 7805 drawing from a 12 - 14v supply. I put a large Heatsink (from Maplin) on the 7805 and it barely gets warm.

...R

[quote author=Runaway Pancake link=topic=255281.msg1806381#msg1806381 date=1405478733]
D1 is upside-down.[/quote]

Upside down? How does having the diode the other way up protect the circuit against accidental reverse-power connection? Surely if that happened, the diode would just blow, then the 7805 would be exposed?

I would put the diode in series with the 7805 input. Please explain how my thiniking is wrong.

I don't see why. Its an official SI unit. One thousandth of a micro-Farad. (I get your point about hecto and deca. They are not a power-of-1000 of anything, they are a power-of-10 of something.)

funksoulbrother:
I placed a 100nF on the OUT of the 7805 because it's the configuration suggested by the datasheet.

Keep that in, along with the 10uF.

funksoulbrother:
So you suggest also to to place a cap between +5V and GND before every device ? ( bluetooth, pushbutton, potentiometer...etc etc ) ?

No, just the power pins of chips. Their internal switching can create sudden, short peaks in current draw and this can interfere with other parts of the circuit. The 0.1uF close to those power pins satisfies those short peaks.

funksoulbrother:
Regarding your "Bluetooth-drawing-doubt" , i also guess it draw less but in an old datasheet i read, there was reported that it can draw about 300 mA during the device connection, than the working current is much smaller.

Yes, transmissions will cause short bursts of demand for high current. That 10uF should help smooth those peaks. Maybe 100uF would be better. The average current should be much much lower, so the 7805 should not get hot.

funksoulbrother:
Please let me know if i made any stupid mistake in this schematic, it's 2:11 am in my timezone so my mind is non really reliable :smiley:

Yes, that diode is definitely drawn wrong. I don't know why Runawaypancake has suggested the other way up - hopefully he will explain.

Thanks to all for the collaboration.
I updated the schematic with also the missing devices( please again never mind the atmega pins i wired cause i've done it randomly to make the schematic clearer)

Just some words

  1. The Diode...OMG... it was definitely late night!

  2. I downloaded another HC-06 datasheet ( maybe newer) and discovered that the one i already had was faulty. The bluetooth module draws 30-40 mA during pairing and not 300-400 mA. Running current is between 10-20 mA.

  3. About heatsinking, i'm going to use one of these to cool my 7805
    http://www.taydaelectronics.com/heat-sink-to-220-10-fins-1-inch-aluminium-white.html
    Now that my HC-06 draws a smaller current, maybe it's also way too large to do the job .
    How do you think about it?

funksoulbrother:
2. I downloaded another HC-06 datasheet ( maybe newer) and discovered that the one i already had was faulty. The bluetooth module draws 30-40 mA during pairing and not 300-400 mA. Running current is between 10-20 mA.

That's more like it!

funksoulbrother:
3. About heatsinking, i'm going to use one of these to cool my 7805
http://www.taydaelectronics.com/heat-sink-to-220-10-fins-1-inch-aluminium-white.html
Now that my HC-06 draws a smaller current, maybe it's also way too large to do the job .
How do you think about it?

If using 7805, I don't think you'll need it. The 7805 has a large-ish metal tag.

However, I would not recommend downgrading to 78L05. I have one of those running an atmega328 and a 128x64 LCD off a 9V supply and it gets a little too warm for my liking. You are drawing more current from a higher voltage. P=IV !

Another option would be a miniature DC-DC convertor to power the atmega + bt module.

http://www.ebay.co.uk/itm/310683416079?ssPageName=STRK:MESINDXX:IT&_trksid=p3984.m1436.l2649

Thank you Paul for your help and your patience.

I've got just one last question.
It's not reported in the schematic, but there's a switch on the +12v rail just after the power source. this simple SPDT switch breaks the 12v rail to create an open-circuit condition and turn off the device... or it can be closed to let power flow through the rail and power up all the system. Should i put another capacitor between 12v and GND really close to the switch ro prevent sparks?

PaulRB:

[quote author=Runaway Pancake link=topic=255281.msg1806381#msg1806381 date=1405478733]
D1 is upside-down.

Upside down? How does having the diode the other way up protect the circuit against accidental reverse-power connection? Surely if that happened, the diode would just blow, then the 7805 would be exposed?

I would put the diode in series with the 7805 input. Please explain how my thiniking is wrong.
[/quote]

Installed in parallel with the input, when reverse-biased it would clear the input fuse (which is absent).
Your thinking isn't wrong, it's just that I didn't want to do anybody else's. The diode presented was in parallel and I was good with that. So, there's a right way and a wrong way to put a diode in parallel with an input. That was the wrong way.

PaulRB:

[quote author=Runaway Pancake link=topic=255281.msg1806381#msg1806381 date=1405478733]
Everytime I see "nF', nanofarad, I think of hectograms and dekalitres (or hecto- or deka- anything)

I don't see why. Its an official SI unit. One thousandth of a micro-Farad. (I get your point about hecto and deca. They are not a power-of-1000 of anything, they are a power-of-10 of something.)
[/quote]

SI unit, nF? Never seen it used much till late, like it's being forced, it's contrived. Everything had (?) always been expressed as microfarad or picofarad (before that, micro-microfarad.) I remember guys in class asking "why?" and the answer was "that's just how it is (no millifarads either.)" 4700uF? That's an outrage, it's 4.7 mF!
Hecto and Deka, rare instances. No 1.5h? (a..k.a 150?) resistors. They're there - shouldn't we use them? [Please, don't answer.]
12V? Well, what's that? Shouldn't it be 1.2dkV? It's discrimination! Peoples' Front for the Full Inclusion of Hecto and Deka (oh, and Deci, too)

FWIW, The Arbiter of All Truth (a.k.a. "Wikipedia", or should it be "Wikipædia") has this:
For most applications, the farad is an impractically large unit of capacitance, although capacitors measured in farads are now used, especially for backing up memory. The most commonly used SI prefixes for electrical and electronic applications are:

1 microfarad (?F, or MFD in industrial use) = one millionth (10?6) of a farad, or 1000000 pF
1 picofarad (pF) = one trillionth (10?12) of a farad

funksoulbrother:
Should i put another capacitor between 12v and GND really close to the switch ro prevent sparks?

No I don't think so. Sparking is only really an issue when you have reactive loads like motors and relays.

I'm posting now the final schematic.
It's quite simple but maybe a day someone would like to replicate this RGB bluetooth lamp.
Thanks everyone for the support, especially Paul that had a lot of patience with me and my project :slight_smile:

Some further observations:

  1. You need to connect AVcc to +5V, or the analog inputs won't work.
  2. You need to put a 10K from +5V to RESET to allow the atmega to run.
  3. Not sure you really need those 10K pulldowns on the transistor bases (they won't do any harm). BJTs aren't going to switch on "by accident" like FETs can when the atmega's pins are not set as outputs.
  4. How did you calculate the value for those 1K on the transistor bases? Not saying they are wrong, just want to check they were correctly worked out for this circuit (for example what gain figure did you use for the BC337?)

Hi Paul!

  1. You need to connect AVcc to +5V, or the analog inputs won't work.

Yeah, i've done it , it's not reported in the schematic because that eagle's chip pinout it's not handy at all

  1. You need to put a 10K from +5V to RESET to allow the atmega to run.

I've tested the whole system a couple of hours ago and i can assure you is working well also without that resistor( When i started developing the system on the Uno board i used to put a cap between reset and ground due to continuos auto-reset)

  1. Not sure you really need those 10K pulldowns on the transistor bases (they won't do any harm). BJTs aren't going to switch on "by accident" like FETs can when the atmega's pins are not set as outputs.
    4.How did you calculate the value for those 1K on the transistor bases? Not saying they are wrong, just want to check they were correctly worked out for this circuit (for example what gain figure did you use for the BC337?)

These are my calcs:
Ib = Ic/Hfe so 0.055/200= 0,000275 A (1 meter of led strip draws about 550 mA, i'm just using 10 cm)
To be sure to drive the bc337 in saturation condition , i raised the current on the base of about 2-3 time and so i have a 0,0008A current on the base.
Then i used this value to calculate my base resistor : 5V - 0,7 ( base-emitter voltage drop) so: 4,3V/ 0,0008A = 5300 Ohm
Then i thought that a pwm signal mean value isn't 5v so i decided to decrease that resistor.
The 10K resistor has just the goal to give to the base terminal a GND reference [ Please note that this calcs were adapted from an italian blog that reported a tutorial on "How wire your first led Strip"]

you mean he should have listed those resistors as 10 heckto ohm ?

you might start a fad !

I've tested the whole system a couple of hours ago and i can assure you is working well also without that resistor( When i started developing the system on the Uno board i used to put a cap between reset and ground due to continuos auto-reset)

So one test is enough for you to ignore what it says in the data sheet.

Are you going to have a crystal on the board?
Little point in saying this is the final schematic with a bunch of stuff missing.

Grumpy_Mike:

I've tested the whole system a couple of hours ago and i can assure you is working well also without that resistor( When i started developing the system on the Uno board i used to put a cap between reset and ground due to continuos auto-reset)

So one test is enough for you to ignore what it says in the data sheet.

Are you going to have a crystal on the board?
Little point in saying this is the final schematic with a bunch of stuff missing.

Of course there's crystal.And 22pF caps too. This schematics represent the Lamp circuit and not the whole arduino standalone+lamp circuit. As Paul noticed before, also AVCC is wired to 5V , but it's not represented in this schematic, due to the really creepy pinout of the chip in Eagle's library. Pins assignment isn't correct too.

I'll upload a new really complete schematic to wipe any doubt. And maybe also the perfboard Layout.
P.s , a test is not much i know, but i'm running another atmega328p chip on breadboard with a stupid sketch like StopLight tutorial without that resistor and i'm not experiencing any problem...but well, i will solder it too

but i'm running another atmega328p chip on breadboard with a stupid sketch like StopLight tutorial without that resistor and i'm not experiencing any problem

Oh I see, you are not very interested in electronics are you just like slowly destroying them.

When falling from an aircraft at 50,000 ft most people have no trouble with the first 49,999 ft. it is the last one that's the bugger.

Here i am. Here's the complete scheme (This time is really complete)


Notes: 1 Cap is missing ( the one between AVCC and GND) .

And here's one of the perfoboards layout i designed.

Some notes:

  1. Bending wires are jumpers.

2.I put some sockets in this perfboard to let the whole structure be organizated( especially when all the stuffs are placed in the box). So there's a socket for the pushbutton, a socket for the Potentiometer and also one for the RGB led strip. I'm going to realize them with molex connectors or male-female pins.

  1. The blue and yellow pins at the bottom are rispectively serial RX and TX and they'll be wired to the bluetooth module through jumpers, so it will be movable ( and probably outside of the box) . +5V and GND connections are missing but won't be a problem.

4.Maybe i'll move the "pushbutton and company" up and dx,to place them as far as possible from the 7805.

5.Don't like the actual Quartz position and i'll try to find best solutions.

I know that this design is quite basic but i tried to organize all the stuffs best that i could on a 5x7cm perfboard.