Multiple buttons on Flip/Flop

Hi there,

I’m new to this so please bare with!

I have a simple flip/flop relay circuit that all works fine. There is a button (ALL OFF) that switches off any relays that are currently on.

I need to add a second button that works the same as the “ALL OFF” button, but only kills relay “2” and “3” without touching relay “1”

Any help would be awesome!

Thanks in advance!!!

Hi,

as far as I understand you, your picture doesn’t really match your description.
But for the connection of two buttons to one reset, you can use the xod/core/or-node.

The things I think you need to change, if you want your picture to match your description:

  1. connect the Off-buttons to the RST-Inpus of the Flip-Flops
  2. use not-nodes because the buttons send always HIGH if they are not pressed

The following picture should be what you want, or I am wrong xD

Hope it helps.

Hi there,

Thanks for your reply! Works a treat!

All the best.

Hi,

Hope you don’t mind me hassling you again!?

This relay switching thing i’m working on is to control the lighting system in a camper I’m currently building.

The individual “Flip/Flop” circuits (there’ll be more than 3 on the final system" are for switching separate lighting circuits (front ceiling lights, locker down lights, floor lights, bed area lights etc etc) then there will be linked buttons like the “ALL OFF” that will control different “zones” in the van (a button near the door that can turn all light off and another in the bed area that can turn all the front lights etc etc). Currently I’m just switching relays that are connected to each lighting circuit.

I was wondering if there’s a popular/commonly used 12v LED control board that uses the PWM outs from arduino to “dim” 12v LED circuits? Possibly a RGB board that I could use as a 3ch dimmer? Each output would need to handle 2a to be safe.

The reason I ask is that it would be nice to have each lighting circuit dim up or dim down when switching the lights on or off and potentially include some pots for manually dimming individual lights etc.

Sorry for the long message! It’s hard to describe what I’m trying to achieve ha!

Many thanks,
Simon

Do an internet search for “arduino i2c pwm” for several options depending on how many light circuits you want to control. I2C interface will probably be the easiest to work with for controlling the PWM board. If you can find a board for which there are already built-in nodes in XOD or XOD library, your program will be that much easier to write (like bradzilla84/i2c-pwm-servo-16ch — XOD). PWM board probably won’t be able to handle 2A, so you will need to use a transistor or MOSFET with PWM output controlling power level (or use motor controllers to drive each circuit, but that would be over-kill since you probably wouldn’t use reverse).

Note that you will not be able to use a simple flip-flop to store state if you want to be able to dim the lights. Unless the PWM board gives you a way to read current values, you will need to store those values in your code (probably using a buffer node). You might still want to keep flip-flop if you want to remember previous brightness while circuit is off.

There are other discussions on this forum for code to allow button-hold to increment values continuously or quick press to increment by one. You could use similar code to use button press to turn lights on/off or button hold to dim/brighten lights. You could just use one POT for each light circuit, but you would have to walk over to the POT, not have a POT next to each switch. Another option would be to use a rotary encoder for dimmer; maybe assume you want to bright/dim the last circuit turned on/off (but that requires code to remember which circuit you are changing). Trying to allow dimmer for switches controlling groups of circuits is doable, but it will be more complicated (for example, what is your starting value if all circuits do not start with same value; do you change each circuit separately, or force them all to same value?).

Lots of options. I would suggest writing the code that lets you set your light levels that just has watch nodes to see values, then figure out how to push those values to the PWM control board and drive your lights from it. If you try to do everything at once, you will probably be over-whelmed. If you break it into smaller chunks, you can see progress as you build each piece.

Sounds like I’m probably wanting a bit too much for my very limited knowledge of this stuff atm. I’m happy with the simple switching relays I have at the moment but thought a smarter system with dimmable circuits would be nice.

Appreciate your reply, thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.