Satisfying Solenoid Operating CLICKING Sounds
I am tinkering with a solenoid valve and a battery I have kicking around. The sound the valve makes when it opens and closes is very satisfying. The little spark is also cute.
I am tinkering with a solenoid valve and a battery I have kicking around. The sound the valve makes when it opens and closes is very satisfying. The little spark is also cute.
In my workshop I had two parts kicking around that I've not used and have not allocated to any other projects:
Screenshot of a short video showing valve energization.
Being an avid gardener and electronics tinkerer, I thought it would be neat to make a project that controls a valve to fill a 1000L water tote I have in my garden. When the tote is near empty, I want a sensor to trigger and enable the valve. I want it to turn off when the tote is full. The valve will not activate too often, maybe once a week for 20 mins to fill the tote.
This post is about the early stages of starting the project. Figuring out what parts I need, and starting the preliminary design.
Design Criteria
Energy Budget
As can be seen in the image, the valve draws about 2A when activated. I have never used this valve before, but I was reading that the actual current draw might be less once there is pressure from the water on the valve. Physically this makes sense.. Anyways I will use 2A as my operating current to stay conservative.
It will take about 20 mins to fill the tote, let's round it to 30 mins. To get an estimate of the capacity used, Capacity (Ah) = Current (A) * Time (hrs). Therefore, 2A * 0.5hr = 1Ah. The battery has a capacity of 17.2Ah, so in theory I should be able to operate about 17 cycles, that is 1 cycle per week, or 17 weeks.
I need to budget that my charging circuit can put about 1Ah back into the battery in about 1 week's worth of time. Let's assume of the 7 days, 3 days are cloudy (I live in one of the sunniest cities in Canada, so this is accurate enough), that gives 4 days of potential charging. Lets say I only have 4 hrs of direct sunlight per day, that gives about 4 days * 4hrs /day = 16 Hrs of charging time in my one week cycle. If I can produce a current of even 100mA average during charging that would give about 1.6Ah, before losses.
Long story short, a 100mA is very easy to achieve and my panel can be quite small. I haven't decided yet on which panel and voltage, but once I do it will dictate the battery charger as well. I will not be making the charger from scratch and will look for an off-shelf unit. Any recommendations?
Since the battery capacity is much larger than my estimated usage in a week, I am going to break this project up and first not have any charging capability. I figured I have 17 weeks to get this part added once the valve is in the field.
Finally, any other electronics I connect to this system will draw insignificant current compared to the valve, so I don't really have to budget them in.
Water level sensor
I do a lot of work with a range of sensors, but a water level sensor is actually not one I have used before. There are different ways to get the water level, but I think among the most reliable ones is a float switch. I would need to have two of them as I want a tote water low and a tote water high signals.
Microcontroller
Strictly speaking, the project could be built entirely with float switches and relays. However, I want to log fill cycles, remotely monitor the system, and manually control the valve from my phone, so an adding a microcontroller makes sense for my goals. The signals coming from the two float switches need to be processed in order to trigger a relay that closes the circuit on the valve. My go to is an ESP32 based board. Easy to use and is more than sufficient for this project. Plus I have a lot of them kicking around the shop.
Relay vs MOSFET
One thing I haven't fully decided on yet is whether to switch the solenoid valve using a traditional relay or a MOSFET.
A relay is simple, inexpensive, and provides complete electrical isolation between the microcontroller and the valve. Since the valve only operates for about 20 to 30 minutes once a week, relay contact wear is unlikely to ever become an issue. The downside is that the relay coil consumes additional power while energized, produces an audible click, and has moving parts.
A logic level N channel MOSFET is another option. It has no moving parts, consumes essentially no control power, operates silently, and generally offers a longer service life. It would also require a flyback diode across the solenoid coil to protect the MOSFET from the inductive voltage spike when the valve turns off.
At the moment I'm leaning toward a MOSFET, but I'm interested to hear what others would choose for this application and whether there are any practical considerations I may have overlooked.
The "smart" part of this project
Since I included the word "smart" in the title, I figured I should touch on this. Being an engineer I love data. So I'd want the ESP32 to collect data on frequency and duration when the valve was on. I'd also want a manual operation button on the app and of course a safety shut off button. My go to for this is Blynk IoT app. I have used them for many years and done several projects (I am not affiliated with them in any way, but do highly recommend them).
In terms of safety, I'll probably implement a maximum valve on time (perhaps 45 minutes) so that if a float switch fails, the valve can't remain energized indefinitely. This is easy enough but I think an important step. Also, if this triggers there should be notifications send to me so I can go check out if there are any issues.
Enclosure
Given that this will be outside, I will have to consider an enclosure to keep the electronics secure and dry. This is typically something I consider once I have all the main parts.
Final Thoughts
This project is still in the early concept stage. If I missed something or you have suggestions please let me know!
I'm designing a DIY remote intended as a soldering kit.
My design requirements were:
I had to consider power management, microcontroller and RF module. I'll start with the RF module first... I chose the popular nRF24L01, although the version I am using has a can on it and has FCC/IC. I prefer this version over the generic one that is everywhere. Works well and has a ton of support! The range it can achieve is also more than sufficient for the intended applications.
Since this RF module does not officially support 5V (I contacted the manufacturer .. there are some versions of the nRF24L01 that *do* support 5V, but this module does not), I had to stick with 3.3V. As my first design goal was to use as few parts as possible, I did not want to use a logic level shifter (LLS). So I needed a microcontroller that operates on 3.3V. Like the Pro Mini, but in my case a Nano form factor running on 3.3V (I had to drop the clock frequency a bit to remain within manufacturer suggested conditions). Even at reduced clock speed, the ATmega328 running at 8MHz and the nRF2401 module combined are still quite fast... at least for the human mind. (more on that below)
Both the RF module and the microcontroller can operate well at 3V, so I figured I just use two AA batteries. Then I only need some filters but no other real power management components like a linear regulator. Perfect for what I was trying to design. Also, I wanted to pick batteries that are super common, cheap enough and can be recharged.
I made a 3D printed base for this remote as well and it now hold very well. I used the remote as a general HID controller for a couple custom games I made and it works great. Response time is super (no lag or delay that is noticeable) and the battery lasts more than a day.
All the parts are THT (through-hole) and therefore easy to solder together (second design goal). I mounted the RF module and the microcontroller using female headers. They are secure enough but this allows them to be removed easily and used in other projects. This was my third design goal.
I am working on a remote car and drone (under 250g), both of which can also be controlled with this remote. So there are quite some applications.
I'm designing a DIY remote intended as a soldering kit.
My design requirements were:
First I had to think about power management, microcontroller and RF module. I'll start with the RF module first... I chose the popular nRF24L01, although the version I am using has a can on it and has FCC/IC. I prefer this version over the generic one that is everywhere. Works well and has a ton of support! The range it can achieve is also more than sufficient for the intended applications.
Since this RF module does not officially support 5V (Yes, I contacted the manufacturer .. there are some versions of the nRF24L01 that *do* support 5V, but this module does not), I had to stick with 3.3V. As my first design goal was to use as few parts as possible, I did not want to use a logic level shifter (LLS). So I needed a microcontroller that operates on 3.3V. Like the Pro Mini, but in my case a Nano form factor running on 3.3V (I had to drop the clock frequency a bit to remain within manufacturer suggested conditions). Even at reduced clock speed, the ATmega328 running at 8MHz and the nRF2401 module combined are still quite fast... at least for the human mind. (more on that below)
Both the RF module and the microcontroller can operate well at 3V, so I figured I just use two AA batteries. Then I only need some filters but no other real power management components like a linear regulator. Perfect for what I was trying to design. Also, I wanted to pick batteries that are super common, cheap enough and can be recharged.
I made a 3D printed base for this remote as well and it now hold very well. I used the remote as a general HID controller for a couple custom games I made and it works great. Response time is super (no lag or delay that is noticeable) and the battery lasts more than a day.
All the parts are THT (through-hole) and therefore easy to solder together (second design goal). I mounted the RF module and the microcontroller using female headers. They are secure enough but this allows them to be removed easily and used in other projects. This was my third design goal.
I am working on a remote car and drone (under 250g), both of which can also be controlled with this remote. So there are quite some applications.