Go Down

Topic: My first standalone project - chceck correctness please (Read 10592 times) previous topic - next topic

pytel_zajicu

Aug 12, 2013, 12:28 am Last Edit: Aug 12, 2013, 12:22 pm by pytel_zajicu Reason: 1
Hi,
I am projecting my first standalone arduino project. I making LED lighting for my aquarium, there will be 7 branches of serial LEDs. Each branch can be controlled one of 3 pwm signals (signal is choosed by jumper). There will be an i2c display and DS1306 clocks, maybe some sensors in future. 4 buttons for control and one reset button.
Can you tell me, if it is correct? It is my first standalone arduino project, so I want to make me sure that PCB will be ok at first time.

I am glad for any comment.

sorry for my bad english



EDIT:

johnwasser

Both ends of LED2 seem to be connected to Ground.  It will never light.

If you press the Reset button you will be shorting +5V to Ground.  That will fry something.
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp
See who has no social life: https://forum.arduino.cc/index.php?action=stats :)

larryd

Place a 100nF capacitor right next to the 7805 pin 1 to 3.
Your reset switch is wrong! You are shorting out the +5 to GND.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Paul__B


If you press the Reset button you will be shorting +5V to Ground.  That will fry something.


Not necessarily fry - the 7805 will current limit and thermal shut down if it persists.  Not a good idea however, and shorting the capacitor will reduce the working lifetime of the pushbutton.

Hopefully innocent draughting blunder as with the LED - the button should have been connected to the reset pin and resistor further right.

Seems to have the "raw" supply connected to the I2C spills - should of course be the regulated 5V line.



dc42

As well as fixing the problems already mentioned, I suggest you add a standard 6-pin ICSP header so that you can reprogram the microcontroller in-situ.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

pytel_zajicu

Thank you guys.

Lary, there is 10uF capacitor, should I replace it?

I edited my sketch, so I hope, everything is OK... Added ISP pins and add power suppply for fans for cooling leds, but I dont know if it is connected right...
New sketch is in first post

dc42

#6
Aug 12, 2013, 12:43 pm Last Edit: Aug 12, 2013, 12:45 pm by dc42 Reason: 1
You now have C3, C4 and pin 22 of the mcu connected to +5V instead of to ground. The reset pins of the MCU and ICSP header should go to the junction of the 10K resistor and the reset switch, not to +5V.

You don't need to connect Aref to +5V, you can do that inside the chip - and it's better to do it that way, in case you accidentally connect Aref to the 1.1V internal reference in the code.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

xl97


As well as fixing the problems already mentioned, I suggest you add a standard 6-pin ICSP header so that you can reprogram the microcontroller in-situ.


this!  ^^

recently had to deal with pre-existing pcb's that didnt have any ICSP headers/breakouts..

(FYI.. I used this cable from HobbyKing.com since my chips were Atmega328P-AU/SMD versions of the chip)
http://www.hobbyking.com/hobbyking/store/__27195__Atmel_Atmega_Socket_Firmware_Flashing_Tool.html

(worked a treat too!)


pytel_zajicu

OK, 3rd version, I hope now it is without errors :0... Can you explain me please, what to do capacitors around 7805 regulator? Should I place it by the 7812 too?


dc42

1. You should add a 0.1uF ceramic capacitor between the atmega Vcc and Gnd pins, and another between Avcc and Agnd. Place these capacitors as close to the atmega as reasonably possible.

2. Regarding capacitors at the input and output of the regulator, check the regulator datasheet for the recommendations for the particular regulators you will be using. Generally, you always need an input capacitor (which must be placed close to the regulator), but the output capacitor is optional for many regulators. So you do need to add an input capacitor on the 7812. The input capacitor of the 7805 can double up as the output capacitor of the 7812.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Tom Carpenter

#10
Aug 12, 2013, 06:26 pm Last Edit: Aug 12, 2013, 06:28 pm by Tom Carpenter Reason: 1

Can you explain me please, what to do capacitors around 7805 regulator? Should I place it by the 7812 too?

The capacitors have two roles.

The first is to filter noise from the supply lines which could interfere with circuitry (especially microcontrollers). Simply put, capacitors act like a short circuit to AC signals, effectively removing them from the power rails.

The second in respect to regulators is to prevent them oscillating. These regulators rely on a closed loop feedback control, whereby it aims to make the output voltage constant even if output current or input voltage changes. In some cases this feedback loop can overcompensate and go out of control resulting in high frequency waveforms being added to the supply line. The capacitors help slow any change in output/input voltages to help reduce the chance of oscillation, and remove the noise.
~Tom~

pytel_zajicu

Thank you Tom, thank you dc42 :)...
Is it correct now?


dc42

#12
Aug 13, 2013, 02:31 pm Last Edit: Aug 13, 2013, 02:33 pm by dc42 Reason: 1
I can't see any obvious errors now. I presume the input at J1 will be more than 12V?

I suggest you make provision for an output capacitor on the 12V regulator, just in case you find you need one - even if you don't plan to fit one initially. My previous comment "The input capacitor of the 7805 can double up as the output capacitor of the 7812." was wrong; I thought the 7812 was powering the 7805, but I see now that they are both powered from J1. C1 can serve as the input capacitor for both regulators, as long as they are fairly close together.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Samba

#13
Aug 13, 2013, 07:26 pm Last Edit: Aug 13, 2013, 07:28 pm by Samba Reason: 1
This was enlightening! I know nothing about electronics but now it doesn't seem totally impossibly to design your own board!
Just a thought, why not have the ADC and other pins on the top next to 5V and GND like
5V-A0-GND-A1-5V-A1-GND-A2-5V, or
GND-A0-5V GND-A1-5V GND-A2-5V

Have them on a 2.54mm pitch and maybe add some Screw Terminal Block later...

Don't you use TX and RX to program a Atmel382?

pytel_zajicu

Thanks again dc42 for your patience with me, I am glad about people like you. Here is modified sketch.


I placed own capacitor on 12V regulator (in and also out), add RXD, TXD pinout and add some gnd holes. Hope, it is finish version :))...

Samba: this is only sketch, when Ill design board, probably it will be placed together (GND-IO-VCC).

I have question about ICSP uploading sketches. I never used RX/TX pins or SPI pins to communication. I only use i2c, but if I understand well, SPI and RX-TX is using for communication with other devices too. But I cant find how works ICSP uploading sketches explained for dummies. Is it uploads via SPI or RX/TX or both?

Go Up