Electronics newbie (but long time Coder) making a solenoid powered Zen Clock - Page 1
Forum section: electronics / projects

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:19:58 pm
content: HelloLong time EEVBlog video watcher (in Australia) and electronics newbie (does watching EEV Blog and Louis Rossmann count as experience).I am making an ESP32 (Afafruit Feather) + RTC Feather + Alpha NumericFeather 4 digit screen based Zen Clock that drives a 15m Stroke 12V 8A Solenoid (5KG Force)I have a working circuit for a N-Channel MOSFET 60V 30A (FQP30N06L,https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Components/General/FQP30N06L.pdf) MOSFET and plan on striking a bell every hour with a solenoidDone1. I have the Feather Working (Blink Sketch)2. I have the RTC Clock working (Serial Output)3. The Time if going to the Alpha Numeric Display4. I have the N Channel Mosfet firing a 12v test motor (low amps)5. I have a 1N4004 1A fallback diode on the motor.Next1. Add temperature sensing (4x Thermister) around the Solenoid and not strike the solenoid if hot (maybe switch on a fan), I know the solenoid can get hot if activated for more than 2 seconds.2. Add a fuse on the power input?3. I need to wire up the Adafruit Feather Tripler and get it working with the MOSFET before I move away from the Arduino4. Also I want to see how hot the MOSFET gets before I move it. I have a TO-220 Heatsink just in caseI have a basic wiring diagram (Fritzing) of the prototype on an Arduino Mega.Apologies My fritzing does not have a DC power part so I used a battery instead I the diagram. This won’t run of batteries.I will probably add Alarm clock style buttons to control 12/24 hour time, turn on/off the screen, disable the ringing, and maybe toggle other features. I gave a EEPROM chip I may add to save settings to.Maybe add Bluetooth or WIFI Access via Blynk??When features (circuits) are complete I want to make a PCBAdvice and feedback welcomeParts1. Adafruit HUZZAH32 – ESP32 Feather Board (pre-soldered) -https://www.adafruit.com/product/35912. Adafruit: DS3231 Precision RTC FeatherWing – RTC Add-on For Feather Boards -https://www.adafruit.com/product/30283. Adafruit 0.54″ Quad Alphanumeric FeatherWing Display – Green -https://www.adafruit.com/product/31294. Particle FeatherWing Trippler -https://core-electronics.com.au/particle-featherwing-tripler.html5. Adafruit Prototyping Add-on Board for Feather -https://www.adafruit.com/product/28846. 12 Solenoid (12V 8Amp) -https://www.amazon.com/uxcell-JF-1578B-Linear-Solenoid-Electromagnet/dp/B07FKSX7797. N-CHANNEL MOSFET 60V 30A -https://core-electronics.com.au/n-channel-mosfet-60v-30a.html8. Fallback Diode (1N4004 1A 400V) -https://www.jaycar.com.au/1n4004-1a-400v-diode-pack-of-4/p/ZR10049. Thermister 10k (-40 to < 120c) -https://core-electronics.com.au/thermistor-10k.html

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:21:11 pm
content: Zen Clock Idea

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:23:02 pm
content: ESP + RTC + Alpha Numeric

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:25:47 pm
content: Solenoid

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:27:33 pm
content: N Channel MOSFET

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:28:29 pm
content: MOSFET Heatsink

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:29:33 pm
content: Fallback Diode

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 10:30:23 pm
content: Wiring Diagram (Prototype)

author: Etesla
author_rank: Regular Contributor
timestamp: September 15, 2020, 11:01:17 pm
content: Good on you taking the step into hardware!Your circuit with the mosfet, motor, and arduino is wired correctly. Good job. Here are some tips that deal with your component choices.Solenoid:The solenoid you have listed is wicked expensive. I doubt you need one that's that expensive to ring a bell...It is also very unlikely that a second or so of activating the solenoid once an hour will generate a noticeable amount of heat. I would ditch the thermistors, you have to add extra circuitry to work with those anyways.Mosfet:You will be operating very far inside of the specifications for your chosen mosfet. You could get a cheaper mosfet to do the job, but I'm assuming cost isn't a huge factor for you. It's unlikely that a mosfet of that size would require a heat sink for your application of activating the solenoid, as I'm sure you will find out on your own.Diode:You called it a Fallback diode, but I think you meant to say flyback diode. The mosfet you chose actually has a diode built into it in the correct orientation, so the extra diode isn't strictly necessary if the wires from the solenoid to the mosfet aren't that long. If they are long, putting a diode right by the solenoid is a better idea. If you wanted to go overkill you could even put something like a 15V zener diode across the relay instead of your flyback diode in order to take care of any other inductive voltage spike weirdness that might occur from 'both directions'. A zener would protect the mosfets Drain to Source voltage from going over 15V, and from going under -.7V, where a normal diode only protects the Drain to Source voltage from going under -.7V.

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 11:33:14 pm
content: Wow thanks or the detailed reply>The solenoid you have listed is wicked expensive.I did buy the solenoid on Ebay and yes it is huge. Maybe I will down grade.>You could get a cheaper mosfet to do the jobCool, I was advised this one by the retailer I bought it from instead of a relay.>It's unlikely that a mosfet of that size would require a heat sink for your applicationYes, I will measure temps when the 8A solenoid is connected.I just added it because it looked cool and and I bought it for a few dollars on eBay just in case.> You called it a Fallback diode, but I think you meant to say flyback diode.Yeah my bad, is it a schottky diode too? I'll try an remember.P.S I had a storke 3 years ago and my brain is a bit stupid.> Cool I did not knowThe mosfet you chose actually has a diode built into it in the correct orientation, so the extra diode isn't strictly necessary> if the wires from the solenoid to the mosfet aren't that long. If they are long, putting a diode right by the solenoid is a better idea.The wires are about 15cm long.Q1) Should I pout the Diode near the MOSFET?> If you wanted to go overkill you could even put something like a 15V zener diode across the relay instead of your flyback diodeI am happy to go overkill. I'll researchI researched Zener Diodes and once the talked Quantum tunneling and dual breakdown voltage it was beyond me.

author: FearTec
author_rank: Regular Contributor
timestamp: September 15, 2020, 11:39:51 pm
content: > If you wanted to go overkill you could even put something like a 15V zener diode across the relay instead of your flyback diodeHow many watts should the Zener diode be?Is this too smallhttps://www.jaycar.com.au/15v-1n4744-1-watt-zener-diode/p/ZR1415Thanks In Advance

author: floobydust
author_rank: Super Contributor
timestamp: September 15, 2020, 11:49:04 pm
content: I see a problem, that N-ch mosfet really would like at least ~6V of gate-drive. It won't do much with the 3.3V drive from an ESP32 output, it will barely turn on and thus get hot with higher current loads. I can't see it driving an 8A solenoid unless you add something to give it more gate drive. Instead, most people use a high-side switch consisting of a P-ch mosfet and extra transistor. Or a logic-level mosfet but these are for 5V drive.This is a worst-case kind of happening but a protective element/fuse of some sort I would include because the solenoid will cook and in a wood box that's not great, if the mosfet or MCU or F/W fails. I would consider adding a PTC Resettable Fuse rated for say 3-4A because they take a long time to trip and would not interfere much with a brief 8A pulse.It's easier than monitoring the solenoid temperature, and if it's too hot you can't do much anyway.A doorbell solenoid is usually 16VAC but much less current, like 1A. 8A will be a really hard strike.Because the solenoid is just pulsed on for say 200msec, you could just trigger a timer from the MCU which also gives coverage if the code/MCU leaves the solenoid stuck on, it would time out.

author: FearTec
author_rank: Regular Contributor
timestamp: September 16, 2020, 12:38:22 am
content: Thanks> I see a problem, that N-ch mosfet really would like at least ~6V of gate-drive.I read that this MOSFET may be OK triggering upto 10A but higher voltage would require higher switching current? But looking at the data sheet I suspected it may not be enough.Should I ...A) Reduce the solenoid sizeorB) Add a 3.3v PNP Transistor and trigger a 5V signal to the MOSFET, Ill have a 5V rail powering the ESP32 so it can power a TransistorI don't mind it being more complex>solenoid will cook and in a wood box that's not greatI will probably open the box and make the innards exposed (show piece)>I would consider adding a PTC Resettable Fuse rated for say 3-4AOK, will do

author: Circlotron
author_rank: Super Contributor
timestamp: September 16, 2020, 12:39:36 am
content: Quote from: Etesla on September 15, 2020, 11:01:17 pmThe body diode inside the mosfet is across the source to drain. A diode needs to be across the solenoid as per the OPs diagram.5V gate drive is tons for that mosfet and that load. 3.3V is very marginal.

author: FearTec
author_rank: Regular Contributor
timestamp: September 16, 2020, 01:25:32 am
content: I will order a Transistors pack (170 mixed pack (and possibly use a S8050 Transistor) to receive the signal from the ESP (3.3v) then switch on a 5v rail to the MOSFET.I found this guide for the S8050 Transistor:https://embedgyan.wordpress.com/2020/07/13/esp32-esp8266-rgb-led-strip-with-color-picker-web-server/I looked at smaller Solenoids and will probably stick with the 12 8A one as it is needed for the hand beaten bell I have (sold metal)I will order a RESETTABLE FUSE PTC fuse for DC input protection.Q1) Do I need more fuses inside the circuit?Q2) Whats the rule for selecting fuzes? Get a slightly higher one or exactly match the power needed?Thanks for the answers, I am learing a lot

author: floobydust
author_rank: Super Contributor
timestamp: September 16, 2020, 04:27:38 am
content: Sorry I got mixed up on your mosfet's part number. RFP30N06 and FQP30N06Lare logic-level MOSFETs that ideally work with 5V gate drive or better, but at 3.3V drive they can work OK at 8A according to the datasheets. So I think you're fine controlling one directly from the ESP32, like in your test circuit- although I prefer some isolation so if the mosfet fails, it cannot damage the MCU as well.I would have a small fuse say 1A for the digital section (Feather MCU, display etc.). The solenoid is getting literally 100W blast of power when on, it better be brief or it will cook and be a danger. So I'd put a polyfuse there,Bourns MF-R PTC resettable fuseseven a MF-R160 takes 8 seconds to trip at 8A despite being a 1.6A hold/3.2A trip part. So you are exploiting the fact that fuses are slow and using a "too small" rating. A quick 8A surge does nothing, but after several seconds the fuse needs to act.A fallback diode as you call it works just fine, but the solenoid may be a bit sluggish to spring back. It takes longer for the magnetic field to collapse than if a zener diode were used. A fast tap of the bowl depends on that and the solenoid's return spring. I think a 1W part is too small and prefer 3-5W if you use a zener.Whatever is making the 5V (regulator) might run hot with 12V input, have to check for that.

author: Circlotron
author_rank: Super Contributor
timestamp: September 16, 2020, 06:39:57 am
content: If you don't mind adding a bit more complexity, you could have the solenoid supplied by a large value capacitor that gets gradually charged by a resistor. You did say it strikes once an hour...A suitably high value resistor would guarantee the if the solenoid stuck on, then current would only flow for a moment until the capacitor discharged. The resistor would limit the ongoing current to a low value. Just check the resistor dissipation. You could then also go a lot higher than 12 volts to guarantee the bell gets struck hard.