trouble with multiple realys

Wawa:
Five or more relays active could release the magic smoke.
Leo..

I am only running 4 relays at a time, Is this ok? Should I power it with an external power supply?

avr_fred:
, I could not saturate a 2N3904 by touching the base but I could see noise on the collector when touched so I figured it would do no harm. Better to have it and not need it than to need it and not have it...

I don't know if this condition can occur without seeing the back side of the stickers but I'd rather you didn't find out the hard way...

I do not think I can get the 2N3904 in in time because I have limited to any electronics stores in my area, do you know of any products they would be in that I could gut it out? The back of the circuit sticker looks like this.

It is basically two plates and we are connecting two copper leads to make them illuminate.

eagon:
I do not think I can get the 2N3904 in in time because I have limited to any electronics stores in my area, do you know of any products they would be in that I could gut it out?

Ok I take that back there are a ton of NPN transistors at frys electronics in Downers Grove IL and that is somewhat close to me, I have no idea what type to get because when I search 2N3904 nothing shows up because it is in the spec sheets per item

Could someone help me find one to use? I am running this circuit with 6 trinkets and 1 per sticker I would need 24 NPNs correct?

Four relays is 320ma, that's pushing it but you should be okay. The better way to connect the relays is to connect the relay VCC terminal to the Trinkets VBUS terminal, not the +5V terminal. It's just one pin away. Using VBUS connects the relay supply directly to the USB power rather than through the reverse polarity diode, that diode is what Leo mentioned above. Overall, most USB supplies are limited to 500ma max anyway so you're close but okay. Moving that supply wire to VBUS decreases the load on the diode and decreases the risk of accidentally resetting the processor when relays turn on.

No Radio Shacks around? Any general purpose NPN signal transistor should work. There would be a thousand part numbers that would okay, I just gave you one number that is common. 2N2222, BC547, 2N5550 and on and on and on... What do you have laying about that you could scavenge?

Fry's: the NTE parts are generic "substitutes". They'll work fine, you just pay ten times what they're worth. This one appears to be in stock.

http://www.frys.com/product/1798418?site=sr:SEARCH:MAIN_RSLT_PG

Interesting... I just used the NTE site to cross the 2N3904 over to their numbers. Came back with NTE123AP. Fry's has them but they are $1.99 each. :slightly_frowning_face: Not required though, the NTE47 should be fine.

At this point, I honestly don't know how many you need. You say six Trinkets. The docs show 4 inputs per, that would be 24 inputs which would need 24 transistors. Given the way this has played out, I'd buy four and test unless you can return them if things don't work out. There should be some benefit to paying those prices!

avr_fred:
Interesting... I just used the NTE site to cross the 2N3904 over to their numbers. Came back with NTE123AP. Fry's has them but they are $1.99 each. :slightly_frowning_face: Not required though, the NTE47 should be fine.

That is expensive, should I go with the generic one or would it be better if I went with the expensive one? EDIT: I have to go with the expensive ones because there are only two in stock at the store of the cheaper ones. *sad face All of our Radio Shacks are going out of business, we used to have three pretty close to us but they are all gone now over the course of the last 3 months. :cry: :cry: Also thank you so much for all your help on this project, you are super awesome and really nice! :wink: :smiley:

Whoa, just a second. After walking away from this and looking at the problem fresh, there is a better way. You don't need the transistors. It's the way you already tried but it needs a tweak...

Now that I know what the "sticker" is, your original method of using analog input will work but you need a pull-down resistor for two reasons. One, you need the analog pin to be at zero volts with nothing connected and two, you need a relatively low resistive path for the diode current so it will illuminate when connected.

You just need an approximately 50 ohm resistor from the analog input to ground. The AI should be 0 to 5 counts with no LED and between 30 to 50 counts with an LED in place. The final number will depend on the LED color and the resistor value mounted on the sticker.

We ran this circuit and tweaked the code to run off the analog pins. Should it be reading for a value? The original code had it reading for a value to change the relays. This one lights up not as bright but does not fire the relays.

The original code had it reading for a value to change the relays.

Yes it did. Greater than 25 means there is a LED present. Less than 25 is no LED. The sketch I posted back in message #9 is what you should be using for this input method, I tested it and it works.

This one lights up not as bright but does not fire the relays.

Measure the voltage on the analog pin when an LED is in place. You should measure something in the range of 0.25 to 0.8 volts. This represents about 50 to 160 analog counts which should function correctly in the sketch. The pull-down resistor could perhaps be lowered to something around 22 ohms which would make the LED a bit brighter but we would have to adjust the test value in the code accordingly.

One of things you might be fighting is a gradual change in the conductive adhesive in the LED sticker. If you are sticking it on the foil strips which are on paper, it will pick up paper fibers which act as insulators or the adhesive gets coated with oils and other foreign material from your fingers. Ultimately, they will degrade with continued use, something the conductive adhesive is not designed for, it's meant for one time application in RF/EMI shielding of cases and enclosures.

avr_fred:
One of things you might be fighting is a gradual change in the conductive adhesive

Yeah, we fought this in the beginning of the project and will be having them as one time use on the sticker portion but for testing we just touch the tops of the sticker leads.

Joe came in and had some extra transistors so we tossed them in for all four circuit sticker and put a 100 ohm resistor on the positive side and it looks great! Since we have the transistors on order I think we might go this way,(if you think its ok).

I see four 100 ohm resistors, one each attached to the base of each transistor. In that way, no matter what happens, the base current is still limited.

If it were a fixed circuit, it would not matter where it was in the path, above or below the sticker but that not the case here. But, I cannot say for sure here because I do not know how the foil strips and other parts of this thing are arranged.

Normally, you would have a common bus for the +5 supply and the leads to each input. You want the resistors in series with each input, not on the common +5 line since that would lower the current to all LED's.

avr_fred:
I see four 100 ohm resistors, one each attached to the base of each transistor. In that way, no matter what happens, the base current is still limited.

If it were a fixed circuit, it would not matter where it was in the path, above or below the sticker but that not the case here. But, I cannot say for sure here because I do not know how the foil strips and other parts of this thing are arranged.

Normally, you would have a common bus for the +5 supply and the leads to each input. You want the resistors in series with each input, not on the common +5 line since that would lower the current to all LED's.

Yeah we have one resistor per led circuit., so I cant do one 5v line and multiple GND pins? I need a separate 5v with transistor and resistor and each ground (because its connected to my output pin) correct?

I honestly cannot figure out what you're saying.

According to your schematic, only the relay is connected to an output pin. Inputs and outputs should NOT be connected together. I asked about this before there was a schematic posted only because I did not understand how things were connected. Yes, inputs and outputs share a common or GND connection point but this is normal for any circuit.

As I see things, you have one +5 volt supply point which is common to all LED stickers. From the remaining connection point on each LED sticker, that connects to a 100 ohm resistor in series with each transistor base. From there, each transistor has its own (digital) input pin. Each relay has its own (digital) output pin.

Hi,

Now that I know what the "sticker" is,

@avr_fred, well tell me cos I'm completely confused.
How does that sticker with a LED and resistor on it, switch when pressed?

Or does the OP use a switch, connect a wire, to supply the sticker to make it glow and want it to signal the Arduino input, then software to control a relay?

The OPs pic shows these 'stickers everywhere but in circuit.

Tom... :slight_smile:

@avr_fred I was able to figure it out, I had to change the program a little bit because the project had one relay per led strip so I set all the input pins to the one relay. It works correctly by sending a signal 4 times before starting over which would be ideal because the circuit sticker stays on the nodes continuously. Then after all four trigger they take the sticker off. We hard wired it all together in a project box with terminal outs to attach to the relays and circuit sticker inputs. I will post pics tomorrow or wednesday.

TomGeorge:
Or does the OP use a switch, connect a wire, to supply the sticker to make it glow and want it to signal the Arduino input, then software to control a relay?

Tom... :slight_smile:

Yes, the sticker is the switch once connected it completes the circuit it itself lights up and sends a signal to the arduino to trigger the relay to set lights on for x amount of seconds.

I'll post pics soon. Project end time is coming up! Thanks Avr_Fred again!!

Hi,
This is why it was confusing;

Where are the switches?

Tom.... :o :o :o :o
Eagerly awaiting your new schematic.

avr_fred:
Four relays is 320ma, that's pushing it but you should be okay. The better way to connect the relays is to connect the relay VCC terminal to the Trinkets VBUS terminal, not the +5V terminal. It's just one pin away. Using VBUS connects the relay supply directly to the USB power rather than through the reverse polarity diode, that diode is what Leo mentioned above. Overall, most USB supplies are limited to 500ma max anyway so you're close but okay. Moving that supply wire to VBUS decreases the load on the diode and decreases the risk of accidentally resetting the processor when relays turn on.

So we got a few more days on the project its now due tomorrow, we got our main trinket boxes wired up but we have it connected to vbus and ground. Though you can trigger the output leads just by touching the pos lead, we are only running two relays on a four relay board can we switch to 5v instead of vbus or can will the vbus on bottom of the trinket for the circuit?

So we got a few more days on the project its now due tomorrow, we got our main trinket boxes wired up but we have it connected to vbus and ground.

Vbus can supply more current than the 5V pin. Is there a problem using Vbus? If so, please explain.

Though you can trigger the output leads just by touching the pos lead,

What is a pos lead? Please explain what you are doing and what "pos" means. Never connect Vbus or 5V to a pin configured as an output, you can damage the processor.

we are only running two relays on a four relay board can we switch to 5v instead of vbus or can will the vbus on bottom of the trinket for the circuit?

Please slow down and re-read what you type before you click post, please?

Getting the help you need on a message board depends mostly upon your written communication skills, which need some polish. I spend more time decoding your posts rather than answering questions. I don't want to discourage your efforts and experimentation but you need to work on using consistent terminology and writing complete, concise questions.

yep, sorry about the writing.

So doing testing, we ran into a lot of noise on the reader pin? Is there anyway to decrease noise?

Also this is the setup.

Is it correct? Made it following your NPN diagram, It may be incorrect.

The circuit sticker lights up and triggers the relay normally. However you can trigger the relay just by touching (with your finger) the positive (pos) of the circuit as if it was going into the circuit sticker. Without touching the opposite side.

Here

Hi,
I think your circuit should be like this;


Or are you using the input with transistors?
Tom... :slight_smile:

TomGeorge:
Or are you using the input with transistors?

Digital inputs with transistors

Hi.
Okay, can you post a picture of your project please?

Thanks.. Tom.. :slight_smile: