Go Down

Topic: Does this schematic look OK? (Read 255 times) previous topic - next topic

audxv

Hello!

I've been working on a schematic with a power regulator and ATMEGA328 that controls a potentiometer and a 4 digit 7 segment display. This is one of my first schematics (and definitely the most complex). Can you internet geniuses take a look at it for me?


A few notes:

I used 13pF capacitors for my crystal; I used this guide and the 16mhz crystal that I chose was rated for 9pF.

I added pads for each pin on the ATMEGA328 that I can connect to an arduino uno board (without the chip installed), in order to program the ATMEGA chip.

Any replies are greatly appreciated!!  :D

larryd

#1
Aug 02, 2020, 02:51 am Last Edit: Aug 02, 2020, 02:52 am by larryd
No geniuses here.

C4-5 are backwards.

On USB1 if Vcc is 5V the 7805 will not work.

You need decoupling capacitor on 328 Vcc.

7 segment needs series resistors if not already built in.

Add a power LED.

Add a reset switch.

If you will be using FTDI for programming, review what needs to be connected to get the connector properly dealt with.


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.

Wawa

A 5volt regulator powered from 5volt USB won't work.
An (old-school) 7805 regulator needs at least 7volt on it's input to make a stable 5volt on it's output.
The input capacitor is also too small for an 7805 (330n minimum, see datasheet).
Can power the chip directly from the USB socket (with some buffer capacitance).
Add some ceramic decoupling on the chip's VCC pin(s) too, close to the chip.

I see you advised a current limiting resistor to a poster in another thread, and yet you don't use them yourself.
That LED display needs eight resistors in the cathode lines.

The two 13pF (12 and 15 are E12 values) capacitors are from the crystal's point of view in series,
so you have 13/2= 6.5pF across the crystal, plus some layout and chip capacitance.
Seems ok for a 9pF crystal, and this is not critical unless you make a clock/stopwatch or something.
Leo..

audxv

Thanks for the responses!

The resistors for the 7 segment display totally flew over my head - not sure why I figured such a display wouldn't need them. I'll add some 220hom resistors.

I'll redo the power supply circuit, copying that of the pro mini (not using anything right of the solder jumper):

Would this work?

I'll also add a power LED and reset switch as stated.

I want the clock to be as accurate as possible. Going off of what Wawa wrote, I'll change the capacitors in series to 18pF (18/2=9).

Finally, I'll add a decoupling capacitor on VCC.

I'll post a schematic as soon as I finish reworking it - would this fix everything?
Thanks again, you guys!!

Paul__B

According to this post, you already know that you need segment resistors for the LED display.  These need to be 1k as all the segment current - at least 7 segments for the digit "8" - is being carried by a single ATmega pin.

If you are powering this from a USB source ("phone charger"), why are you trying to insert a regulator?

It would make more sense (cheaper, more practical) to just use a Pro Mini and mount it as a daughterboard to your own PCB.  And use one of the many pre-built display modules instead of trying to multiplex in code.  :smiley-roll:

audxv

No need to use my own post against me - again. As stated in my previous post, I forgot to add resistors. I continued to add them in.

As for powering the circuit: should I be worried about too much voltage / current? I figured I should be, in the off chance that the circuit is powered through too powerful of a charger (like 5v, 3A) and the ATMEGA / rest of the circuit would be damaged.

I'm not sure what the pre-built display modules are that you're talking about, but I already have a display, and code for it.

As for why I'm going for an "impractical" approach, I want to learn how to use an ATMEGA without an arduino. The goal of the project is for me to learn more about how arduinos and electronics in general work. If you have any suggestions for how to learn this topic, please let me know.

6v6gt

Yes. Multiplexing is good learning experience and can save using an extra chip.
You seem to have a misunderstanding about current. A circuit will take only as much current as it requires (assuming even that is available). So connecting an arduino to 5 volt power source, whether 2A or 200A, should function correctly. The regulator reduces voltage, say 12volts down to 5 volts and, in the case of a linear voltage regulator, burns the excess away as heat.

PerryBebbington

Quote
As for powering the circuit: should I be worried about too much voltage / current? I figured I should be, in the off chance that the circuit is powered through too powerful of a charger (like 5v, 3A) and the ATMEGA / rest of the circuit would be damaged.
That question is answered by understanding Ohm's Law.
Not directly relevant to that particular question but essential basic electrical theory is also Kirchhoff's circuit laws

Wawa

Going off of what Wawa wrote, I'll change the capacitors in series to 18pF (18/2=9).
Read it again.
I also wrote that there is some layout (circuit board traces) and chip (input) capacitance.
That could easily add up to several pF.

We're only talking about second(s) difference per day if you don't get it right.
Not worth spending too much time on it, since it's also temp dependent.
13pF is fine. 12pF or 15pF is too.
Leo..

6v6gt

If you are soldering the MCU chip, it is a good idea to add an ICSP header, and you'll anyway need some connection to load at least the boot loader, if you are using one.

If you are using an FTDI interface for programming and viewing the serial console for debugging etc. (already mentioned), you need an additional capacitor for reset, and it is good to have standard the pin order for a 1:1 connection with a common FTDI type device.

Smajdalf

Usually the resistor for the decimal point is larger because the area of the LED is smaller and so it seems brighter when lit with the same current.
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

MarkT

Firstly you have a footprint for the ATmega328PB, which is a different chip from the ATmega328P - do
you realize this?

Vcc and AVcc must both be connected to 5V, and you must have 100nF ceramic decoupling capacitor to ground on each one, right next to the pin.  Failure to power Vcc and AVcc at the same time can fry the chip.

Most crystals are rated for more capacitance, 22pF load caps presents 11pF to the crystal, which is in
parallel with the chip's capacitance, making around 15--20pF that the crystal sees, and 20pF crystals are
most common I think.  Its not too crucial.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Grumpy_Mike

Quote
These need to be 1k as all the segment current - at least 7 segments for the digit "8" - is being carried by a single ATmega pin.
Note that with 1K resistors and a 4:1 multiplex ratio the display will be very dim. It is normal to drive the anodes through a PNP transistor with the Arduino connected to the Base of the transistor through a 1K resistor or there about.

ShermanP

It won't make the display any brighter, but you could save four resistors by putting one resistor on each common anode line instead of the eight segment lines, and multiplexing by segment instead of by digit.  You would use 470Ω resistors, and refresh twice as fast.  The SevSeg library supports that.

MK1888

I would:

* Make C4 10uF.
* Add 1uf or 10uF next to C5.  As noted C4 and C5 are backwards, but 100nF caps usually have no polarity...just like C1.
* But, as noted, USB -> 7805 won't work as that regulator needs (I think) 2-ish volts overhead.
* Use 470 ohm resistors on the display segments, 1K could be okay if that brightness is fine with you.  You'll see when you get the multiplexing running.
* Switch the anodes with 2N3906 (PNP) transistors with 1K base resistors to ATmega.  Are you sure you're using a common anode display?
* Check the datasheet for "total current sinked (to have been sunken?) by port" or similar.  If the display is red, 470 ohm resistors will give you about 5mA per segment...7 segments makes it 35mA (and another 5mA for decimal point).
* Use 22pF (or 15pF is okay) caps for the crystal.  Better stability.
* Can't you use an entire port (port E?) for the display segments?  Would make the code nicer.
* When coding for multiplexed 7-segment displays, make sure you turn off the segments before you switch to the next digit or you will see "ghosting".  Then again, you could ignore this advice and learn it for yourself. :)

Go Up