Email or username:

Password:

Forgot your password?
r覊ustic cy蜖be谈rpu痰nk馃馃

This is a minimal circuit to get an ATMega328 running solo, without the Arduino board and USB stuff

If you leave out the 16MHz crystal and use the onboard 8MHz clock, you can bring down the power consumption even more, but at lower speed, obviously

The thing to keep in mind that the Arduino pins and the ATMega chip pins aren't the same. There's some mapping translation involved if you're using the Arduino IDE to program one

#HardwareHacking

ATMega328 circuit with connected 16MHz xtal, reset switch, and 5V power supplied
27 comments
r覊ustic cy蜖be谈rpu痰nk馃馃

Here's the comparison of Arduino to ATMega328 pins. They are indeed different

Pinout diagram of the ATMega328 and the Arduino overlayed
r覊ustic cy蜖be谈rpu痰nk馃馃

I'm in the process of trimming down the typical Arduino circuit into the barebones ATMega328 chip + few components layout. I was looking at project boxes that can house just the chip plus the few components directly soldered to a chip socket (because I'd like to replace the chip itself at some point)

My goal is to make a standard "project dongle" with the components in a small project box with color coded wires coming out, that I can solder into any project

r覊ustic cy蜖be谈rpu痰nk馃馃

Come to think of it, the typical IDE cable has just enough pins to cover every ATMega328 function with plenty of ground lines in between to avoid interference

If all my projects use a standard 40 pin IDE connector, I can even avoid soldering and just plug the "project dongle" right in

I have *lots* of ribbon cable in the closet somewhere

Standard IDE connector with pins 1, 2, 39, and 40 numbered
r覊ustic cy蜖be谈rpu痰nk馃馃

Made myself a chart of IDE to ATmega328 to Arduino layout pins

I tried to isolate the data heavy/sensitive pins with ground lines to avoid interference. I'm not too concerned about analog, but isolated Analog 4 for extra sensitive reads by putting it near 2 Analog ref lines

Chart mapping IDE 40 connector pins to ATMega328 pins and corresponding Arduino labels
r覊ustic cy蜖be谈rpu痰nk馃馃

I was looking back at this idea of converting an ATmega328 into a pluggable module via an IDE 40 pin connector. It occurs to me that, most of the time, you would program a chip, drop it into a project box, and that's about it

Which means, it's really not necessary to have every analog and PWM pin connected at all times, just ones you're using (usually 5-6 at most in my case). And it's safer and simpler to have as few intrusions as possible into your enclosure for waterproofing too

r覊ustic cy蜖be谈rpu痰nk馃馃

This makes me wonder if good old fashion automotive connectors with 4-6 pins (and maybe another pair with an inline fuse for power) are all that's needed. They're certainly a lot simpler than having to solder 40 pins

I was thinking of creating an ESD and over/under volt protected circuit to power an ATmega328 chip with opto-isolated data pins

Something like a dongle that I can quickly plug into my projects around the place

r覊ustic cy蜖be谈rpu痰nk馃馃

I was looking at a way of reducing line noise on power supply for this project and looked at putting a common mode choke on the v+ and gnd lines, but it turns out, how you wind the toroidal core has a lot to do with how effective that might be

I just came across this article
incompliancemag.com/article/wh

Turns out winding like this, which is better for signals, is actually better for power in my case too. Toroidal cores are much cheaper than finished chokes and it's also easier to wind by hand

I was looking at a way of reducing line noise on power supply for this project and looked at putting a common mode choke on the v+ and gnd lines, but it turns out, how you wind the toroidal core has a lot to do with how effective that might be

I just came across this article
incompliancemag.com/article/wh

Winding of a toroidal core with + and - lines wound together in one direction, with current flow in opposite directions
r覊ustic cy蜖be谈rpu痰nk馃馃

There's also the issue of project boxes. Generally, these are injection moulded ABS plastic and come in small sizes with screws and such. Some are weather "resistant". The cheaper ones are almost always only for keeping out humidity, not being submerged or sprayed with water

Which makes me wonder whether I actually need a project box, or just a small diameter PVC pipe. Only one end needs to be sealed while the "wire end" can be pressure fit with a bit of silicone around the holes in the cap

r覊ustic cy蜖be谈rpu痰nk馃馃

This is an excellent video on building a power supply for hobby projects (Arduinos etc...)

I'll likely be using an onboard circuit delivering 12V, 5V, and 3.3V, which can run off a battery or solar panel so I don't have worry about multiple power supplies for the ATmega328 and other peripherals

Most of my projects probably won't be directly connected to mains power anyway

Maybe I can build a pluggable power supply module for that as well

youtube.com/watch?v=IT19dg73nK

r覊ustic cy蜖be谈rpu痰nk馃馃

While looking at a suitable chip to control my switching power supply for the ATmega328, I came across this calculator for the MC34063A

nomad.ee/micros/mc34063a/

The 34063 is pretty much the 2N2222 of the DC/DC converter world. If you got a generic converter or one of those car charger adapter thingies, chances are it's powered by one of these chips. So it's good to have a good calculator to go with with the settings you need

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

I just had a terrible idea that, much to my relief, others have already tried out. I couldn't find any instances of house fires or serious injuries related to this so I'll take that as a good sign

Using an old fashioned 555 timer as the pulse trigger for a switched mode power supply

In fact, here's a pretty nice project on using the 555 timer as a variable power supply for a nixie tube github.com/tardate/LittleArdui

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

This is a very simple and straightforward explanation of a SEPIC converter topology for a power supply

This is good for when the power can be lower or higher than the voltage you need (as in maybe a solar panel supplying a battery and circuit). MPPT charge controllers work similar to this

For my ATmega328 power source, I'll probably do this since, most of the time, it will also probably spend a lot of time connected to a solar panel for simple outdoor projects

youtube.com/watch?v=dV-LRAUZ_A

This is a very simple and straightforward explanation of a SEPIC converter topology for a power supply

This is good for when the power can be lower or higher than the voltage you need (as in maybe a solar panel supplying a battery and circuit). MPPT charge controllers work similar to this

For my ATmega328 power source, I'll probably do this since, most of the time, it will also probably spend a lot of time connected to a solar panel for simple outdoor projects

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

This is a very simpler solar charge controller built with a 555 timer as the main handler

It uses very basic parts: a few resistors/caps, a 7809 voltage regulator (which is almost as common as the 555), and an IRF3205, which is an N-channel MOSFET, but think pretty much any other high current one would work there too

This might be a pretty good replacement to those Arduino based charge controllers. Actually, the Arduino ones use the same exact MOSFET as this

youtube.com/watch?v=A75cE_k9cV

This is a very simpler solar charge controller built with a 555 timer as the main handler

It uses very basic parts: a few resistors/caps, a 7809 voltage regulator (which is almost as common as the 555), and an IRF3205, which is an N-channel MOSFET, but think pretty much any other high current one would work there too

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

A lot of Arduino projects use the 7805 voltage regulator, but if I'm only powering the ATmega328 chip and nothing else (not even the LED or optocouplers), I think I can get away with using a 78L05

16MHz+ speed is supported between 4.5V - 5.5V, but (according to the datasheet) running on the internal 8MHz clock should only draw 2.7mA

Including the external 16MHz crystal, it may be 80mA+ total (30ohm ESR crystal, 2 - 22pf caps, and 10K resistor)

78L05 can support up to 100mA so it's just enough

78L05 In 3-pin transistor-like package
r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

It's oddly liberating to design a circuit schematic in Notepad

Power supply circuit schematic
r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

Next challenge is making all that fit into this 3x7cm perf board

I'm not too worried about power dissipation just yet, but I'm going to try and orient all the MOSFETs to one side so their heatsinks away from the rest of the board

Small perforated printed circuit board
r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

I'm half tempted to try and squeeze a different version into this 2x8cm board as a fun challenge, but that may be for later

Actually, I got this board to try out a minimal ATmega328 setup with just the crystal, resistor and the 2 capacitors

Small printed circuit board
r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

Added a project page for the power supply. Just a place to put down ideas while I sketch them

github.com/cypnk/Cabin-Life/tr

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

I'm always uncomfortable when adding disclaimers to anything

I.E. "Not responsible for sparks, fires, or worse, by using my poorly thought out ideas in this thing thing I wrote at 9AM on a Sunday while running low on coffee"

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

OK I think we can call it a day

This *shouldn't* immediately blow up after connecting power

This was a challenge and a half without a working oscilloscope. I really can't afford a new one right now so a lot of the component values are blank (or wrong) for now

(Stream of consciousness hardware hacking is a bad idea, kids. Don't try it at home)

I'm still liking the Notepad schematic idea since I can freehand pretty much everything and it's not going to complain

r覊ustic cy蜖be谈rpu痰nk馃馃 replied to r覊ustic

NASA's Through hole soldering guidelines might come in handy when it's time to assemble components for my power supply

If I'm building it to function way off in the woods, exposed to all manner of whatnot, soldering is probably the least of my worries. But why allow the possibility for small issues to accumulate into big problems

workmanship.nasa.gov/lib/insp/

Darius Kazemi replied to r覊ustic

@cypnk omg I love that these workmanship standards are just out there to read

brennen replied to Darius

@darius @cypnk as i remember, this discussion came up at sparkfun when we realized that people were *actually* sending our stuff to space on cubesats and the like. which is definitely, like, a holy shit cool moment, and then a lot like when you find out people are using it for medical devices you go wait, are you sure you want to do that, because i probably wouldn't do that

Go Up