Timer activated by Reed on AC solenoid

Thread Starter

MelvinE

Joined Nov 14, 2018
10
Hello everyone,

Let me start by saying thank you for taking the time to read this - I really appreciate it!

To the point: I am trying to create a 2-digit timer that resets and then starts at the activation of an external AC solenoid, and pauses at the solenoid's deactivation. The circuit I have created (see schematic below) works fine with a neodymium magnet, but not with an AC solenoid (it will only reset the timer, not start it)

Extended explanation: I work as a barista for a company with various coffeeshops, and in order to improve the quality - and especially the consistency of quality - of our coffee, I want to create an automatic shot-timer for our espresso machines. The time it takes for an espresso (or lungo) shot to complete is important information for a barista to ensure quality, and I want to eliminate the necessity to use separate, manually operated timers.

At the start of this project I had no experience with electrical engineering, and no knowledge of electrical components whatsoever. I have been "self"-teaching with the help of online resources. It has been a very educative experience, and a lot of fun to boot. But right now I believe I have reached a point where I need some professional advice to help me finish the project.

We work with Kees van der Westen espresso machines (Mirages, mostly), and the water supply to the groupheads is regulated by solenoid valves. As I mentioned before, my current circuit (which, as you can see, uses two Reed switches) works fine with neodymium magnets, but not with an AC solenoid. It will only reset the timer, and not start it. And when I place the reed sensors inside the espresso machine, near the solenoid valve, the result is a chaotic flickering of the 7 segment display (presumably because of "noise" form all the power cables).

What I'm asking: I would really appreciate some advice as to how to modify the circuit to get it to work with an AC solenoid, and to protect it from any unwanted interference from nearby magnetic fields (if this is really an issue).
Also, this is my first time designing a circuit and a schematic, so any general tips and comments will also be very much appreciated; whether they are concerning the layout of the schematic, the wiring, my general approach - any advice or tips from anyone more experienced than me will be received with gratitude. I am eager to learn.



I have also uploaded a video demonstration of my current breadboard prototype:
A couple of notes on the video:
  • As you can see, the reed switches are connected with wires, as they will be when I eventually turn this into an end-product, because the display will be on the outside of the espresso machine, with the reed switches inside of it.
  • On this breadboard I have connected only one 7 segment display and a single 4026 ic for the sole reason of keeping it easier to work with.
  • I'm using a 9v battery simply because that is one I have a breadboard connector for. On the eventual PCB I intend to use a 3.3V button battery.
  • Sometimes (or more accurately: one time in this video) the timer acts erratically (i.e. "jumps" numbers). I believe this to be solely due to the position and approach of the magnet; I can get it to work consistently if I place the magnet right and approach it in the same manner and orientation.
Again, thank you for taking the time to read this post, and have a great day!

MelvinE
 

ericgibbs

Joined Jan 29, 2010
14,679
Hi Melvin.
Welcome to AAC.
On your diagram I do not see any decoupling capacitors on the VDD power lines.?
Try a 100uf and a 100nF in parallel from VDD to 0V/Gnd, close to the IC's.
E
 

LesJones

Joined Jan 8, 2017
3,647
A reed switch will probably be fast enough to follow the AC waveform to the solenoid so instead of being closed when the solenoid is energised it will probably be pulsing on and off at 100 or 120 hz depending on the mains frequency. Look at the output of the reed switch with an oscilloscope to see if this is happening.

Les.
 

Alec_t

Joined Sep 17, 2013
12,464
I think Les has it right. Perhaps a reed switch is not the best device to use here
Are the solenoid valve terminals at mains voltage or some lower value (e.g. 24VAC)?
 

Thread Starter

MelvinE

Joined Nov 14, 2018
10
Thanks for the replies! I’m stuck at work now so can’t reply too elaborately or work on the timer. Later tonight I will try to add the decoupling resistors for sure.

Also I’m trying to borrow an oscilloscope or buy a cheap one (
Looking at
https://s.click.aliexpress.com/e/Cd2ZK7W)

The solenoids are connected to mains (230V 60hz - see photos). If the pulsation is the issue, how would I go about solving this? I’ve heard MCU mentioned combined with Hall effect sensor. I am very eager to look into that, but I also feel reluctant to abandon the current approach entirely; I’ve been working on it for a long time.

 

Alec_t

Joined Sep 17, 2013
12,464
I’ve heard MCU mentioned combined with Hall effect sensor. I am very eager to look into that
That would be one option. A Hall sensor such as the TLE4906K might work, depending on the strength of the stray magnetic field close to the solenoid, but a more sensitive one might be necessary.
Another option would be to use a current transformer around one of the supply wires going to the solenoid; but as the solenoid current is only ~66mA, sensitivity might again be an issue.
A third option would be to wire a mains indicator neon to the solenoid and sense the light from that with a photo-cell.
 

LesJones

Joined Jan 8, 2017
3,647
You could probably solve the problem by feeding the output of the reed switches to a retriggerable monostable multivibrator IC such as a 4047 configured with a timeout value of a little more than half a cycle (It could even be the length of a few cycles of the mains supply.) I'm not sure if both reed switches are on the same solenoid valve or if they are an two solenoid valves. You would need to change the way you generate the reset pulse and gate the clock signal from the 555.
Edit. One other thing to consider is how long the reed switches would last opening and closing 120 times a second while the solenoid valves were energised. Alec's hall sensor (Or a coil close to the solenoid valve to pick up it's stray magnetic field.) would be a more reliable solution.
Les.
 
Last edited:

Thread Starter

MelvinE

Joined Nov 14, 2018
10
Thank you all for the replies and insights. It's become obvious to me that I need to to some more homework, and you guys have helped me onto the right track.

Read carefully! You need decoupling “CAPACITORS”.
Sorry, my bad. I know what decoupling is and that it requires capacitors, not resistors. I was typing my reply on my phone during work and the pressure of people waiting for their coffee made me less attentive than I should have been to both the words I was typing and my job.

A Hall sensor such as the TLE4906K might work, depending on the strength of the stray magnetic field close to the solenoid, but a more sensitive one might be necessary.
Another option would be to use a current transformer around one of the supply wires going to the solenoid; but as the solenoid current is only ~66mA, sensitivity might again be an issue.
A third option would be to wire a mains indicator neon to the solenoid and sense the light from that with a photo-cell.
All of these options are interesting to me, though I will most certainly start with the Hall sensor one first. I will start by learning about the hall effect, and the workings and variables of hall effect sensors. I hope I'll be able to experiment with some setups soon.

Edit. One other thing to consider is how long the reed switches would last opening and closing 120 times a second while the solenoid valves were energised.
Les.
That was my concern too.
Thank you very much for this. I had not thought about the effects on the switch of such high frequency opening and closing, but it now seems obvious to me that it cannot be conducive to it's endurance by any means. Seeing as I'd like the end product to be durable and reliable, this new perspective has convinced me I should abandon the idea of using Reed switches.

Probably would be better to replace the coils with 24vdc solenoids, unless you can get 240vdc coils and add a small bridge at each valve.
Max.
Thanks for the idea, Max, but the reason I wanted to use magnetic switches is that I want to keep this add-on to the machines non-invasive; for insurance reasons, I am not allowed to modify the espresso machines themselves. Adding some wiring or attaching some sensors is one thing, but replacing parts is quite another.
Furthermore, replacing the solenoids seems unnecessarily expensive. My employer is not convinced this idea of mine is possible without voiding the warranty on the machines (I KNOW it is), and he would never allow me to replace any solenoids, never mind paying for the required parts.
 

MaxHeadRoom

Joined Jul 18, 2013
24,210
Furthermore, replacing the solenoids seems unnecessarily expensive. My employer is not convinced this idea of mine is possible without voiding the warranty on the machines (I KNOW it is), and he would never allow me to replace any solenoids, never mind paying for the required parts.
OK I see, but just to clarify, it would just mean the coils, not the whole solenoid.
Max.
 

Thread Starter

MelvinE

Joined Nov 14, 2018
10
OK I see, but just to clarify, it would just mean the coils, not the whole solenoid.
Max.
Sorry, I missed that. I did not know one could replace just the coils in the solenoid. That probably voids my argument about cost-efficiency. I have some solenoid valves at home that the mechanic was going to throw out. I am going to open one up to check out its internals for educational purposes.
 

Thread Starter

MelvinE

Joined Nov 14, 2018
10
One more thing: I have never worked with microcontrollers before and am clueless about their workings. I have ordered an Arduino recently (in combination with a load-amplifier and a bunch of strain gauges) that I will be needing for my next project (designing a weighing scale to add to the coffee grinders to ensure consistent dosing), but I reckon that would be overkill for the timer project. Could anyone point me in the right direction?
 

MaxHeadRoom

Joined Jul 18, 2013
24,210
One more thing: I have never worked with microcontrollers before and am clueless about their workings. but I reckon that would be overkill for the timer project. Could anyone point me in the right direction?
There are small Microchip 8pin microprocessors that have many features inside a small area.
Max.
 

Thread Starter

MelvinE

Joined Nov 14, 2018
10
Also in place of reed switches there is the miniature proximity sensors such as Honeywell SS400 series that can be operated next to a coil.
Max.
There are small Microchip 8pin microprocessors that have many features inside a small area.
Max.
These are both excellent tips! Thanks Max!
Honestly, I'm getting all excited to look into this stuff and learn about it. The process itself has become much more fun than the prospect of finishing the timer (though I am eager to do that too, even if only to prove my employer wrong and hopefully get some return on my (modest) financial investment).
 

ebeowulf17

Joined Aug 12, 2014
3,282
One more thing: I have never worked with microcontrollers before and am clueless about their workings. I have ordered an Arduino recently (in combination with a load-amplifier and a bunch of strain gauges) that I will be needing for my next project (designing a weighing scale to add to the coffee grinders to ensure consistent dosing), but I reckon that would be overkill for the timer project. Could anyone point me in the right direction?
You'll lose your mind trying to build a scale that survives behind the bar at your shop and also delivers suitable resolution for espresso dosing. I rarely discourage people from trying to build their own stuff, and if you want to build your own scale for fun, that'll be a great learning experience... but if you want it to actually be useful at work, just buy one that's made for it.

This Acaia is pricey, but it's compact, accurate, precise, waterproof, and can handle the abuse of getting hit with too much weight repeatedly (dropped portafilters, etc.) I've worked with at least a dozen barista scales, and tried to build my own, and this is the only one (so far) that survives and offers any useful accuracy. Most do neither!
https://acaia.co/collections/coffee-scales/products/lunar?variant=2433739128855

You can use a stand or support something like this in order to use the smaller Acaia scales above without portafilters sliding off (we made our own lower profile ones for naked portafilters, with our company logo laser cut into them, but don't have them available for sale, only internal use.)
https://www.artisansmith.com.au/products/portafilter-stand
upload_2018-11-14_20-46-50.jpeg
 

ebeowulf17

Joined Aug 12, 2014
3,282
I also like the idea of Hall effect sensors instead of reed switches. You'll still have to deal with the fact that its output is switching at 50-100Hz. I envision one hall effect sensor detecting AC current, an RC filter on it's output to smooth that 50-100Hz signal into a smooth-ish DC signal, and a transistor (Darlington or MOSFET) amplifying that small signal to drive a small DPDT relay. The contacts of the relay will be a direct, drop-in replacement for both reed switches in your current schematic.

I've worked quite a bit with the SS490 series sensors and can wholeheartedly recommend them (although I have limited experience with other Hall effect sensors, so I'm not drawing any comparisons, just saying the Honeywells have worked beautifully!)
 

ebeowulf17

Joined Aug 12, 2014
3,282
OK I see, but just to clarify, it would just mean the coils, not the whole solenoid.
Max.
Although, it opens up a BIG can of worms. In order to replace those coils, you'd have to come up with a 24VDC source, then wire something up so that the 230V coil signals from the machine can control the 24V outputs (relays? AC input SSRs?) If you're designing your own system, it makes sense to spec the parts the way you want them, but adapting your coil preferences into an existing espresso machine that has all the wrong voltages and none of the right ones, plus no room under the hood for extra parts, would be difficult. And all that inside a machine where they're concerned about voiding the warranty...
 
Top