Good day folks. I'm working on a small project to control some light fixtures - sounds boring, I know, but I just couldn't find the right product to do the job off-the-shelf, so I figured it's cheaper (and more satisfying) to create something myself which precisely suits my requirements. I'm only going to briefly touch up on the operation of the thing and focus on the power supply design aspects instead.
TL;DR: which are considered some of the "best" practices for protecting a low voltage IC from transients and other electrical disturbances caused by nearby relays and power supplies ?
Details: I based my project on an Arduino Micro. I use it to switch 2 relays in a certain sequence whenever a button is pushed (an I/O pin is pulled low). The project called for some time-based actions as well and I didn't want to bother using an RTC for the Arduino itself because figuring out a way to SET it
after the project's been packed up and tucked away in a corner was going to be......tough at best and annoying at worst, since I didn't account for a display to actually allow you to see what you're setting - that would be another can of worms I wasn't going to deal with - so I ripped the clock module out of a programmable timer switch that's got everything built-in (you can see it in the picture): the programmable clock itself, a display and an open-collector output, so interfacing with it was just a matter of connecting it to one of the I/O pins and writing my code accordingly, so that was the programming taken care of.
This is where the project became slightly more complex than I had originally planned: the clock's backup battery was part of the circuit I pulled it from and my project will get switched on/off from the light switch, along with the lights I'll power it FROM, so the clock would reset each time. I did a bit of brain-storming and came up with a solution: I used an 18650 cell as my backup battery to keep just the clock module alive when the main supply and Arduino are off. In order to charge it when the light switch happens to be on, I use it in conjunction with a
"UPS module" I found for cheap on Ali. When power is on, 5v and "SYS GND" come in from a power adapter and charges the cell an powers the Arduino. When power is removed, the Arduino goes off, but the 18650 cell continues to output voltage via the "UPS" until it reaches the cut-off threshold (I think it's 2.8v). The board switches the negative leg of the load, so that's why I felt the need to clarify the adapter GND (SYS GND) can be separated from the battery GND there.
There was still a catch though: the clock module runs on 3.3v and the battery board does not regulate the output - it spits out whatever the cell voltage happens to be, which can be as high as 4.2v when fully charged. The clock does not like that and acts up if I hit it with more than 4v - I tried it with my bench supply - it locks up or displays random characters. Fortunately, I quickly took care of this issue as well: I dropped an LDO between the battery board and the clock, so no matter what the battery's doing, the clock always gets 2.8v. The LDO is a
DI62062.8. I had to go lower in output voltage to prevent the battery voltage from going below the lowest operating voltage of the LDO. Thankfully the clock is happy to go all the way down to a 2.2v input by my testing, so 2.8v is plenty.
I put the circuit together and it all works, as you can see. It's not the prettiest product out there - sure, but since it's for my own personal use, looks don't matter. Durability does, so I quickly realized it's lacking in fuses and ESD protection. It's going to be located next to a pretty beefy PSU and two relays (visible in the upper-right). I was going to make the relays part of the board, but since they'll be switching 230v at considerably high current, I thought it'd be better to have them as far away from the electronics as possible. It's probably not enough, but still better. Then there's the matter of ESD and such: I figured I should add some TVS diodes to protect both the clock and the Arduino. Not knowing exactly what I need, I looked up through the selection of TVS diodes an electronics website has to offer, but the options for low voltage applications is pretty slim: only a couple of results going all the way down to 3.3v or thereabouts and even then, the clamping voltage is still way up there - 10V and up, which I'm not sure the clock module would tolerate, even if it's a very brief pulse.
Come to think of it, the I/O pin connecting the clock to the Arduino could use some protection too.....maybe.
Just in case, I'm planning on adding F1, F2 and F3, which weren't in the original "design". I was going to make F3 100mA or something small like that, but it's probably superfluous anyway, because unless TVS2 fails dead-short, the fuse would not open in time in case of a spike.
This is where more experienced circuit designers can come in and provide some insight on how to protect input pins and other low-voltage applications like these. Don't be too critical of my circuit - it's fit for purpose
