Variable Breadboard Power Module

A few weeks ago, I designed and built my own breadboard power module, mainly to try and solve some perceived problems with commercial ones, and also just to have something that is completely my own.

While that design does indeed work very well, I did however find a few tiny issues that still needed attention.

  • Two fixed voltages, 3.3v and 5.0v
  • 1A current limit per regulator
  • PCB Heatsink design can be improved further, as there is still a bit too much heat at a high current draw – not much actually, but I like things running as cool as possible.

Other requirements that popped up were the ability to have more than two set voltages, as well as being able to send the full Vsupply to a power rail if I choose to do so…

Having a few LM317G variable voltage regulators lying around, left over from a previous project, I decided to use those. They can source an additional 500mA of current (1500mA in total) and also makes it quite easy to have variable voltages.

Voltage is set with two resistors, of which one is usually a variable resistor. This does however mean that you need a multimeter or other device capable of measuring voltage each time that you need a different voltage, as well as to determine at what voltage the device is currently set if you have not used it in a while…

The initial prototype is quite bulky at the moment, but I do plan to change that in the future when I am completely happy with the performance of the module

Each “voltage channel” consists of a 5k multiturn “trim pot” that connects back through a selectable jumper to a 240-ohm resistor ( I actually used two precision 120-ohm resistors in series) on the adjust pin of the regulator.

I have also reduced the number of smoothing capacitors on the input and outputs, as the voltages are quite stable

After assembly, it only takes a few minutes to adjust each “trim pot” to the correct value using a small screwdriver and a multimeter. Once set and verified, they can be locked using a drop of “lock-tight” or similar.

The eight “trim pots” sets the voltages as follows:

Top Rail:
VR1 – 3.3v
VR2 – 5.0v
VR3 – 7.2v
VR4 – 9.0v

Bottom Rail:
VR5 – 3.3v
VR6 – 5.0v
VR7 – 7.2v
VR8 – 9.0v

Turning the “pot” anti-clockwise reduces the voltage, while a clockwise movement increases it.

Changing voltages then becomes as easy as changing a jumper to a preset position.

The Schematic


As mentioned above, I have used two precision 120-ohm resistors on one leg of the resister divider that is connected to the adjust leg. Feel free to replace that with a single 240-ohm resistor and a 0-ohm bridge.

The multiturn precision 5k trim pots give great control and the desired voltages can be dialled in very accurately.

The module was designed as a double-layer PCB. I used big solid ground planes to provide good grounding, as well as serve as heat sinks for the voltage regulators.


Manufacturing

I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ), or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Assembly

The assembly of this module is quite easy, no stencil is required. I recommend that you take care of the SMD components first, using hot -air or even hand soldering them, before assembling the through-hole components.

Here I do recommend that you use a breadboard to make sure that the 2.54mm headers that will connect to the power rails are lined up nicely

Testing and Setup

As already described above, the module does require a bit of setup after assembly. To do this, you will require a DC power supply with a voltage of 7v to 12v, as well as a multimeter, preferably with clips on the test leads, as well as a small terminal screwdriver.

  • With the module powered, and the Rail Voltage jumpers set to VCC, measure the rail outputs with the multimeter ( remember that the rail active jumper MUST be set to on). Both rails should be at the same voltage as your VCC input voltage, ie 12v DC
  • Move the Select Voltage jumper for both rails to the 3.3v position, and the Rail voltage jumper to the VSelect position for both rails.
  • With the multimeter connected to each rail in turn, turn VR1 anti-clockwise until the voltage for the top rail is set to 3.3v. Repeat for the bottom rail, adjusting VR5 instead, while measuring the bottom rail.
  • Repeat this step for each of the voltages, remember to power off the module before changing jumper positions – to prevent accidental short circuits…

Pictures

ATMEGA4808 – An Improvement on my previous design? Or Not…

Atmega4808 Development Card in Acrylic Shell

When I first started playing around with the ATMEGA4808, I was impressed as well as disappointed by the Arduino Every “Clone” that I got online. Impressed with the Microprocessor, but disappointed in the way the development board worked, the lack of documentation etc.

I set out to change that by doing my own version, something that I do quite a lot. If I don’t like something, and it is in my ability to create/design my own version, minus any of the perceived(in my opinion mostly) flaws of the original design, I usually do just that.

With that mindset firmly in place, a few weeks ago, I did indeed redesign an ATMEGA4804-based development module, and it worked flawlessly…

As time went by, that little irritating voice in my head got louder and louder… add this, change that, what if it was like this etc… Many makers will know exactly which little voice I am talking about.

Two Atmega4808 Modules, side-by-side

So what did I change?

The short answer to that is a lot. the long and detailed, well let’s see…

  1. Added an additional LDO voltage regulator, to provide more current.
  2. A DC barrel jack was included, enabling us to power this from 7v to 12vDC
  3. Changeable logic level ( switching entire board between 3.3v and 5v operation )
    with a single jumper.
  4. Improved labelling of GPIO functions (on the back of the PCB), listing alternative functions etc for each GPIO
  5. Put all that into the standard Arduino Uno Footprint…

So, did any of that really matter?

Once again, two answers, one long, one short… so here goes…

The added DC barrel jack, with the two dedicated LDO voltage regulators, adds flexibility to power the device externally, opening up possibilities to use it in a stand-alone project, not only on the bench.

The Logic level switching, which at the time, seemed like a very very good idea, now no longer seems so important…

Using the Arduino Uno footprint, yeah, so what, it is a neat layout, but apart from using a somewhat ” traditional” footprint, is only cosmetic…

That leaves only the updated silkscreen on the back of the PCB, as well as better labelling on the front…

Back Silkscreen
Front silkscreen

As far as information goes, yes, this is a great help. It will definitely save some time reading datasheets and looking up other stuff…

Does this mean the project was a failure?

Definitely not. I am not negative, but instead, have a tongue-in-the-cheek attitude about how sidetracked I became. I mean, this is basically the exact same board, with just a different form factor. So, in that case, think about it in the context of an Arduino UNO and Arduino NANO. Both of them use the exact same processor but only differ in footprint. ( as well as a few other cosmetic things and functions – the nano having additional analog inputs etc.).\

I am sure that the new form factor will appeal to some, and others will feel it was a completely unneeded design.

The Schematic

ATMEGA4808 Schematic

The schematic does not contain any surprises. everything is basically similar to my initial breakout module design, with the exception of the power section. I tried something different, and the jury is still out on how well it actually worked.

When powered from USB, the 3.3v LDO Voltage regulator gets fed directly from the USB Voltage, through a protection diode of course.. Similarly, when powering the device using the DC power jack, both LDO regulators are once again fed separately… for the time being, it seems to work well. Time will tell if it was the correct way to do things.

PCB Design

Top Layer
Bottom Layer

A lot of care was taken to attempt routing of all tracks at the shortest distance possible, as well as using differential pairs for the UART, SPI and I2C peripherals. PCB heatsinks for the LDO regulators, as well as ground planes on both side of the PCB, was also implemented.

Manufacturing

I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ), or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Assembly

The assembly of the ATMEGA4808 development card, as I named the creation, can be done entirely with a standard soldering iron and steady hands, but I chose to order a stencil with the PCB and reflow the PCB on a hotplate.

Stencil for SMD assembly

I prefer this way of assembly, as it is generally faster, looks neater, and ultimately uses less solder paste. This particular build did however give me a few headaches, which may be the underlying reason for my tongue-in-the-cheek attitude towards this PCB…

Let us take a look at some of the issues that I encountered

The Micro USB B connector that I used, seems to be quite sensitive to heat. I have a few different batches of these, and some are good, while others are just terrible. ( this happens because I did not buy them all from a reputable supplier, but opted for an online supplier instead – NOT LCSC as I normally do).

This resulted in having to change USB connectors a few times.

The second issue was the CH340N USB to Serial chip. Due to availability issues, I was once again forced to use an online supplier, and ended up receiving only two working chips out of a batch of 20! The fact that they were super cheap, with super fast shipping should have alerted me that something was wrong…

These two issues caused quite a lot of headaches and ultimately cost me an ATMEGA4808 chip, that for reasons unknown, died without any explanation, with the board pulling a crazy 3.5A at 5v for a few seconds. Subsequent testing revealed a failed 5.0v LDO regulator, which after being replaced by a new one, resulted in a perfectly working board. ( after sorting the CH340N and USB connector issue of course)

Conclusion

This build gave me a lot of problems, tested my diagnostic skills, as well as provided proof that you definitely get what you pay for. Electronics component supplies are still not quite at the level of availability that we are used to, with huge lead times and delays being a big issue.
This presents us with the tempting solution of buying a few components from dubious online companies; sometimes you get a good deal and sometimes you get only headaches like I was rudely reminded with this build.

As far as the PCB is concerned, there are absolutely no issues. Everything works as expected, and while no real changes were made between the two versions, It has already earned a permanent place on the bench, having replaced my old Arduino Uno clone as my goto development board when doing something ATMEGA related.

Some More Pictures

A complete ATTiny1616 Dev Solution

A few weeks ago, I started looking into alternative development solutions to reduce the effect of hard-to-get or more expensive-than-usual ATMEGA328 chips. One of the chips that I found to have potential was the ATTiny1616.

There seemed to be quite a lot of stock, and the prices were reasonable. Some additional hardware, like a dedicated UPDI programmer, had to be designed or bought, as the ATTiny1616 required UPDI to upload and flash code.

Setup to program ATTiny1616 Breakout Module – Power Module ( Left – Optional) ATTiny1616 Breakout – Center, UPDI programmer ( Right)

While the breakout worked flawlessly, I found the programming setup awkward and cumbersome. That was the cue to take the next step and create something that was easier to work with.

Old versus new. ATTiny1616 breakout module and programmer (Top) versus the all-new ATTiny1616 Development board, with all required hardware, included.

The new PCB offers a development cycle that is very similar to a standard Arduino UNO or Nano. Plug it into a USB port, write code, upload and repeat…

What is on the PCB?

Top view- In acrylic Case

Starting at the Top Lefthand corner, we have a USB port, with a CH340N Chip. Note that this IS NOT A SERIAL UART. This is an integrated UPDI programmer, that can also be used in stand-alone mode to program external devices. (by moving J3 to the left, and using the UPDI header).

Below that is the power supply section, featuring two LDO Voltage regulators, providing 3.3v and 5v DC to the system. A DC barrel jack is included, to supply between 7v and 12v external DC voltage to the system. ( NOT to be used together with a USB cable)

Jumper J2 (next to the DC barrel jack) is used to switch the entire board logic level between 3.3v and 5v DC. A power indicator LED, as well as a standard user LED ( on pin D16), is also included. The rest of the PCB is dedicated to the ATTiny 1616 -SF, this time in a TSOP form factor. ( The original breakout used a QFN, but I realised that that may push away a lot of potential users, as QFN packages are quite difficult to solder without the proper equipment. A TSOP package is more accessible to everyone)


A total of 17 GPIO ports are available, of which each is labelled with an Arduino compatible label (D0 – D15), PWM ~ capable pins, and alternate functions like UART, SPI and I2C. Please Note that the onboard USB port IS NOT A UART

Features on the PCB – Summary

  • Reset Circuit with Push button – The ATTiny1616 shares its Reset pin with the UPDI programming pin. This will cause problems, requiring an HV UPDI programmer to fix. To resolve this issue, a reset circuit, comprising of a p-channel logic level Mosfet, that is wired to be constantly on, is connected via a suitable resistor on its gate, to a push-button to ground. pressing the button pulls the gate to ground, switching off the Mosfet, and thus the supply voltage to the chip, which equates to a power cycle reset. It is worth noting that the UPDI programming sequence also auto-resets the chip after every upload.
  • DC barrel jack for powering the device from an external source – 7v to 12DC
  • Onboard I2C pull-up resistors, selectable with a jumper ( J1)
  • Onboard UPDI programmer, which can also be used in stand-alone mode.
  • Selectable voltage logic level between 3.3v and 5.0v ( J2)

Manufacturing

I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ), or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Assembly

Stencil for Assembly

While this board can definitely be assembled completely by hand soldering, I chose to make use of a stencil, from PCBWay. This helps me by ensuring that the solder paste is applied in exactly the correct amount and place. Hot air or reflow soldering afterwards is a quick easy task. I prefer to use a hot plate to reflow the board, especially since it has a tiny USB connector, which can be quite a pain to solder with hot air, I won’t even go there with a normal soldering iron, as it is beyond what my eyes can handle at this stage.

Some more pictures

Breadboard Power Module – Custom designed

Breadboard Power modules are nothing new or exciting at all. I own a few commercial ones, and they are usually quite similar. They can be picked up for a few bucks and usually do what they are supposed to do, providing power to a project on a breadboard.

A common commercial breadboard power module – with quite a bit of wear and tear…


I decided to do my own version of one of these, as there were quite a few irritating flaws on all of the commercial versions that I have purchased over the years.
– They never fit my breadboard – This may seem strange, as I use a standard breadboard, but was never able to buy a power module that was a perfect fit.
– They contain unneeded components, like USB ports that take up a lot of space and a switch that all seem to fail in a very short time.
– The voltage regulators seem to all overheat, even at the minimum required input voltage

This got me to a point where I stopped using them at all, and started thinking about doing my own version. What I came up with, while not pretty, does exactly what I want it to, has decent smoothing capacitors on all power lines,
and does not overheat. I got rid of the switch, the bench power supply has a switch already, and also added LED status indicators for each rail, as well as the main DC power input.

The overheating problem was solved by giving the voltage regulators a big copper PCB heatsink each, which is many times the size of the actual regulator.
That change, having used the same technique on many other PCBs before, immediately got rid of the heat issue, even at a 15v DC input, which is right at the maximum input voltage allowed.

The Custom designed Breadboard power module is however not perfect yet. on the cosmetic side, it is still not exactly symmetrical, with some weird irregular shapes on the PCB. This will be fixed in future, but for now, I am quite happy with its performance, which is actually all that I really care about.

The Schematic

Schematic

This is the schematic, which is straightforward, with nothing complicated.
Two Low Dropout Voltage Regulators, AMS1117-3.3 and AMS1117-5.0 are individually fed from a 7-12v DC supply, with jumper selectable outputs of 3.3v or 5.0v on each of the Power rails. Led Indicators on each regulator output, as well as on the power rail outputs.

Smoothing capacitors are placed on the inputs and outputs of each regulator.

PCB Layout

The resulting PCB is a two-layer board, with most power tracks routed on the top layer where possible. A solid (bottom) and hashed (top) ground plane ensures a proper ground connection. Big copper pours on the output of the regulators serves as PCB heatsinks, reducing the amount of heat generated quite significantly.

PCB Top – Rendered
PCB Bottom – Rendered

Manufacturing

I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ), or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Some more Pictures

Breaking out of the Chip Shortage – Attempt #3

The ATMEGA4808 provides a very attractive solution to replace the trusted ATMEGA328 or standard Arduino UNO /NANO.

These chips are slightly more difficult to get hold of than the ATTiny chips, and cost a little bit more ( about the same as what the ATMEGA328 used to cost before the mess with COVID-19 and resulting supply chain shortages + inflated costs), but they offer all of the functions of the ATMEGA328, with a few other enhancements that will definitely be very useful.

The extras include:
– Hardware interrupts on ALL GPIO pins; This is way more than the standard 2 interrupts on the ATMEGA328 ( We are not talking about the Pin Change interrupts, but real hardware interrupts, that can be triggered on RISING, FALLING, CHANGE, HIGH and LOW state of each pin

– Up to eight (8) PWM pins as opposed to the 6 on the Arduino UNO
– Up to eleven Analog inputs
– An Analog Comparator module
– Configurable Custom Logic (CCL)
– EVENT System (EVSYS)
– Peripheral pin swapping

It is also worth mentioning that these chips have accurate internal oscillators, capable of clocking the chip at up to 20MHz, further reducing the number of external components required to get a minimal configuration running…

Order your own version of this development board

The Prototype PCB

While I have had a Nano Every “Clone” lying in a drawer for quite a while now, I did not really pay a lot of attention to it. That was, until I needed an ATMEGA328 for a project, and could not find any for sale, or at least at a price that I was willing to pay for it… That incident was the spark that ignited this entire exercise, to find a suitable replacement…

The Nano Every “Clone” in my possession, used the ATMEGA 4808 chip and turned out to be the Thinary Nano 4808. I had quite a lot of problems with the provided core, as well as getting peripherals like I2c and SPI to work. This led to further investigations, and finally, I decided on building my own and to use the MCUdude/MegaCoreX Arduino Core to program it.

This led to the following prototype:

ATMEGA4808 Development board prototype

I did not bother with too much detail on the silk screen here, as the goal was to get a working board, test it, and then later, design a refined PCB.

What is important to note is that the board runs at 5v, but provides a single 3.3v output as well. Logic levels on the GPIO is also 5v. Use level converters for 3.3v only addons…

The MEGA4808 is programmed via UPDI, so we have a UPDI Header on the right-hand side of the PCB. It is also possible to use the Optiboot Bootloader, to flash the board in true Arduino style through a USB connection to a computer.

A CH340N USB-to-Serial converter chip is used instead of the CH340G that is common on the UNO clones. The CH340N provides only the USB D+ D- signals, as well as Rx, TX and RTS. RTS is being used to auto-reset the chip after flashing…

In comparison to the CH340G, which also required a crystal oscillator, but provides all the modem control signals, which, are usually not even broken out, the CH340N made much more sense.

PCB Bottom.

A power LED, as well as an indicator LED on pin 7 was also included.

Assembled PCB, Top Layer.

Assembly and Soldering

I normally assemble all my projects by hand and reflow-solder them with a hot plate. for this project, I decided to do things a bit differently, which ended up being a bit awkward, but still resulted in a perfectly useable PBC.

As you will know by now, I only do written articles, as I don’t consider myself ready for the Youtube and video thing, as well as because I believe a well-written article, with detailed pictures, is easier to understand than a video…

Well, today, we will have both… This article, with its writeups and pictures, as well as a short assembly and soldering video, with no sound, sped up 5x, as I did not want to bore anyone with a 25-minute silent video…

Let us begin then…

PCB and Stencil

We start with a blank PCB and the laser-cut stainless steel stencil that I got from PCBWay.

Solder paste applied

Solder paste is then applied with the stencil and a scraper, and afterwards, the stencil is removed… The PCB is now ready for component placement…

From here on, we will go to the video footage… showing component placement, with some awkwardness due to the camera being in the way, as well as hot-air soldering, with the same awkwardness, as I was forced to use my right hand ( I am left-handed), not to block the camera view…

Begin quite new to the video thing, I have also not quite figured out the editing software, so the video is in native resolution… not zoomed…

After assembly

After assembly, I checked for solder bridges and was quite happy that there were none. This also meant that the board worked perfectly the first time around… as it should…

Order your own version of this development board

Manufacturing

I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ) , or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Picture Gallery

Breaking out of the Chip Shortage – Attempt #2

The ATTiny1616 is a step up from the ATTiny202, having more GPIO, flash and RAM. This makes it ideal for bigger, but still medium size projects that do not need all the power of the traditional Arduino.

In Part 1 of this series, I took a quick look at the ATTiny202 MCU from Microchip. Having only 5 useable GPIO, with limited Flash and Ram, that little chip was still quite useful for some of those very small projects, where we did not really need a lot of peripherals and GPIO pins.

Today, we shall take a step up, and take look at a slightly bigger MCU, the ATTiny1616, this time with up to 17 GPIO pins, more flash and memory, and still quite easy and cheap to get hold of. (Current Prices are in the range of about $1USD to $2USD, depending on where you buy and how many you buy).

As I wanted to give myself a bit of a challenge with this project, I decided on using a QFN package this time, which, being extremely tiny, only 3mmx3mm, will give most Makers a pleasant challenge to solder correctly. ( I am planning a SOIC 20 version, but with a bit more external hardware onboard)

MakerIoT2020 ATTiny1616 Minimal Breadboard-friendly breakout

The ATTiny 1616 is part of the tinyAVR-1 series, which includes the 1614,1616, and 1617, and they have the following features ( copied from the datasheet link above)

The ATtiny1614/1616/1617 are members of the tinyAVR® 1-series of microcontrollers, using the AVR® processor with hardware multiplier, running at up to 20 MHz, with 16 KB Flash, 2 KB of SRAM, and 256 bytes of EEPROM in a 14-,20- and 24-pin package. The tinyAVR® 1-series uses the latest technologies with a flexible, low-power architecture, including Event System, accurate analog features, and Core Independent Peripherals (CIPs). Capacitive touch interfaces with Driven Shield+ and Boost Mode technologies are supported with the integrated Peripheral Touch Controller (PTC).

ATTiny 1616 Breakout – Bottom view

The PCB – Minimal working configuration – with a few extras

The PCB break-out all 18 of the GPIO pins, while it is only recommended to use 17 of them, unless, like in the case of the ATTiny202, you have access to an HV UPDI programmer. It also becomes possible, although still being quite tedious and awkward, to use the OptiBoot Bootloader on this chip, although it is still not quite recommended. Just using a UPDI programmer, with a separate USB-to-Serial adapter on another port is still definitely the easiest.

The Board contains an LED, on PIN_PA4, Arduino Pin 16, as well as onboard I2C pull-up resistors, selectable via a jumper. It is important to note that the current version DOES NOT contain a voltage regulator on the PCB. It is up to you to provide a regulated voltage source, in the range of 1.8v to 5.5v DC

It is recommended to clock the Chip at 16MHz when running at 5v ( 20Mhz is possible, But I did not bother to test that yet)
8Mhz when running at 3.3v
0-5Mhz when running at 1.8v

See the Datasheet, as well as the megaTinyCore documentation for exact details on this.

Commonly used peripherals, by myself, are listed on the back of the PCB for easy reference.

Order your own version here.

Programming the board

Programming is possible with Arduino IDE (and platformIO, ( I didn’t test that, as I find VS-Code tedious to use ), as well as MPLab from Microchip.
For the Arduino IDE, you have to install the megaTinyCore Arduino Core, as already mentioned above. ( This also apparently works for PlatformIO)

Full instructions, as well as some very useful other tips and information, is available in the core documentation, so do put in the effort to actually read the documentation. You won’t be sorry that you did.

The Schematic

Schematic

Design and Assembly

PCB layout

The board is designed as a double-layer PCB, with ground planes on both sides.

Due to the MCU package having a QFN footprint, using a proper SMD stencil is strongly recommended.

SMD Stencil – Make things a bit easier.

Hot-Air or a hotplate will also be quite useful to ensure success with this project. Passive components can be hand soldered though.

Manufacturing

I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ) , or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Picture Gallery

Small and Cheap UPDI Programmer

UPDI programmers are a new necessity in my lab, as I continue my quest to find a suitable replacement for the old Atmega328P chips (More on that in another post). In a previous post, I showed you a combination UART/UPDI programmer module that I have recently designed. It would only be fair to show you where that started out, as a single-purpose UPDI programmer, based on the CH340N.

The CH340N has, according to me at least, some advantages over the CH340G in the sense that it requires very few external components, most notably that it doesn’t require an external crystal oscillator. It does however NOT provide you with all the Modem signal lines (RTS, DTS, DTR, CTS etc) that you get on the CH340G, although most people will not use most of those anyway…

The cost of the two chips is about the same, with the CH340N being slightly more available at the moment, at least in my part of the world.

The particular circuit that I am using originated from Stefan Wagner. I simply designed my own PCB around his circuit. Credit is given where it is due, as I found his site, and content extremely detailed and accurate.

While this is a serial UPDI programmer, with NO HV capability, I do find it extremely useful as a test project, and while I may invest in a proper HV UPDI programmer in the future, if the bigger part of the project plays out the way I anticipate, for the time being, this is exactly what I need.

Order your own here

What is on the PCB?

3D Render of the UPDI Programmer

The PCB is quite small, with a low component count, 6 capacitors, 4 of which is smoothing capacitors, two resistors, one Power on LED indicator, a 3.3v voltage regulator, USB connector ( Type B Mini) and of course the CH340N and a few header pins, one of which is used as a target voltage selector by means of a jumper. I did not bother with a switch as this pushes the cost of the device up by quite a bit.

Current costs for the components are around 5USD excl shipping at LCSC.

So, J1 is used to select the target voltage between 3.3v and 5v.
The other header provides VCC ( marked V+), GND and the UPDI output.

The Schematic

Schematic

Manufacturing

As many of my existing readers will know by now, I choose PCBWay for my PCB manufacturing. Why? What makes them different from the rest?

PCBWay‘s business goal is to be the most professional PCB manufacturer for prototyping and low-volume production work in the world. With more than a decade in the business, they are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness and any other demanding requests. As one of the most experienced PCB manufacturers and SMT Assemblers in China, they pride themselves to be our (the Makers) best business partners, as well as good friends in every aspect of our PCB manufacturing needs. They strive to make our R&D work easy and hassle-free.

How do they do that?

PCBWay is NOT a broker. That means that they do all manufacturing and assembly themselves, cutting out all the middlemen, and saving us money.

PCBWay’s online quoting system gives a very detailed and accurate picture of all costs upfront, including components and assembly costs. This saves a lot of time and hassle.

PCBWay gives you one-on-one customer support, that answers you in 5 minutes ( from the Website chat ) , or by email within a few hours ( from your personal account manager). Issues are really resolved very quickly, not that there are many anyway, but, as we are all human, it is nice to know that when a gremlin rears its head, you have someone to talk to that will do his/her best to resolve your issue as soon as possible.

Find out more here

Pictures of the PCB and Assembled Module

Assembly

I assemble all of my projects by hand, using hot air and or a hotplate for reflowing. Having an accurate stencil for applying just the right amount of solder paste becomes a necessity very quickly.
In future, I plan to have a dedicated section showing the assembly of some of the more challenging boards…

Multipurpose USB UART Module

USB-to-Serial converters are some of the most used modules on my bench. I have quite a few of them, most of them are the cheap online type that can be had for a few dollars.

As part of my new project, where I am seriously looking for an alternative chip to replace the ATMEGA328, which has become almost impossible to get, and super expensive when you do get it, I needed to get hold of a UPDI programmer.

There are many available online, from cheap to more expensive, but I wanted to build my own, as it did not seem too difficult to do.

As another part of my daily tasks, I also use a lot of ESP-type chips, which have a particular procedure to upload code via an external serial adapter.

The idea was thus to design a USB UART module that has multiple purposes, as well as being easy and cheap to assemble.

  • Be able to program ATMEGA328 Chips via Serial
  • Be able to be used as a standard USB-to-UART adapter
  • Be a UPDI programmer
  • Have a selectable target voltage between 3.3v and 5v
  • Have all modem signals (RTS, CTS, DSR, DTR) broken out.
  • Be able to auto-flash and reset an ESP32 or ESP8266 device, or similar
Breadboard Prototype Multipurpose USB-to-UART/UPDI Programmer

What is on the PCB?

The PCB is powered by the PC USB port. The target device voltage is selectable between 3.3v and 5v. The device mode can be changed from UART to UPDI mode with a jumper. An additional header specifically for ESP32/ESP8266 devices is provided, giving access to the FLASH and reset signals for the ESP device.

The USB to serial conversion is taken care of by a CH340G Chip, which provides all the relevant modem signals as well.

All signals, with the exception of the “RING” signal, are broken out onto the main header.

Note that there are NO status or POWER LEDs on the board. This was on purpose, as these sometimes interfere with the UPDI programming mode.

Prototype PCB – Assembled

PCB – Top
PCB – Bottom

Connecting to different devices

ESP32 or ESP8266 Devices

When in UART mode, the device can be used to upload code to an ESP32/ESP8266 automatically, similar to a standard dev board, without requiring you to press and flash and reset buttons.

This is achieved by connecting the device as follows:

UART MODULE SET to 3v
UART VCC to ESP 3v
UART GND to ESP GND
UART RX to ESP TX
UART TX to ESP RX

(Connections for Auto Upload/Reset)
UART RST ( on ESP-Flash Header) to ESP RST
UART GPIO0 ( on ESP-Flash Header) to ESP GPIO0

It will now be possible to flash and auto reset the connected ESP device from the Arduino IDE, and possibly others as well…

Arduino (Atmega 328P)

In the current version of the prototype, you have to connect it as follows:

UART Target voltage set to 3v or 5v depending on what type of board you are uploading

UART Tx to Arduino Rx
UART Rx to Arduino Tx
UART VCC to Arduino 3v or 5v ( depending on the target voltage required by the board you are flashing)
UART GND to Arduino GND

To allow for auto flash/reset on the Arduino, a 100nf capacitor is required between the UART DTR line and the Arduino Reset pin. This capacitor has NOT yet been fitted onto the PCB, as I usually use ICSP to upload these. Future versions of the PCB shall have this included.

ATMEGA4808/4809 and or ATTiny with UPDI Interface

This device is currently an LV-only UPDI programmer. Connections are as follows:

Set Target voltage on J1 of the UART/UPDI programmer.
Set The Device mode on J2 to UPDI mode

Connect VCC and GND from the Programmer to the target chip/board
Connect Programmer UPDI pin( shared with RxD) to Target UPDI pin.

General use UART for use as Serial monitor/Terminal

Set target voltage on J1
Set device mode to UART on J2

Connect VCC, GND from UART to the target device,
UART Tx to Target Rx
Uart Rx to Target Tx

Optionally connect required modem signals, RTS, CTS, DTR, and DSR as needed

Manufacturing

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

Some Links to things used in the project

MakerIoT SMD Prototyping Breadboard
Order this PCB from PCBWay

A Soft Start Circuit Experiment

Every single project that we build needs an On/Off switch. Hardware switches are big and clumsy and can be quite expensive. Most of them also don’t look very good.

This post will be about an experiment that I recently performed, building a reliable soft start circuit, or latching circuit.

Full disclosure: I did not design this circuit. Full credit to the designer, who shall be mentioned later.

As such, This shall be about my experiences with this great little circuit, and also to show off the neat little prototype PCB that I designed and had manufactured for this experiment. It only took a few minutes to design, and even less to assemble.

The Schematic

Schematic

How does it work?

To answer this, let us look at what components are in the circuit first.
Q1 is a P-Channel Mosfet. I chose the SI2301, because that is what I had lying around.
T1 and T2 are NPN BJT transistors, I chose S8050’s here, and also tested 2n2222a’s with great success.
Other components are 3 100k pullup resistors, 1 1M pullup and an 1k dropper resistor for the indicator LED.

In the off state, R1 (100k) keeps the gate of Q1 tied to the supply voltage, thus keeping the MOSFET switched off.
T1’s collector, also connected to the MOSFET Gate, are thus pulled High, with the Base of T1, although pulled High, connected to the Drain of Q1.

Q1 is still off, so that base will be low, for now at least.

The collector of T2, is pulled up to the supply voltage via R4, and also, through the push button, to the base of T1.

The base of T2, is pulled up via a 1M resistor to the drain of Q1, and a 22uf to 47uf electrolytic capacitor to ground.

The emitters of both T1 and T2 are grounded.

When you press the switch, the base of T1 goes high, and this switches T1 on, pulling the gate of Q1 to ground, switching it on. This now pulls the base of T1 high through R2, latching it on, and keeping Q1 switched on. This also pulls the base of T2 high through R3. As T2 is now also switched on, the junction between the collector of T2 and the switch is now for all purposes a ground.

Now, when you push the switch again, the base of T1 is pulled down to ground via T2. This switched off Q1. As the capacitor on the base of T2 can now discharge, the circuit is reset, and the next press of the switch will turn it on again.

How big a load can be switched?

Obviously this depends on the rating of the MOSFET at Q1. In my experiments, a load of about 150mA was easily controlled, but more than that, started to somehow drain the cap at C1 too fast, and the circuit would reset.

This is not a problem to me, as the circuit is ideal to switch a relay, which in return can switch the main load.

What other issues did I encounter?

The SI2301 seems to have a small amount of leakage, which allowed a few millivolts to activate T1 or T2. I solved that with the addition of a 10k pulldown to ground, on the base of T1.

This does not seem to be the case with other MOSFETS, and I believe changing the value of R1 to provide a stronger pullup, might solve this issue.

Where does the circuit come from?

I found the circuit, and explanation on the excellent Youtube channel EEVBlog.
The owner, Dave, does an excellent job of explaining how this works. All credit to Dave for this excellent circuit!

It has zero current consumption in the off-state, and very little when on.

Manufacturing

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

Conclusion

I believe this is a great little circuit to keep around, with many excellent use scenarios. It does need a bit of fiddling to get to work perfectly every time ( as you can use many different P Channel Mosfets and NPN BJT transistors)

It provides an excellent alternative to a mechanical switch, and for my own use, the PCB Module is small enough to be mounted into an enclosure with another project with ease.

8Ch NMOS Breakout Module

As a companion module to my recently published 8Ch PMOD breakout board,
I decided to do a similar PCB, but with NMOS devices instead. This opens up more possibilities for proper testing and prototyping, as PMOS and NMOS devices has different use applications, and most importantly, can sometimes even be combined for a particular purpose, like an H-Bridge motor driver, for example.

8Ch NMOS Breakout

What is on the PCB?

As NMOS devices function quite differently from their PMOS counterparts, it did not make sense to reuse the PMOS board, and just change the devices… although some people may be tempted to think you could…

The N Channel Mosfet basically “works in mirrored mode” from a P Channel one, and is used to do so-called ” LOW Side switching” which means that your load connects to the positive power rail, and then to the DRAIN pin of the MOSFET, with the source being connected to ground… ( It can sometimes also be used the other way around… but lets not go there now….

The current prototype PCB contains 8 BSS138 NMOS Mosfets, in my case, with is capable of about 800mA of current… All source pins are internally connected to ground. This forces you to use this module as a low side switch…

Two 10-way 2.54mm headers are provided, with a ground pin on Pin 1 and 10 of each of these.

The Drain pins of each NMOS device is available on the top header, labeled D1 through D8, and the Gate pins of each respective NMOS device is available on the bottom header, labelled G1 through G8.

Each gate has a pull-down resistor to ground, to keep it from flapping around, as well as a gate resistor. In my case, I selected to use a 10k pulldown, and a 1k gate resistor, as that is sufficient for my general needs…

Each NMOS device also has a LED signal indicator, to assist in visual confirmation of a specific channel’s state.

PCB Top Side

The Schematic

Schematic

Using the breakout

The module is very easy to use, and as briefly mentioned above, you are only required to connect one side of your load to the positive supply rail, and the other side to the drain pin of your choice.

Connect the ground pins of the module to your ground rail.

The Gate pin, with a corresponding number to the drain you have selected, can now be connected to your GPIO of choice on a microcontroller.

Drive the pin High to switch on the load, drive it log to switch off. Easy.

Please note: While the NMOS devices used on the board can handle quite a lot of current, (800mA in the case of the BSS138), it is not recommended to try and pull too much current through a single channel. The PCB traces can safely handle about a maximum of 300 to 400mA per channel.

PCB Bottom

Manufacturing

The PCB for this project has been manufactured at PCBWay.
Please consider supporting them if you would like your own copy of this PCB, or if you have any PCB of your own that you need to have manufactured.

PCBWay

Example code for using the breakout (Arduino)

// Example code for 8Ch NMOS breakout
int Gate1 9;
int Gate2 10;

void setup() {
  // drive the two gate pins low to ensure NMOS devices
  // are in a positively known state at startup
  digitalWrite(Gate1,LOW);
  digitalWrite(Gate2,LOW);
  // Set gpio to output mode
  pinMode(Gate1,OUTPUT);
  pinMode(Gate2,OUTPUT);

}

void loop() {
  // Toggle the two channels in an alternating pattern
  digitalWrite(Gate1,!digitalRead(Gate1));
  digitalWrite(Gate2,!digitalRead(Gate1));
  delay(1000);  

}