This project has been in the work for about a month and I'm excited to share it since it finally is in a stage worthy of being presented.
Here it is in its natural environment. Don't mind the wire spaghetti in the background, its a work in progress.
Here's the brains of the operation.
Background:
I have a glass sump that has a 5ish gallon ATO reservoir built in to it. I wanted to have an ATO device that was compact enough to fit in my cabinet and have some space efficiency to it. I originally was going to buy an off the shelf ATO pump and sensor but none looked compact or clean enough for what I knew that I could build on my own. Price was originally a consideration... but being real I could have probably bought an off the shelf ATO system for less than what I put into this. I would say on the order of $100, which for how custom it is I absolutely love it.
Starting with the components:
Pump- The whole project was really built around the little diaphragm pump that I bought from aliexpress. It runs on 3.3v and pumps a steady stream with a little over 1 amp of draw. It's able to top off 4 hours of evaporation in about 1 minute. Roughly... 1 gallon every 5 minutes.
Level Switch- Another aliexpress item, its just a little float switch that closes when the float is up
LEDs- I had these sitting in a box, nothing special here but I'll explain the function of them later
PCB- I designed PCB made from EasyEDA/JLCPCB. Only took one revision to get it right (my bad, not theirs). More explained later
Microcontroller- Along with the theme of compact, I used a Xiao SAMD21 microcontroller which can be programmed by the arduino IDE. It only cost like $5 from digikey and is incredibly small for the functionality it has. I needed a microcontroller because I wanted some delay and error logic built in.
Tubing- Another aliexpress item, cheap and functional silicone tubing
3D printed housing- Designed by me. The blue housing is PLA since it never should touch water. The black piece on the float switch is ASA for water resistance and "reef-safe" characteristics.
Proof of concept:
So this project started with a proof of concept build that used a perfboard and a simple 3.3V linear regulator and MOSFET to control the motor. It worked decently well with a few issues. 1. The linear regulator could only handle the motor for about 90 seconds before it started degrading voltage 2. No failure logic built in. My work around for this was I had it on a smart outlet that cycled on for 1 minute every 4 hours. If it were to fail, I would most likely catch it before anything bad happened. It worked this way for around 3 weeks while I was ironing out the PCB and microcontroller.
PCB:
I'll start by saying that I'm a mechanical engineer by profession, I only tinker in electronics. Designing a PCB is not nearly as hard or as expensive as it may seem. For each of the boards I designed, there was a minimum or of 5 boards, and I paid around $6 for each package. That includes shipping! I highly recommend giving it a try if you have a project that would benefit from a PCB.
Heres a link the PCB schematic and PCB file.
https://oshwlab.com/afarnsworth702/reef_ato
The PCB takes a 12VDC input, converts it down to 3.3V with 2amp capacity then distributes it to 3 MOSFETs controlled by the microcontroller. There are also two switch closure inputs: one for the level switch, and one for a button for resetting from an error state. Another feature you may notice is the 5VDC converter circuit. When I designed the PCB I wasn't sure how the microcontroller would do running directly from the same 3.3V source that the motor is on. So this 5V converter supplies 5V to the VIN of the microcontroller which has an onboard 3.3V regulator. These two voltage sources for the microcontroller are selectable via a solder jumper. Currently I'm running the microcontroller directly off of 3.3V which seems to be working fine but I may convert over to the 5V supply if I run into issues in the future. Also on the board are various capacitors for power regulation, resistors for pull downs and a diode as a motor freewheel diode. Controlling the LEDs with a MOSFETs is probably overkill but I wanted overhead for if I change the outputs in the future or repurpose this PCB for a different project with similar ins/outs.
Main PCB components:
3.3V Converter
MOSFETs
Xiao SAND21
Logic:
The logic is design such that:
1. If the level switch is low (low water level) for greater than 10 seconds turn on motor for not less than 10 seconds
2. If the level switch is low (low water level) for greater than 120 seconds enter error mode
3. Error mode latches to disable motor output and can only be reset via push button (inaccessible from outside the enclosure) or a power cycle
4. LED1 is on when the motor is on. LED1 also flashes when error mode is latched on.
5. LED2 fades in a sine wave as a status indicator that the program is running and not frozen or errored out
This code is all basic arduino code that I could have written... if chatGPT didnt do it 20x faster! Yeah, so this code is all LLM created with a manual review prior to uploading.
Mechanical Design:
The 3D printed enclosure sits on a glass separator. The level switch is on the end of a PVC pipe that has a clamping mechanism in the housing which allows me to make slight tweaks to water level. I have some clips for the silicone tubes and a PCB holder back half.
So anyways, thats my project and I hope you all find it cool! If anyone would like some of these files or more details let me know!
Here it is in its natural environment. Don't mind the wire spaghetti in the background, its a work in progress.
Here's the brains of the operation.
Background:
I have a glass sump that has a 5ish gallon ATO reservoir built in to it. I wanted to have an ATO device that was compact enough to fit in my cabinet and have some space efficiency to it. I originally was going to buy an off the shelf ATO pump and sensor but none looked compact or clean enough for what I knew that I could build on my own. Price was originally a consideration... but being real I could have probably bought an off the shelf ATO system for less than what I put into this. I would say on the order of $100, which for how custom it is I absolutely love it.
Starting with the components:
Pump- The whole project was really built around the little diaphragm pump that I bought from aliexpress. It runs on 3.3v and pumps a steady stream with a little over 1 amp of draw. It's able to top off 4 hours of evaporation in about 1 minute. Roughly... 1 gallon every 5 minutes.
Level Switch- Another aliexpress item, its just a little float switch that closes when the float is up
LEDs- I had these sitting in a box, nothing special here but I'll explain the function of them later
PCB- I designed PCB made from EasyEDA/JLCPCB. Only took one revision to get it right (my bad, not theirs). More explained later
Microcontroller- Along with the theme of compact, I used a Xiao SAMD21 microcontroller which can be programmed by the arduino IDE. It only cost like $5 from digikey and is incredibly small for the functionality it has. I needed a microcontroller because I wanted some delay and error logic built in.
Tubing- Another aliexpress item, cheap and functional silicone tubing
3D printed housing- Designed by me. The blue housing is PLA since it never should touch water. The black piece on the float switch is ASA for water resistance and "reef-safe" characteristics.
Proof of concept:
So this project started with a proof of concept build that used a perfboard and a simple 3.3V linear regulator and MOSFET to control the motor. It worked decently well with a few issues. 1. The linear regulator could only handle the motor for about 90 seconds before it started degrading voltage 2. No failure logic built in. My work around for this was I had it on a smart outlet that cycled on for 1 minute every 4 hours. If it were to fail, I would most likely catch it before anything bad happened. It worked this way for around 3 weeks while I was ironing out the PCB and microcontroller.
PCB:
I'll start by saying that I'm a mechanical engineer by profession, I only tinker in electronics. Designing a PCB is not nearly as hard or as expensive as it may seem. For each of the boards I designed, there was a minimum or of 5 boards, and I paid around $6 for each package. That includes shipping! I highly recommend giving it a try if you have a project that would benefit from a PCB.
Heres a link the PCB schematic and PCB file.
https://oshwlab.com/afarnsworth702/reef_ato
The PCB takes a 12VDC input, converts it down to 3.3V with 2amp capacity then distributes it to 3 MOSFETs controlled by the microcontroller. There are also two switch closure inputs: one for the level switch, and one for a button for resetting from an error state. Another feature you may notice is the 5VDC converter circuit. When I designed the PCB I wasn't sure how the microcontroller would do running directly from the same 3.3V source that the motor is on. So this 5V converter supplies 5V to the VIN of the microcontroller which has an onboard 3.3V regulator. These two voltage sources for the microcontroller are selectable via a solder jumper. Currently I'm running the microcontroller directly off of 3.3V which seems to be working fine but I may convert over to the 5V supply if I run into issues in the future. Also on the board are various capacitors for power regulation, resistors for pull downs and a diode as a motor freewheel diode. Controlling the LEDs with a MOSFETs is probably overkill but I wanted overhead for if I change the outputs in the future or repurpose this PCB for a different project with similar ins/outs.
Main PCB components:
3.3V Converter
MOSFETs
Xiao SAND21
Logic:
The logic is design such that:
1. If the level switch is low (low water level) for greater than 10 seconds turn on motor for not less than 10 seconds
2. If the level switch is low (low water level) for greater than 120 seconds enter error mode
3. Error mode latches to disable motor output and can only be reset via push button (inaccessible from outside the enclosure) or a power cycle
4. LED1 is on when the motor is on. LED1 also flashes when error mode is latched on.
5. LED2 fades in a sine wave as a status indicator that the program is running and not frozen or errored out
This code is all basic arduino code that I could have written... if chatGPT didnt do it 20x faster! Yeah, so this code is all LLM created with a manual review prior to uploading.
Mechanical Design:
The 3D printed enclosure sits on a glass separator. The level switch is on the end of a PVC pipe that has a clamping mechanism in the housing which allows me to make slight tweaks to water level. I have some clips for the silicone tubes and a PCB holder back half.
So anyways, thats my project and I hope you all find it cool! If anyone would like some of these files or more details let me know!
Last edited:
