another dumb question?

afternoon everyone

its time for another dumb question from me but this time its a more generic electrical related issue.

as some of you may of seen i have been working on a remote bluetooth control system for lighting in a trailer.

but i also want to have physical switches in the trailer that i can use to turn lighting on and off independant of the ardunio setup,

im running an arduino uno r3 and using a 8 way relay system to turn lights on and off from the ardunino.

the relays are dual pole having both a NC and NO contacts,

currently i am running the 12v feed from the batteries into the com on each relay but i am happy to rewire as needed as still prototyping the final setup presently

how would i be best to run switches for this.

Draw a schematic for your circuit for just ONE relay and the light it controls. Do you see a way to add a switch to do what you want?

Paul

Paul_KD7HB:
Draw a schematic for your circuit for just ONE relay and the light it controls. Do you see a way to add a switch to do what you want?

Paul

i do indeed see a way but i am worried about damaging the relays by potentially backfeeding them with voltage ?

Drawing a schematic means we will be able to help you avoid such issues...

Hi,
If you leave a switch ON at the panel inside the trailer, do you want to be able to turn it off with the BlueTooth?

Tom… :slight_smile:

TomGeorge:
Hi,
If you leave a switch ON at the panel inside the trailer, do you want to be able to turn it off with the BlueTooth?

Tom… :slight_smile:

it would be nice but not A critical requirement if its a real pain to do :slight_smile:

dmpdiscos:
i do indeed see a way but i am worried about damaging the relays by potentially backfeeding them with voltage ?

Sorry, that appears to be gobbledegook! :astonished:

Paul__B:
Sorry, that appears to be gobbledegook! :astonished:

i dont see how it is ?

dmpdiscos:
i dont see how it is ?

Because it doesn't make any kind of sense? Are you here for help and advice, or just a strop?

Elo elo elo Wots goin on ere then ?

Some things to consider:

Do you want to be able to control the state of the light blind, or just toggle it?

What I mean is do you want to be able to command "light off" and "light on", or are you happy with
"change state of light".

And that applies both to the Arduino and the manual switches.

Unless the answer to both questions is "just toggle it", you'll need to decide which control method takes
priority, which affects how things get wired.

What about being able to select "automatic mode" from the manual switches?

MarkT:
Some things to consider:

Do you want to be able to control the state of the light blind, or just toggle it?

What I mean is do you want to be able to command "light off" and "light on", or are you happy with
"change state of light".

And that applies both to the Arduino and the manual switches.

Unless the answer to both questions is "just toggle it", you'll need to decide which control method takes
priority, which affects how things get wired.

What about being able to select "automatic mode" from the manual switches?

blind would be fine as i foresee most of the time the lights will be controlled by my remote connection to the arduino, but the switches will need to be able to override the arduino control for if a friend need to use trailer and wants to control the lighting for any reason, - in my code for the arduino i am just toggling the lights based on input not doing any real checks on if the light is already triggered.

i also dont know weather having the switches interface with the arduino (which is 99% of the time asleep) and use it to do the power on/off or just have the switches run directly bypassing the relays etc.

my past experience would be to bypass the relays

This question arises not infrequently in the “domotics” context.

An Arduino is a “smart” device which you can program to make decisions.

The smart way to utilise it is to program it to do whatever you need it to.

In this instance, what makes the most sense is to use the Arduino to control the relays which switch the lights. What they cause the lights to do may be as a result of Bluetooth commands. If you wish to control them by wall switches, then you connect those switches to the Arduino and decide - in code - how to reconcile remote control commands with wall switch commands.

The most straightforward way of doing this is to use momentary buttons which toggle the lights on and off with each press, then you do not have to be concerned whether up or down is “on”. If the lights are in plain sight, you do not need an indicator on the switch to tell you whether they are on.

My preference would in fact be to use touch sensors instead of buttons using the TTP223 modules.

Paul__B:
This question arises not infrequently in the "domotics" context.

An Arduino is a "smart" device which you can program to make decisions.

The smart way to utilise it is to program it to do whatever you need it to.

In this instance, what makes the most sense is to use the Arduino to control the relays which switch the lights. What they cause the lights to do may be as a result of Bluetooth commands. If you wish to control them by wall switches, then you connect those switches to the Arduino and decide - in code - how to reconcile remote control commands with wall switch commands.

The most straightforward way of doing this is to use momentary buttons which toggle the lights on and off with each press, then you do not have to be concerned whether up or down is "on". If the lights are in plain sight, you do not need an indicator on the switch to tell you whether they are on.

My preference would in fact be to use touch sensors instead of buttons using the TTP223 modules.

thank you for the very valuable information, that is the route i think i am going to go although i will use normal on off switches (purely as i have a massive stock of them :slight_smile: )

but,

how can i link these to the arduino as i am basically out of digtal pins on the device (i have 12 and 13 left after the bluetooth tx and rx and the 8 relay outputs) - i could possibly change to a Arduino DUE but the power draw off that is more than i would like for 24/7 power usage.

i admit i am not greatly clever with microcontrollers so i am certain this is something simple to deal with

What are you doing with digital pins 14 to 19 on the opposite edge of the board? :astonished:

Paul__B:
What are you doing with digital pins 14 to 19 on the opposite edge of the board? :astonished:

unless i am blind the arduino UNO r3 that i am using presently only has 13 digital pins on the board ? - happy to be corrected though

dmpdiscos:
unless i am blind the arduino UNO r3 that i am using presently only has 13 digital pins on the board ? - happy to be corrected though

Your 13 is actually 14, since it starts from 0; but for practical purposes 0 and 1 are not used as normal i/o since they are the serial port.

The analog inputs A0 to A5 are digital pins too. You can digitalWrite() and digitalRead() them just as the pins 0-13. You can refer to them either as A0 to A5, or count on from 13 as 14 to 19; thus for example:

digitalWrite(A2);
// same as
digitalWrite(16);
// or
digitalRead(A5);
//same as
digitalRead(19);

twinkleyan:
Your 13 is actually 14, since it starts from 0; but for practical purposes 0 and 1 are not used as normal i/o since they are the serial port.

The analog inputs A0 to A5 are digital pins too. You can digitalWrite() and digitalRead() them just as the pins 0-13. You can refer to them either as A0 to A5, or count on from 13 as 14 to 19; thus for example:

digitalWrite(A2);

// same as
digitalWrite(16);
// or
digitalRead(A5);
//same as
digitalRead(19);

aha that makes sense if a bit confusing to make sense of :), i am using a4 and a5 for my voltage and current sensors but i have the others available so i MAY actually have enough pins left. (by my maths 6)

is their any way to turn the 0 and 1 pins from serial to usable control pins as when system is running live i will have no access to the base serial terminal,

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :slight_smile:

TomGeorge:
Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :slight_smile:

i will indeed try to do a basic drawing though i know it will be very messy :slight_smile: