ATtiny Board for Noisy Power Environments

January 20, 2022
attiny avr-mcu emf pcb power-supply radio-control


I wanted to build an ATtiny carrier board to use as a lighting controller or remote control switch in RC cars, which can have a pretty noisy power environment. The motor generates a lot of back EMF and the motor driver does not contain all of it, especially as the battery responds to sudden acceleration. This is a very simple board with an oversized LC filter before a voltage regulator, followed by a pair of SOIC-8 chips connected over I2C, typically an ATtiny MCU and I2C flash.

The LC filter is huge relative to the board’s current consumption, and the capacitor can supply power the chips briefly, while the inductor reduces initial current draw at the cost of a slight voltage spike on startup. You can see that happen in the CircuitJS simulator. Everything is copiously decoupled and capacitors make up most of the components on the board. The LC filter’s bulk capacitor is a low ESR Panasonic.

On the first version of the board, I made two mistakes: misreading the pinout on the flash chip caused me to flip the I2C lines, and the voltage regulator’s enable pin was tied to its own output. It worked after a pair of small bodges with magnet wire, and I quickly ordered a batch of revised boards from OSH Park. This is a really simple board: one side with mostly 1206 components, but they did a great job and the purple solder mask looks pretty good.

I’m not fully equipped to test power supply noise and rejection thereof, but rigged a small board with two diodes and an NPN transistor to modulate power using one of my signal generators. Connecting a scope to the modulation board’s output and the MCU’s supply pin, then using the math function, shows a pretty significant difference in noise before and after the filter. The occasional spikes caused by the inductance help keep the capacitor charged to a voltage above the regulator’s drop out threshold, and it provides some additional smoothing for the final 5V supply.

In the scope screenshots, trace 3 is the input power after the modulation board and trace 2 is the voltage regulator’s input pin after the filter. Voltage out of the regulator is even smoother, and I was not able to conclusively measure the signal there.

I need to do some more testing on this design. If the current filter turns out to be insufficient, using more than one stage and building an LC ladder would be my next step, but that would require smaller components or a much larger board. I made the board one-sided to make hand soldering easier, but moving the jumpers and pullup resistors to the back side would make it quite a bit smaller. Using a more reasonably-sized SMD inductor would probably be necessary for any kind of ladder.

Parts

Part Value Source
C1 100-180uF Panasonic EEU-FR1V101B, EEU-FS2A151
C2 1uF KEMET C0805C105K8RAC7210
C3 470pF KEMET C0805C471K5RACTU
C4 1uF KEMET C0805C105K8RAC7210
C5 100nF KEMET C1206C104K3RACTU
C6 100nF KEMET C1206C104K3RACTU
C7 see note note 1
L1 100-150uH Wurth Elektronik 744771212, 74477020
R1 10K note 2
R2 4.7k Vishay/Dale CRCW12064K70FKEAC
R3 4.7k Vishay/Dale CRCW12064K70FKEAC
U1 TC1186 Microchip TC1185-5.0VCT713
U2 47L64 Microchip 47L64-I/SN
U3 ATtiny202 Microchip ATTINY202-SSFR

There are a number of other memory chips compatible with the pinout of U2, such as the onsemi CAT24C128 EEPROM.

The exact values of C1 and L1 should be chosen based on the frequency you would like to filter, as they form a low pass LC filter.

Notes:

  1. Some of the memory chips available for U2 require a capacitor to persist data when power is lost
  2. This is a pullup resistor for U2 chips with a write-enable or write-protect pin