Help needed with circuit design - Page 1
Forum section: electronics / projects

author: BWK
author_rank: Contributor
timestamp: March 13, 2023, 04:34:37 pm
content: Hello! I support a sizable group of luxury motorhome owners where the manufacturer is no longer in business and electronic parts are not available. I repair their various circuit boards, and I make quite a few replacements while modernizing them to SMD and improving the design where I can. Problem is, while my troubleshooting skills get me by, my knowledge of electronics is limited.I'm looking for someone to help me with what I'm sure is a simple circuit design. With enough head scratching, I can probably figure it out myself eventually, but I have a part I need to make for some people and my day job and family don't allow me the time I need to figure it out. I'm happy to pay someone for their time, I'm just looking for that someone that can spare some of their time and experience to help me.Is it appropriate to seek help in this manner in this forum or is there another path I should be following. I've been supporting these owners for ten years or more but this is my first time looking for help

author: fourfathom
author_rank: Super Contributor
timestamp: March 13, 2023, 05:58:42 pm
content: I don't see why you can't ask... What is this circuit supposed to do? Inputs? Outputs? Power?

author: BWK
author_rank: Contributor
timestamp: March 13, 2023, 07:04:36 pm
content: Thank you. Circuit receives constant 12V power and is triggered by a low current switch on a door handle. Output is a 2 wire solenoid. I need to pulse the solenoid for 2sec so the doors unlatch.Other requirements I have are....1. Need to ensure the solenoid doesn't trigger upon initial power up of the circuit.2. Circuit needs to require that door switch is held in for more than 0.5sec before triggering the solenoid. This is to ensure the circuit isn't responding to a defective switch, circuit noise or contact bounce.3. Once triggered, the circuit needs to continue powering the solenoid for the 2sec even if the door switch is released.4. After the solenoid has been triggered, the circuit needs to ignore the door switch for say 10 secs before allowing another cycle. This is to prevent accidental or deliberate fast cycling and allow the solenoid time to cool.I'm figuring using a mechanical relay on the output stage. I know I could use a Mosfet, but concerned about durability with the energy the solenoid will kick back when it releases. The circuit will also have to endure this voltage spike and the generally unclean 12 power system in the coach which is laden with transients and noise from many low voltage devices.I spent time exploring how to use multiple 555 timers to achieve my goal and burned a few up in the process. I know I can get there myself if I put time into it but don't have that luxury. Hoping to pay someone to design me a circuit, and I'll take care of PCB layout and everything else.

author: BWK
author_rank: Contributor
timestamp: March 13, 2023, 07:10:59 pm
content: I should also note that solenoid inrush is probably about 10amps and where possible, I need the circuit to remain functional when input voltage is as low as say 7.5 volt. Motorhomes are frequently trying to operate with discharged batteries.

author: mariush
author_rank: Super Contributor
timestamp: March 13, 2023, 07:27:46 pm
content: Sounds like something a 8-16 pin 8 bit PIC microcontroller could handle just fine. Or an arduino.Would probably take a few hours in the afternoon to play with some tutorials or to learn the minimal C required to program this functionality.The microcontroller can do debouncing of buttons internally, can measure time, can turn on and off things (using transistors or mosfets to handle high currents), and it's fully adjustable when it comes to timings.It's just a bigger initial investment, like 20-30$ for a programmer.

author: BWK
author_rank: Contributor
timestamp: March 13, 2023, 07:32:11 pm
content: I thought about those and it's on my bucket list of things to figure out someday, but insanely buried in my construction day job while remodeling and taking care of teenagers. There is no me time right nowI found a site called fiverr.com that looks like it might work for my design needs right now. Thank you!

author: BillyO
author_rank: Super Contributor
timestamp: March 13, 2023, 07:39:31 pm
content: For a beginner, I recommend a PICAXE. The programming language is a lot simpler.The switch, a resistor, a PICAXE (08M2), maybe 3 capacitors, a small regulator (78L05), a 15A MOSFET, a 1N4001 diode and appropriate connectors are probably all you need. The switch, needing to be robust and weather proof, will probably be the most expensive part. I am assuming the solenoid is already in place. Do you have it's specs? Will it pull-in sufficiently at 7.5V?One thing I'll note though, if your 13.2V lead-acid battery has made it down to 7.5V, it will likely need to be replaced. They usually do not recover if they have been below 10V for any length of time.

author: BWK
author_rank: Contributor
timestamp: March 13, 2023, 07:55:04 pm
content: Much appreciated, thank you. I think this board I need to make will push me into learning how to use those microcontrollers and the recommendations are very helpful. The switch and solenoid are pre-existing, and the solenoid is overpowered and does have enough power even at 6 volts to open the door. On the voltage side, the battery bank is usually 1500-2000 Ah deep cycle and quite tolerant of severe discharge abuse. In theory they are fully discharged at 12.0V, but that assumes no load at the battery. There is always some load so most systems in the coach will remain operable down to about 10.5V measured at the various devices. Below about 10.5V, the usability drops off real fast but I try to ensure everything I make is functional down to at least 7.5V so it has a wide operating range.

author: BillyO
author_rank: Super Contributor
timestamp: March 13, 2023, 08:18:06 pm
content: I could take a crack at it if you wanted to PM me your budget and what you expect.Some other specifications will be needed to discussed too.

author: sparkydog
author_rank: Regular Contributor
timestamp: March 13, 2023, 10:17:40 pm
content: Quote from: BWK on March 13, 2023, 07:04:36 pmGood, you're thinking about that! However, a typical solution to this problem is a flyback diode... which have their own problems (but keep reading). Also, how are you protecting whatever you're using to trigger the relay, which isalsoan inductor?I have the same problem in my project, which I am almost universally addressing with SA18CAs. A typical MOSFET can handlesomereverse voltage; a TVS will limit the reverse voltage seen while still allowing the magnetic field to collapse more quickly than a flyback diode.On the other hand, what are these solenoids doing? On an EMR, slowing the coil release time can lead to arcing. If your solenoids are merely mechanical actuators, it may not matter if they "open" slowly, in which case a flyback diode is an excellent solution, and you probably don't need anything fancier than a 1N400x to make your concerns simply vanish.Quote from: BWK on March 13, 2023, 07:10:59 pmMany EMRs can handle 10Acontinuous. If you're really paranoid, Omron has some UL TV-8 rated relays that are rated for 16A continuous and (IIUC)117Ainrush, which sounds like it's probably overkill for your use.

author: shapirus
author_rank: Super Contributor
timestamp: March 13, 2023, 10:47:53 pm
content: MCUs? Programming? Yeah, that's surely an option.But it can be done with good old jellybean stuff. Here's my attempt at it, built using two venerable ICs: 4017 and 40106. Maybe a bit crude, timing isn't precise, but hey, it's a quick and easy way to do it.R5*C1 set the delay between the switch is pressed and the solenoid is turned on. R7*C2 set the power-on reset delay. R9*C3 set the solenoid power-on duration.Q1 can be replaced by a relay, but it'll need a transistor to drive its coil (and a protection diode across the coil).Providing filtered power for the logic circuitry will be a good idea -- an LDO set to ~11V will do, or even a plain LM317@10V. If input power is going to vary in a wider range or go below 10V, consider using a step-up dc-dc converter (can be a low-power one) followed by a linear regulator.If a MOSFET is used for the switch, as shown, then we usually can't go lower than 10V, because we generally want 10+V on the gate to make sure it turns on fully. If a BJT+relay pair is used, or a bare BJT (which will then have to be a Darlington) that can handle the required solenoid current, then we can go lower, all the way down to 5V for these ICs, as far as I remember.upd: output Q0 should ideally be driving, via a 5k-10k resistor, the base of an NPN transistor connected so as to discharge C3 to ground when turned on -- a last-minute idea. but it's optional, since output Q1, when it becomes low, will sink current and discharge it via R9 anyway, which will happen quickly enough.upd2: reuploaded the schematics.upd3: not sure if R2 at 100K will be sufficient to reliably pull MR to ground. if it's not, then it can be decreased to something like 30-50k, but not much lower, since 40106 can source very little current.

author: BWK
author_rank: Contributor
timestamp: March 14, 2023, 02:41:42 am
content: Quote from: sparkydog on March 13, 2023, 10:17:40 pmThat is good stuff! I was quite fascinated by a report I read once on relay coil make / release times, and how it was affected by the various solutions to control flyback. It was very thought provoking but I stuck with a regular 1N4007 for most relay circuits anyway. I have a taillight controller board I make and I use NEC EX2-2U1S relays in that. I only need 10A max current and the relays are 25A continuous, so lots of overkill, but they are small and cheap which has a lot of value to meGreat input, thank you

author: BWK
author_rank: Contributor
timestamp: March 14, 2023, 02:52:11 am
content: Quote from: shapirus on March 13, 2023, 10:47:53 pmWhy did I wait until now to jump on a message board and ask for helpThis is great, and better still I understand it with my limited know how. I'm going to try it out and see how it works out. I'm going to try going the MCU route though but not because of any insane desire to overcomplicate. More a thing where I think that approach will reduce the overall component count on the board and that helps reduce my labor time, and more importantly, reduce how much time I'm spending twiddling with tweezers and reading glasses set to stun while working on small SMDs.This 'jellybean' answer is a perfect match for me, but yeah, I think I'm going to punish myself a bit and chase the MCU routeI'll make try this too but so much appreciate the time and effort put into this response. Thank you for that!

author: fourfathom
author_rank: Super Contributor
timestamp: March 14, 2023, 02:58:53 am
content: If you do want to go the microcontroller route (lots of good reasons to to that -- it's a general-purpose solution for lots of problems), take a look at little boards like the Adafruit QT Py (https://www.adafruit.com/product/4600). This one costs $7.50 and you can program it in C/C++ (Arduino), or in Python. It's fairly low-power (what always-on current consumption can you tolerate?). It operates on 3.3V, so you will need to select your FET relay drivers carefully, but there are good FETS that will operate well at this gate-voltage.You can certainly design something cheaper (one of those 25 cents controllers could do it), but the Adafruit board sure is easy to get started with. Adafruit is not the only one making this type of board.

author: ledtester
author_rank: Super Contributor
timestamp: March 14, 2023, 03:02:10 am
content: There are "programmable relay modules" available on Amazon, e.g.:https://www.amazon.com/dp/B07BT32T1M/They can set up for all sorts of triggering and timing functions. Have a look at the different timing charts in the manual:https://www.uctronics.com/download/Amazon/U6030_Manual.pdf

author: BWK
author_rank: Contributor
timestamp: March 14, 2023, 03:50:09 pm
content: Quote from: fourfathom on March 14, 2023, 02:58:53 amThank you! The Adafruit options are on my list of things to explore in a hopefully not distant future where I have some me time. Have desires rattling around my head to use them as part of a future CNC wood router table build. Might be a next year project.Thanks!

author: BWK
author_rank: Contributor
timestamp: March 14, 2023, 04:02:41 pm
content: Quote from: ledtester on March 14, 2023, 03:02:10 amI actually used those in a working design where I pulled off the connectors and made a piggy back PCB with some input filtering and thru-holes to solder wires to the board. They seemed to work fine but I got through the parts I had and stopped. This isn't a business for me, it's just a hobby that gives me reason to learn new skills while helping people that need repair parts. I'm always worried about warranty comebacks so try to make everything bulletproof and don't trust the durability of those timer modules. I spent a lot of years servicing the systems in these motorhomes and am very familiar with not only how unclean the 12V power systems are, but also how much the owners struggle to find people to troubleshoot/repair low voltage stuff without making it worse. I do deliberately go a bit overkill on what I do for abuse tolerance.Thank you!

author: Terry Bites
author_rank: Super Contributor
timestamp: March 14, 2023, 09:08:22 pm
content: MCUs are overkill I agree. Some counter/ timers and glue logic (hopefully no monos) from the good 'ol 4000 series will do it.They never forget their code.I'm sure there are some degenerate 555 addicts working furiously as we speak. Why haven't the FPGA guys perked up yet, cummon!

author: shapirus
author_rank: Super Contributor
timestamp: March 14, 2023, 09:28:37 pm
content: Quote from: Terry Bites on March 14, 2023, 09:08:22 pmI tried but failedHad to revert to 4017.p.s. my circuit doesn't implement the 10-second input ignore period after a cycle, I forgot to add it. But it's easy: add another RC delay via the last unused channel of 40106 to the E input of the 4017 and power it from Q0.

author: floobydust
author_rank: Super Contributor
timestamp: March 14, 2023, 09:46:00 pm
content: One thing to consider is water ingress into the door switch. They do get wet and a car maker had their door solenoids burn up, if people left the window open and it rained and the switch got wet, always on. Toyota uses an internal PTC to protect their door solenoids as well.I would use a small MCU because it's easy to add a delay or counter or blinking LED etc. compared to making hardware changes and a new board build.I made a small MCU in my car for years now providing accessory power after key-off for charging a phone/stereo etc. and no problems with it.Would have used CMOS logic or 555 timers 25 years ago but there's nothing so scary about MCU's and they are the future.

author: BillyO
author_rank: Super Contributor
timestamp: March 14, 2023, 09:52:03 pm
content: Quote from: Terry Bites on March 14, 2023, 09:08:22 pmIt's only overkill if it is also more expansive or harder to do, however this is not the case.Where are the good ol' tube guys?Other than a tiny bit of protection circuitry and a MOSFET (cheaper than a relay) the MCU solution requires only a $2 MCU. Technology marches on, and while I am a luddite in the truest sense of the term, I can see the writing on the wall for "Some counter/ timers and glue logic (hopefully no monos) from the good 'ol 4000 series" vs. a single 8-pin chip which can be altered at a whim without working out a new schematic, a new BOM and getting new boards done up.

author: BWK
author_rank: Contributor
timestamp: March 14, 2023, 11:39:52 pm
content: Quote from: BillyO on March 14, 2023, 09:52:03 pmI was 7 years old or thereabouts when I did my first electrical repair. It was a black & white tube TV set that someone in the family asked me to look at. I think all I did was unplug the tubes and plug them back in and somehow it worked. That was a long time ago!Most of the boards I fix for these coaches are using old school logic circuits. I have quite a stock of the 4000 I/Cs because they have failed in a lot of the boards I repair but many of those same boards are seriously lacking with it comes to input protection. I like this 'jellybean' stuff because it is something I can understand and fix. But when I started playing with those cheap timer modules from Amazon & eBay, with their numeric displays and multiple functions, I knew it was time to start figuring out MCUs. They were getting a whole lot more functionality out of whole lot less components than anything I have made, and they held up great at all my attempts to get them to fail. None of my methods at reproducing transients and noise at the 12V input could be called scientific, but I think I had abusive nailed pretty goodAbsolutely love this forum and how active it is, lots of cool people with great ideas. I'm an electronic neanderthal but I don't feel unwelcome, it's very neatWife keeps telling me I need to start saying no when someone wants something fixed and I should wise up, but my mouth keeps saying yes even while my brain is yelling no internally. Want me to fix the Space Shuttle? I can do that. Might take be about 25 years to pick up a few skills here and there but no problem

author: BWK
author_rank: Contributor
timestamp: March 14, 2023, 11:47:17 pm
content: Quote from: floobydust on March 14, 2023, 09:46:00 pmThank you for that. I forgot that consideration. I need to somehow block a new activation cycle in programming until the door switch has been released for a short time period. I think I know to be careful about overcomplicating the delays and triggers or I might end of with a circuit that won't function if the switch is less than perfect but I'm sure I can find a happy middle ground. That was a good catch, thank you!

author: shapirus
author_rank: Super Contributor
timestamp: March 15, 2023, 09:27:37 am
content: Quote from: BWK on March 14, 2023, 11:39:52 pmI've had no experience with MCUs before and after some time of having interest in them, but always postponing because of the (imaginary?) hassle with programmators and writing in asm I finally bought a couple of RP2040-compatible development boards on aliexpress.I'm impressed. They're dirt cheap. They have a USB interface, and, when connected to a computer, it sees the controller as a mass storage device, where you just copy the binary file that contains your program, and it begins execution. SDK (C & python) is very beginner-friendly and well-documented, there's a shitload of "hello world" examples for every possible function of the chip.So, very very easy to get started. And the program for what you need would be very easy to write in either C or python. And it, as others have already said, it won't need many external components: 1) a USB charger to power it; 2) a MOSFET driver (which can be made of discrete elements) to drive your switch with 3.3V logic level.p.s. they even have an ADC! but don't have a DAC, which is a bit of a bummer.