Circuit design to hold one relay and pulse another and the reverse - Page 1
Forum section: electronics / beginners

author: money2bills
author_rank: Newbie
timestamp: December 07, 2021, 01:36:29 am
content: Hello,I am looking for some advice. I would like to build a circuit with two buttons, after pressing the first buttonrelay onewould turn on for two seconds and pulserelay twoone second afterrelay onewas switched on. Then for the second button,relay twowill turn on for two seconds andrelay onewill pulse a second afterrelay twois switched on.I have been looking into using a 555 time for delays and creating this circuit. I would like to know if this is a good starting point for what I would like to accomplish?If there is a simpler way to accomplish my goal here can you please let me know what I should look into.Relay oneandrelay twoin this example will change the resistance of another circuit to the desired resistance momentarily.Thank you for any advice and help getting me on the right path.

author: Steffalompen
author_rank: Contributor
timestamp: December 07, 2021, 01:45:30 am
content: Probably doable with several 555s, but oof. For once I'm going to suggest an Arduino.

author: SmallCog
author_rank: Frequent Contributor
timestamp: December 07, 2021, 01:54:35 am
content: I'd be using an arduino (or similar) for thisUNLESS it's something related to safety. I don't trust cheap micros and my own code with the safety of people.Might not be a safety thing but it just sounds like some sort of industrial process or somethingIf it is use a proper industrial PLC

author: money2bills
author_rank: Newbie
timestamp: December 07, 2021, 02:04:26 am
content: Thank you Steffalompen and SmallCog for the advice. I will continue to try to make this work with 555 chips.

author: themadhippy
author_rank: Super Contributor
timestamp: December 07, 2021, 02:06:53 am
content: How about coming at it from a different direction,1 timer for your 2 second on time and a second timer to give the one second delay. 1 switch selects which timer goes to which relay and the other button starts the timer

author: AndersJ
author_rank: Frequent Contributor
timestamp: December 07, 2021, 03:09:03 am
content: This sounds like a XY problem.https://en.wikipedia.org/wiki/XY_problemPerhaps it is better to describe what you are trying to design.

author: ledtester
author_rank: Super Contributor
timestamp: December 07, 2021, 03:28:33 am
content: I agree an Arduino is the easiest way to do this.You might find using CMOS logic easier to design with than 555 timers. At the end of this pagehttp://www.talkingelectronics.com/ChipDataEbook-1d/html/74C14.htmlthere is a circuit which seems to do exactly what you want with a single hex inverter chip:Conceptually it works like this: the first two inverters produce a pulse when the button is pressed and released. The pulse output (pin 4) is sent to a rising edge detector and a falling edge detector. Each of these detectors controls a relay. You can control how long each relay is kept on for through the 1 Meg pots.

author: james_s
author_rank: Super Contributor
timestamp: December 07, 2021, 03:29:09 am
content: This is one of those cases I'd definitely just throw a small microcontroller at. Something cheap like a ATTINY12 or whatever is the cheapest most readily available 8 pin part you can get. It's about 10 lines of code that even an absolute beginner could write fairly easily. It's only one notch above a blinking LED "Hello World" program.

author: money2bills
author_rank: Newbie
timestamp: December 08, 2021, 12:09:31 am
content: As requested a better description of what I am trying to do. There are two wires (signal wires) that detect the current change when the resistance of the wires are changed. I was able to determine the proper resistance for each wire and the resistor in parallel.Relay one and two will close when energized by the trigger wire to change the resistance for that signal wire. The added complication is one relay will need to be held energized and while that relay is held on the second relay needs to pulse quickly on and off. Then both relays can return to the normally open position. Both relay one and two will be normally open when not triggered.Picture of the circuit is added below to illustrate what I am doing. I like the idea several of you have mentioned of using a small microcontroller.Will the ATTINY85 work well for this purpose? Looks like I can buy one and attempt to create a circuit/code relatively cheaply on Amazon and other websites.Do these ATTINY85 chips pull much power when idle and not in use?Thank you again to everyone for the advice so far.

author: ledtester
author_rank: Super Contributor
timestamp: December 08, 2021, 02:12:32 am
content: Quote from: money2bills on December 08, 2021, 12:09:31 amYes, but get an Arduino Uno or an Arduino Nano - it will be a lot easier to program them.QuoteGenerally no, but everything is relative. What do you consider "much"? What's your power source - batteries or an AC adapter?

author: Steffalompen
author_rank: Contributor
timestamp: December 08, 2021, 02:15:17 am
content: The Attiny85 should do fine.It uses 1mA at 1MHz and 200uA in sleep mode.-ish.But I found it quite the learning curve compared to the Arduino infrastructure.

author: james_s
author_rank: Super Contributor
timestamp: December 08, 2021, 02:23:49 am
content: A Tiny85 is massive overkill but it will work if that's what you can get. I typically use a Tiny13a for simple stuff like this, they were the cheapest AVR I could find at the time I bought a handful of them.It's possible to get the standby power down to microamps, I have some battery powered projects that get well over a year from a CR123A cell. You have to run directly from the battery though to do that, the quiescent draw of a typical linear regulator will dwarf what the micro draws when idle. The key is to have it spend most of its time sleeping and then use a timer interrupt to wake it up periodically.The Arduino ecosystem supports the Tiny85 directly, and there is a way to use the smaller AVRs too if you prefer to use that instead of C.

author: Steffalompen
author_rank: Contributor
timestamp: December 08, 2021, 12:12:53 pm
content: Whenever I hear mention of the 85 I always assume eBay chips and/or the Arduino adaptation you mention.I like to go with the smallest possible for sport and to get into a mindset of mass production.But I don't see why to save a dollar on a one-off beginner home project, especially with an Arduino as an alternative.

author: Zero999
author_rank: Super Contributor
timestamp: December 08, 2021, 01:29:42 pm
content: Quote from: SmallCog on December 07, 2021, 01:54:35 amI would trust an Arduino over a 555, which is very prone to spurious triggering.If it's for safety, use a safety PLC, with the appropriate performance level.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 08, 2021, 01:52:42 pm
content: I do not recommend using such a small microcontroller.It does not have any advantage compared to somewhat bigger microcontrollers.Even though I despise arduino, the "arduino nano" is a quite usable microcontroller board, and easy to work with on a breadboard or on matrix board.Price is low enough so you can easily buy a handful of them, and use them for various projects. If you standardize on a single controller for your first bunch of projects then you have one less factor to worry about. Once you've gained more experience you can up or downscale to another microcontroller if that is needed for your project.

author: Steffalompen
author_rank: Contributor
timestamp: December 08, 2021, 03:21:38 pm
content: One thing not mentioned is unlike the 555 a uC would require output transistors and such to drive a relay.

author: james_s
author_rank: Super Contributor
timestamp: December 08, 2021, 08:15:33 pm
content: Quote from: Doctorandus_P on December 08, 2021, 01:52:42 pmSure it does, it's cheaper, and it's less wasteful when you have a trivial application like this. On the contrary, the larger microcontrollers have no advantage compared to the smaller ones for a very simple project. Literally any microcontroller on the market will handle this project.

author: james_s
author_rank: Super Contributor
timestamp: December 08, 2021, 08:16:37 pm
content: Quote from: Steffalompen on December 08, 2021, 03:21:38 pmI think I would use an output transistor with a 555 too even if not strictly necessary. A 2N3904 or similar and a single resistor cost pennies and will do the job.

author: ledtester
author_rank: Super Contributor
timestamp: December 09, 2021, 05:13:09 am
content: Quote from: james_s on December 08, 2021, 08:15:33 pmBig or small mcu, consider things from the OP's perspective...Given that the OP is seemingly unaware of microcontrollers the most expensive aspect of this project will be the code development time. That includes setting up the dev environment, learning how to compile code, upload code and just how to get things done on the mcu. In that regard I'd almost recommend starting with a Raspberry Pi, especially if the OP is already familiar with Python programming.Also, this seems to be a one-off project so you won't be able to amortize the development cost over multiple copies of the device.

author: Zero999
author_rank: Super Contributor
timestamp: December 09, 2021, 08:56:34 am
content: Quote from: ledtester on December 09, 2021, 05:13:09 amYes, that's definitely true. In an industrial control setting, the answer would normally be a simple PLC. Indeed, it might be something the original poster could try.Quote from: money2bills on December 08, 2021, 12:09:31 amHow about a cheap PLC (Programmable Logic Controller)?https://aceautomation.eu/http://plccompare.com/cheap-plcs/