Author Topic: Help needed with circuit design  (Read 1805 times)

0 Members and 1 Guest are viewing this topic.

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Help needed with circuit design
« on: March 13, 2023, 04:34:37 pm »
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 :)
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1980
  • Country: us
Re: Help needed with circuit design
« Reply #1 on: March 13, 2023, 05:58:42 pm »
I don't see why you can't ask...  What is this circuit supposed to do?  Inputs? Outputs? Power?
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: BWK

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #2 on: March 13, 2023, 07:04:36 pm »
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.

 
The following users thanked this post: Someone

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #3 on: March 13, 2023, 07:10:59 pm »
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.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5140
  • Country: ro
  • .
Re: Help needed with circuit design
« Reply #4 on: March 13, 2023, 07:27:46 pm »
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.
 
 
The following users thanked this post: BWK

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #5 on: March 13, 2023, 07:32:11 pm »
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 now :)  I found a site called fiverr.com that looks like it might work for my design needs right now.  Thank you!
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1713
  • Country: ca
Re: Help needed with circuit design
« Reply #6 on: March 13, 2023, 07:39:31 pm »
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.
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
 

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #7 on: March 13, 2023, 07:55:04 pm »
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.
 

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1713
  • Country: ca
Re: Help needed with circuit design
« Reply #8 on: March 13, 2023, 08:18:06 pm »
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.
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
 
The following users thanked this post: BWK

Offline sparkydog

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
Re: Help needed with circuit design
« Reply #9 on: March 13, 2023, 10:17:40 pm »
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.

Good, 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 is also an inductor?

I have the same problem in my project, which I am almost universally addressing with SA18CAs. A typical MOSFET can handle some reverse 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.

I should also note that solenoid inrush is probably about 10amps.

Many EMRs can handle 10A continuous. If you're really paranoid, Omron has some UL TV-8 rated relays that are rated for 16A continuous and (IIUC) 117A inrush, which sounds like it's probably overkill for your use.
 
The following users thanked this post: BWK

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
Re: Help needed with circuit design
« Reply #10 on: March 13, 2023, 10:47:53 pm »
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.
« Last Edit: March 13, 2023, 11:39:01 pm by shapirus »
 
The following users thanked this post: BWK

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #11 on: March 14, 2023, 02:41:42 am »
Good, 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 is also an inductor?

I have the same problem in my project, which I am almost universally addressing with SA18CAs. A typical MOSFET can handle some reverse 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.

That 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 me :)

Great input, thank you :)
 

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #12 on: March 14, 2023, 02:52:11 am »
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.

Why did I wait until now to jump on a message board and ask for help :)   This 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 route :)  I'll make try this too but so much appreciate the time and effort put into this response.  Thank you for that!
 

Online fourfathom

  • Super Contributor
  • ***
  • Posts: 1980
  • Country: us
Re: Help needed with circuit design
« Reply #13 on: March 14, 2023, 02:58:53 am »
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.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 
The following users thanked this post: BWK

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3248
  • Country: us
Re: Help needed with circuit design
« Reply #14 on: March 14, 2023, 03:02:10 am »
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

 
The following users thanked this post: BWK

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #15 on: March 14, 2023, 03:50:09 pm »
If you do want to go the microcontroller route (lots of good reasons to to that.............

Thank 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!
 

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #16 on: March 14, 2023, 04:02:41 pm »
There are "programmable relay modules" available on Amazon, e.g............

I 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!
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2513
  • Country: gb
  • Recovering Electrical Engineer
Re: Help needed with circuit design
« Reply #17 on: March 14, 2023, 09:08:22 pm »
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!
 
The following users thanked this post: BWK

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
Re: Help needed with circuit design
« Reply #18 on: March 14, 2023, 09:28:37 pm »
I'm sure there are some degenerate 555 addicts working furiously as we speak.
I tried but failed :(
Had 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.
 
The following users thanked this post: BWK

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7473
  • Country: ca
Re: Help needed with circuit design
« Reply #19 on: March 14, 2023, 09:46:00 pm »
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.
 
The following users thanked this post: BWK

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1713
  • Country: ca
Re: Help needed with circuit design
« Reply #20 on: March 14, 2023, 09:52:03 pm »
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!
It'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?  :-DD

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.  :-//
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
 
The following users thanked this post: BWK

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #21 on: March 14, 2023, 11:39:52 pm »
Where are the good ol' tube guys?  :-DD

I 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 good :)

Absolutely 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 neat :)  Wife 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 :)
 

Offline BWKTopic starter

  • Contributor
  • Posts: 11
  • Country: us
Re: Help needed with circuit design
« Reply #22 on: March 14, 2023, 11:47:17 pm »
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.

Thank 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!
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
Re: Help needed with circuit design
« Reply #23 on: March 15, 2023, 09:27:37 am »
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.
I'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.
« Last Edit: March 15, 2023, 09:39:15 am by shapirus »
 
The following users thanked this post: BWK


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf