Hello!
I'm pretty new to designing circuits, and am working on a project to keep a tank of water filled between the level of two sensors; a min and max level scenario. I have an extensive software engineering background and put together a pretty simple arduino project to do this, but then decided I wanted something a bit simpler, a bit less overkill, and something also where I could learn a few new things. So, I decided to ditch the arduino and design something a bit lower level. I'm hoping someone here could give this a once over and provide a friendly critique of what I'm working on. I've attached the KiCad schema as an attachment.
With that said, here's what I've been thinking:
The system is based on two optical liquid level sensors, one installed near the bottom of my tank, and one near the top. Both output 0V when exposed to liquid and in my case 5V when exposed to air. I'm looking to keep the water level in between those two sensors, without dropping below the lower, or filling higher than the top by using a solenoid controlled brass liquid valve. Since this is water, and it's in my basement, I'm also concerned about overfilling and flooding my basement, so I've installed a mechanical float valve on the inside of the tank that can mechanically shut the water supply off if it reaches the actual top of the tank (near enough). My experience with these floats is that they are far from perfect and at least the two that I've tried have had leaks that caused them to fill faster than the water is used, causing a small water disaster. All of this is then connected to the utility water connection in the basement for its water supply.
On the circuit side of things I'm powering this with 12V. I've then got an LM7805C regulator stepping down to 5V for the logic level portion of things. From there I went for a simple NOR gate SR latch based on the SN74LS02 to handle the logic processing of the sensor output. The LOW sensor is attached to the SET of the latch and the HIGH sensor is attached to the RESET of the latch. From there I've got two LED's connected to the outputs of the latch as indicators. Pretty simple so far, and testing in a cup of water on my bench seems to work great. However, this is where I start having a few questions...
My hope is to use the 12V power supply to power the solenoid for the brass valve. At 12V it's sheet says it will draw 3A. So, based on some other recommendations I've gotten I built a MOSFET into my circuit. I've got the output of my latch going to the GATE of my MOSFET, a 10k pull-down resistor between GATE and SOURCE and I've got a 1N4001 kickback diode in parallel with the solenoid to protect the MOSFET.
With my, hopefully decent explanation, I'm hoping to get some feedback on a couple things:
- Is the way I have the MOSFET included in this circuit the right way to do it? I was unsure if the diode would go in parallel or series with the load of the solenoid.
- I'm not entirely sure how to calculate the heat dissipation for this circuit and this MOSFET to determine if I'll need a heatsink.
- I'd like to add some headers to this that could be wired up to a microcontroller for monitoring. I have another microcontroller in the basement that does some climate monitoring (it's a woodworking shop), and I think it would be interesting to catch a notification when the tank is filling. I'm just not sure of the best way to do this, would I just connect a header at the output of the latch and monitor it with the microcontroller?
- Generally speaking, I'd love a critique of the design. I'm SUUUUUPER new to designing circuits, and this is my first project using KiCad, so I'm not sure what I could be doing better both in the design of the schematic and the circuit itself.
- Ultimately I'd like to make a PCB for this. For this type of circuit, any tips or pointers you might have?
This has been a really fun project for me to learn on, and I get something useful for my workshop, so it's a double win. I know I have a lot of questions, and I'm grateful for your time reading all this.