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.

20160213_163527

20160213_162748

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.

20160301_222530

Ta daaaaaaa!

20160301_222743

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.

20160213_163307

20160213_162914

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

Intro

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.

LM317_schematic

Tests

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.

comparison_table_large

  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

 Conclusions

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.

20151130_224543

20151130_232821

 

20151130_232816

 

Bad wires

Ready made jumper wires are popular for making prototypes and even using them permanently in projects. For me, these are some of the things that come from the various far away eBay sellers(or similar stores), as they are very cheap. The same cheap wires can be bought for more money from various local shops, who are reselling them.

However, recently I have bought a set from one of the big component suppliers, because I needed them in a day, not a month. This, of course, came with the penalty of paying about 4 times more for a set.

The difference in feel is huge: the expensive ones are much thinner and more flexible and seem to lack any bad plastic smells. Next, I measured the electrical resistance including the contact with a pin header, and the picture says it all. On the left, the cheap version is around 0.53Ω, while the good one is 0.09Ω, more than 5 times better. Or, to put it from my experience: I expected about 0.1Ω, which makes the cheap ones 5 times worse. 

bad_wires_drawingThis means you should pay attention whenever powering anything that draws a little more current. Using 2 of the bad wires for a power supply get you over 1Ω or resistance. I have experienced this with various modules, like motor controls or even radios such as the ESP8266 or the NRF24L01 with PA: drawing some 300mA causes about 0.3V drop on the power supply.

But it is not the absolute drop in the power supply that causes problems, it is the internal reset circuit that can cause a reset whenever the power supply suddenly drops by that much. This is why adding a large electrolytic capacitor near the device solves the problem.

What should you do? Depends on the application. The cheap ones are definitely adequate for most things and the price is better. However, the expensive wires will give you a lot less headaches.