I'm working on a thermal regulator for a greenhouse. My device will use ATtiny2313A as uC and DS18B20 as thermal sensor. I also use 1602 LCD display to monitor current temperature and set low and high limits for the heater system.
I want to be able to drive heater load for about 2kW (I'm from Russia so in my 230VAC line it will be about 10 amps). I use relay 507-1AH-F-C to commutate heater load. Actually I will break the Live line (which also have the fuse 10A @ 250VAC) while Neutral line will stay connected. As I understood from datasheet this relay can handle 12A @ 250VAC so things look pretty good to me. Coil voltage is 5VDC and I use KSP44 transistor in switch mode to handle such a heavy load (about 106 uA) by uC.
When I was in developing phase, I used breadboard to debug firmware for ATtiny2313A. During test phase, I was able to see some strange glitches such as random restarts of uC or even EEPROM corruption (see the discussion here). I've measured some voltages and discovered that display backlight and relay coil causes serious voltage drop on breadboard rails (about 0.2 volts).
Because of this I decided to make two power sources, which are built on LM7805CT linear regulators. One LM7805 is mounted on the heatsink and supplies power exclusively for relay coil and LCD backlight. The second LM7805 supplies power only to the DS18B20 and ATtiny2313A. Somewhere in the Internet I read that using two linear regulators in such manner is a bad idea.
So because this is my first full-cycle (schematics developing, PCB routing etc) project, I want to learn as much as possible and avoid potential pitfalls. Here I attached the schematics, routed PCB and 3D models of it. I would be very grateful if anyone from the community would tell me some useful advice or point to my errors. I'm only a beginner and want to dive into the world of electrical engineering.
There are main questions of the greatest importance to me:
Is it bad practice to use two or more LM7805s in parallel? In my case they have common grounds. Generally I have solid ground planes on the both sides of PCB.
I use transistor in switch mode. For my calculations I assumed that hFE = 20, Base-Emitter voltage drop is 0.8 volts and Vout for ATtiny2313A is 4.2 volts. I think that it will be OK that collector current is about 150 uA (although relay coil consumes 106 uA) so my math for base resistor is:
(4.2 - 0.8) / 0.150 * 20 = 453 ohm
I took 680 ohm for my R2 value. Is there any miscalculations in that scheme? Also I wonder if there will be any pitfalls because collector is powered from +5V line (the first LM7805) while base is driven by VCC line (the second LM7805)?
How can I efficiently find and understand ground loops? I tried to separate logic and power parts of my scheme and use solid ground zones, but I am concerned if any loops still exist.
Is my variant of snubber for relay good? Or are there improvements which could be introduced? I've read Application Note which stated that this variant should work well, but I want to know real user experiences.