A project out of frustration. A hardware solution to bad software…

[Project complete......but check in a few months for performance reporting]

Also available at

auto resetter electrobob


AutoResetRRR is a kind electronic frustration reducing device: it cuts the power periodically to devices that can go nuts (routers, net cams, servers), but it does give a heads up. If all is well, they can shut down safely and start back up. If not, the power cycle can fix a thing or two.

I have a raspberry pi time-lapse rig that sometimes hangs. And a few simple IP cameras also used for time lapse, all a bit inaccessible. And my modem/router that comes from the ISP gets the “slow internet syndrome” every now and then.

They should have good software, but they don’t. I cannot change the software in most devices to tell it to restart periodically, unlike my openwrt stuff. So I have fix this in HW by cutting the power with the AutoResetRRR.

Oh, and it allows devices like the RasPi to have a soft shut-down button like you expect from any PC.

What it is

A small devices that you place between the power adapter and your device. I works with most supplies from 5V to 35V, and can switch over 3A, so practically any device you might find in your home. From time to time, say once a day, it cuts the power to that device for a few seconds, forcing it to reboot. For devices that can use this, such as a raspberry pi, a separate pin can warn a little ahead of the coming restart and allow for safe shutdown.

As or the bells and whistles, especially for the raspberry pi, there is a possibility to shut down the power permanently by pulling a pin low.

Why it is not? Or the things I thought about before

A 555: because it’s difficult and requires bulky components for such low duty cycle, plus it is hard to get long durations or a pre warning.

A programmable of the shelf timer: it’s not possible to get a pre shutdown warning with it. Plus, I need quite a few of them, which makes my solution more cost effective.

ESP8266 based: mostly, too much current. A lot of the devices I have don’t have the margins to support the peak 250mA from their power supplies. Plus, so far quite a few of my ESPs have died after just months of operation.

Just a way to press the reset switch: it’s too much effort to get inside most devices.

A super complicated device with touch screen, configurations and bells and whistles: I want something simple that can have a high reliability and needs little time to design.

The proto

This is the first device I made on a bread board, but the PCBs are already mostly designed. So far the software is incomplete, but the reset time-out is working. The blue LED is the one that will blink, while the green one simulates the device.



Schematic and PCB

I finished the board and sent it to the fab. Schematic and PCB rendering below. Files are available at  GitHub along with the firmware and raspberry pi software. The usual 5V regulator with fool proof diode ensures a good 5V supply for the ATTiny13 micro, up to 35V input. There are no worries for powering the device from 5V directly, at the low current consumption it will get about 4V, enough for proper operation. But of course, you can totally skip the regulator in case of a 5V supply. A IRLL2705 logic level NMOS takes care of switching the load. And the brain is a small 1k of flash micro, the ATTiny13.

Your typical LED insures a nice blinky to tell you everything is working. The same output is going to intelligent loads like the Raspberry Pi: 2 minutes  before the reset the LED will stay constantly on, to tell it to shut down. The same pin is used bidirectionally: if the load will pull it to ground, that is a sign that it should be powered off soon, so the AutoResetRRR will cut the power after a delay.


auto resetter boardPCBs arrived

I made the PCBs at Elecrow, and due to the small size they sent quite a few extras. Time to get soldering




First one assembled

The first device skips the 5V regulator, as I am testing it with a raspberry pi. Everything is red, even the LED. I began to test it for the raspberrry pi as this needs the additional python software required to shut-down the pi safely. I am thinking to implement the functionality of a power button as well, will be a simple one, since the Pi does not have such functionality.

DSC_5624To contact the side ISP connector I use a home made PCB with a simple 90 degrees connector with pins slightly bent


And brief tests with the Pi, shutdown during the warning time works smoothly.



Parts are here and…

It appears I have accidentally ordered the wide version of the SO8 package for the tiny13. It has been 5 years 0 days since the last wrong part purchase. The pitch is the same, so I will probably get around this by bending them.

DSC_5640Mini assembly run

I have assembled 6 more devices, for a total of 8. Collecting the parts, assembling them and programming the 6 took slightly less than 1 hour, that is 10 minutes for each device. Not bad.

DSC_5659Notice the 2 ways to connect the power, supported by the PCB: using terminal blocks or DC jack. Of course, any combination of the 2 is possible. I prefer terminal blocks for all the devices that are out of warranty and I can cut the cord to as this allows for a more optimal placement, such as at the middle of the cable.


And finally, some tests with the most relevant type of device: the router. Disclaimer: this is not the router it will be used for, fortunately this can run OpenWrt.


Camera installation coming soon… and possibly a 3d printed case, although i have some project cases that fit the device nicely and that is a faster way to get things done.

Project is now complete: will report in a few months with the performance of the device!

Mini ikea molgan hack

This does not deserve so much attention, but here it is. I got one of the Ikea Molgan motion sensor lights and thought it is too bright for the application. The light has 5 LEDs inside and the tipical BISS0001 pir IC.



They were bright enough to use a current limiting resistor for each LED(the right way to do it), so there are 2 solutions: increase the resistor for each LED, or just leave a single one ON. I took the lazy way out and cut the trace after the first resistor.


Ta daaaaaaa!


In case you are wondering, the original lamp burns almost 70µA while on standby and almost 100mA while the LEDs are on. This gives you about 1.6 years of standby and 10 hours of light or however you manage to combine it(about 6 months at 5 triggers of 30 seconds per day). With this change the light time is increased to 5X, so about 50 hours.



Too bad they used AAA batteries, AA would have been slightly larger, but with 2.5 times the life.

Digital Power Supply – Part 3: Concept comparison


A long time ago, around 12-13 years, I build one of the classical designs of a laboratory power supply and quickly started thinking about having a digitally controlled one. I got a prototype working in 2012, but made no progress after that, seemed my simple 7805 & LM317 was covering me for most part, so a total lack of motivation presented itself to finish the project. However, suddenly realizing I have wanted this thing build for more than 10 years got the gears working, it has to be finished!

New design

I have improved the previous design by going up for higher speed current sensor (INA225) and faster amplifiers, see Electrobob 2 below. Dropped the current mirrors, since there was no need for more than 30V output. Still, I was not satisfied with the speed. In search for the perfect recipe, I decided to analize the various concepts and make a short summary of performance and lessons learned.

The candidates

I have drawn simplified schematics to explain how each supply works. Some changes were made to the original schematics where needed to reduce the requirement of output capacitance to just 10uF. The results are simulation based, with the exception of Electrobob 1 and Electrobob 2 which were built and measured.

1. My previous design - Electrobob 1. It uses a single supply, no additional negative/floating rails. The positive rail current sensor allows for multiple channels to share a ground. It is designed to scale in voltage and current easily by using current mirrors to control the main transistor. Short circuit response is slowish because the used current amplifier(ZXCT1010) is rather slow. Therefore:

electrobob_1_schematic2. An improved design – Electrobob 2 – keeping the same features as before: went for a faster INA225 current amplifier. The current mirrors are missing, because the faster LM7332 can operate to over 30V. With these design changes and proper compensation, it is 10 times faster to respond to a short circuit compared to Electrobob 1.

electrobob_2_schematic3. The electronics lab design: uses a single secondary, but needs to generate a negative supply for the current op-amp to be able to drive the reference voltage down to 0V. The current shunt is located on the negative rail and both the current and voltage references need to use the output negative as reference, therefore all this current consumption(and the potential microcontroller) will be added to the load current. It is faster than Electrobob 1, but slower than Electrobob 2.

electronics_lab_schematic4. The most CLASSICAL design to make a great power supply, however it requires a symmetrical (Vpos, Vneg) isolated power supply apart from the main Vin. The ground reference is the positive output, and Vref and Iref need to be generated with respect to this one. It is found in a lot of designs and sold by a lot of companies. Provided Vpos/Vneg are clean (easy to do because of low power) it has very good rejection of Vin. Due to the extra supplies, it can have a low drop across the series transistor and can scale easily in voltage.

Classic_schematic5. The simplest design I can think of – SE simple – normally found in many regulators: uses current sensing on the negative rail, so this voltage is fed back in the voltage reference to compensate (R6-7). Vref and Iref are ground references, therefore it avoids extra current through the Shunt as with design 3. Speed depends largely on the speed of the op-amps used. The topology does not need any additional negative supply, provided that the op-amps output can reach ground.

SE_simple_schematic6. Same as 6, but using a PNP to get a low drop effect, just for comparison.

SE_PNP_schematic7. The classical LM317 regulator, along with a current sensor and comparator, to get it working in constant current mode as well. It requires a negative supply, as ADJ needs to be lowered to -1.25V in order to achieve 0V output in short circuit.



The table below measures performance with some simple tests. The simulation included secondary effects such as wire resistance and inductance, capacitor ESR, contact resistance, feedback and source resistance.

The load test is measured with the output set to 5V, a 1A load is connected and disconnected. The Drop voltage and Drop time are measured, when the load is connected. The opposite Peak voltage and Peak time are measured when the load is disconnected. Ideally the voltage should not drop or peak when the load changes, however in practice the peak and drop should be as small and short as possible. Output resistance was measured, but it is not relevant for comparison, it is within the mΩ range for all designs except LM317.

1A load peak and drop

The short circuit test shorts the output and measures the peak current and the time until it drops close to the expected current limit. The current should never peak above the preset limit, however this does not happen because of 2 reasons: the output capacitor will provide some current and the current control loop takes some time to kick in. Depending on the configuration and the type of output transistor, the peak current at short can be rather high.

short  load peak and drop

The PSRR is measured by aplying an AC voltage an the input of the supply and measuring the output, over frequency, as in the example below

PSRR responseResults summary

The table shows the comparison of the discussed models and points out their strengths and weaknesses.The peak current indicates the peak through the pass transistor, while the load current is higher due to the output filter capacitor.


  1. When connecting/disconnecting 1A load.
  2. Is oscillating a bit, dampened in 10-15us
  3. Goes to zero and then comes back up
  4. Using TIP122, caused by high drive capability of LM7332. Can be reduced with extra R+NPN, IRLZ24 – about 60A
  5. Using IRLZ24 MOS, with TIP122, the drop/peak are higher, ~1.4V due to different gains at different currents (BE resistors), but peak currents are lower. Can be dangerous for the output circuit!
  6. compared to main supply input
  7. i don’t know why
  8. Requires separate secondary for +/-5..12V. However, cheap +/-5V 1W isolated DC/DC converters could solve this, like DET01L-05
  9. Using LM358, 5µs with TL3472
  10. Using LM358, 20µs with TL3472


Maybe it is time to revisit the idea of positive rail current sensor and go for a simpler, faster and cheaper approach, even though this might mean breaking the ground with the shunt.

A bit of history

Electrobob 1 was previously tested as V1, and with some updates it turned into V2 which never made it to the tests. Then I did some radical changes and it turned into V3, which was a failure, both as stability but also PCB design. Here it is below trying to split it in 2 boards. DSC_0459

DSC_0462Next came version V4, which is actually Electrobob 2, as presented above. I made a lots of progress with this one:. It fits in a 5×5 PCB without holes, which turned into a 5x7PCB with holes. I made a prototype with a screen and box, to be used with an external power adapter. It has some cool features like temperature protection, OVP and lots of software features.