News:

Forum may be experiencing issues.

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - greysun

#16
Quote from: mjg on January 09, 2024, 08:53:34 PM
Using a 555 would probably work, but all it's doing there is being a voltage controlled switch.  Which is the same as a transistor or mosfet really.  Not sure it will get you anything different to what you've already tried?

You are probably right, and that 555 circuit doesn't work anyway. But I just can't get the other inverter circuits to work with this relay - like I said, I'm able to invert the voltage with a logic NOT gate, but once I connect each to the coil pins, the voltage drops and nothing happens when I trigger the coil, as if it's just connecting the 2 NOT gate circuits to one another through the coil instead of .

I just did a quick test using NOT gate with the s8050 - one of the NOT gates on one side of the relay coil at 0v, and direct 5v (straight from power source) on the other side of the relay coil. This setup snaps the relay when I swap the pins, so the relay works, and I know that at least the NOT gate at 0v will work. 

I then did the same test with one of the NOT gates at 5v, the other at 0v. Doesn't work when I swap the pins.

Am I missing a diode(s) between the NOT gates and the relay pins that would keep the voltage from going back to the collectors? I can't figure it out...
#17
Furthering the 555 timer, it seems like I could do something like this: https://www.eeweb.com/voltage-controlled-switch-using-555-timer/ - that appears to be a bistable mode, but there are so many variations of this I can't quite figure it out.

I'd need 2 555s, but I've got plenty and they're cheap - if I have both always set at 0v by the , I can pulse one 555 to activate it (pin 1 5v, then 0v), and the other 555 to deactivate (pin 2 5v, then 0v) it... at least that's what I'm thinking.

I mocked it up quickly in illustrator over lunch. Any thoughts on this one?
#18
Quote from: mjg on January 09, 2024, 06:45:53 AM
I'll see if I have time to breadboard something tomorrow for you.  Hopefully I've got a spare relay sitting around somewhere. 

I think what you need is two pins from the Arduino, connected through a transistor or mosfet each as a buffer, and then switch one pin high, other low.  Then reverse the high and low to switch back the other way. 

I think that diagram you've been looking at is a non latching relay?  That might be why it's not quite working.

I do appreciate it, so thank you in advance if you take that step!

In the meantime, I'm seeing folks on the internets using 555 timers to create/operate latching relays - and have a ton of those on-hand.

There's this video: https://www.youtube.com/watch?v=dzcgETRXbOM and also this: https://www.youtube.com/watch?v=f8O44E9RlsY

I know those aren't 1:1 what I'm doing, per se, but it seems like a similar logic may be able to be employed to trigger the relay. I'll do a little sleuthing - 555 timers have always confused me and I have little experience with them, lol, yet somehow I have 16 on-hand!
#19
I decided to start my breadboard from scratch just focused on getting a single relay to work. I think it helped, but I'm not out of the woods.

I wired this diagram: https://handsontec.com/dataspecs/relay/1Ch-relay.pdf (see page 2) almost exactly... The only thing I changed: transistor is wired for logic NOT gate, meaning a 10k resistor between +vcc (5v, not from the Arduino) and pin 3 (collector) of the transistor S8050, and then I send it just to one side of the relay (pin 1 OR 10). This allows the voltage to invert, which is what I want (thank you, mjg!!!).

Off the S8050 transistor, I had 5.8v on the collector (pin 3), .7v on the base (pin 2), 0v on emitter (pin 1).

When I cut off "IN," I had 0v on the collector, .7v on the base, 0v on the emitter. Looking good, feels like it's what we want, BUT...

when I connected the each transistors pin 3 (collector) to pins 1 and 10, respectively, on the relay switch (TQ2-L-5v), the voltage dropped from 5.8v to .15v, which is not enough to engage the relay.

It's almost like the resistance between the coil pins (250ohm) is connecting the 2 circuits and killing the voltage. if it weren't for that, it seems like this would be working... it's almost like I need to have 2 more opto isolators, but that feels like overkill.

Any thoughts? I feel like I'm REALLY close... Thanks again for the help! It's why I keep coming back here! :-)
#20
Quote from: Bio77 on January 08, 2024, 10:17:36 PM
Would the current arrangement work with a non-latching relay?

It might? I think the latching relay allows the Arduino to rest a bit more - a non-latching style would need to have constant power to stay open during a loop/effect need, right?
#21
Quote from: mjg on January 08, 2024, 09:03:36 PM
A 4010 or 4050 are pretty standard buffer chips, maybe start with one of those and see whether it does what you want. 

Have you been able to confirm the relay works by itself, by just hard wiring the voltage to it?  It should only need a quick touch of voltage to switch a latching relay.  No need to hold the voltage on for long.  Then you reverse the wires to switch back the other way, again, only for a brief moment.

Awesome - I'll look those up!

To answer your relay working question: yes, it works - I can get it to snap every time I reverse the voltage. So now I'm just trying to figure out how to do that electronically, and nothing so far has worked - but I might be onto something with the parts I have...

First: my failure... I tried to work with (2) S8050 transistors (and later, some 2n3904 just to see if I got the same result), a la the diagram below, to flip the output signal. What I was noticing is that my 5v signal became .7v once it went through the transistors. I'm also finding that connecting pins 1 and 10 on the coil has some resistance (small, like 150ohm ish), so that's creating voltage weirdness when I try to do a high/low with 2 NOT gate setups. I then test the transistors to be sure they're working, and they are according to my multimeter. No snap to the relay, just sadness.



Second: my (possible) win? I then went the mosfit route - I have some BS170s, so I used this circuit to test LEDs:



I setup 2 instances of this. I used a temporary push button switch for testing on each one and was able to get the LEDs to work when I touched the button, although they stay on sometimes after I release it, so I feel like the mosfets are holding a charge or something - or it's related to me having a 5v input and not a 12v like the diagram. I have no idea how to test it, so that's where I am currently. The output voltage after the LEDs are on is like 2.4v ish, which should be enough to trigger the relay, but I need to do a little more testing there.

My assumption is that I would throw a 5v signal on pins 1 and 10 of the relay (aka, the coil), and then connect each separately to the drain on the mosfets, but I feel like I'm missing an element here.

OH - the reason I don't want to just power these from the Arduino is that I will have 11 relays at a minimum, and possibly as many as 20 - each pulls 20mA when operating, and if all of them go at once (which happens when I turn on the device), it's too much pull for the Arduino (I think it said 200mA is the most it should have to worry about).

I've read that these are quality relays, and at $3/pop, aren't expensive but also aren't inexpensive. I just need something that can reliably invert voltage across pins 1 and 10, and that's proving... a situation. hehe. ;-)

Any thoughts or advice, I am open to it!
#22
Quote from: mjg on January 08, 2024, 09:03:36 PM
A 4010 or 4050 are pretty standard buffer chips, maybe start with one of those and see whether it does what you want. 

Have you been able to confirm the relay works by itself, by just hard wiring the voltage to it?  It should only need a quick touch of voltage to switch a latching relay.  No need to hold the voltage on for long.  Then you reverse the wires to switch back the other way, again, only for a brief moment.

Awesome - I'll look those up!

To answer your relay working question: yes, it works - I can get it to snap every time I reverse the voltage. So now I'm just trying to figure out how to do that electronically, and nothing so far has worked - but I might be onto something with the parts I have...

First: my failure... I tried to work with (2) S8050 transistors (and later, some 2n3904 just to see if I got the same result), a la the diagram below, to flip the output signal. What I was noticing is that my 5v signal became .7v once it went through the transistors. I'm also finding that connecting pins 1 and 10 on the coil has some resistance (small, like 150ohm ish), so that's creating voltage weirdness when I try to do a high/low with 2 NOT gate setups. I then test the transistors to be sure they're working, and they are according to my multimeter. No snap to the relay, just sadness.



Second: my (possible) win? I then went the mosfit route - I have some BS170s, so I used this circuit to test LEDs:



I setup 2 instances of this. I used a temporary push button switch for testing on each one and was able to get the LEDs to work when I touched the button, although they stay on sometimes after I release it, so I feel like the mosfets are holding a charge or something - or it's related to me having a 5v input and not a 12v like the diagram. I have no idea how to test it, so that's where I am currently. The output voltage after the LEDs are on is like 2.4v ish, which should be enough to trigger the relay, but I need to do a little more testing there.

My assumption is that I would throw a 5v signal on pins 1 and 10 of the relay (aka, the coil), and then connect each separately to the drain on the mosfets, but I feel like I'm missing an element here.

OH - the reason I don't want to just power these from the Arduino is that I will have 11 relays at a minimum, and possibly as many as 20 - each pulls 20mA when operating, and if all of them go at once (which happens when I turn on the device), it's too much pull for the Arduino (I think it said 200mA is the most it should have to worry about).

I've read that these are quality relays, and at $3/pop, aren't expensive but also aren't inexpensive. I just need something that can reliably invert voltage across pins 1 and 10, and that's proving... a situation. hehe. ;-)

Any thoughts or advice, I am open to it!
#23
Quote from: mjg on January 07, 2024, 01:07:43 AM
Another thing for you to research - look at non inverting buffer chips, and use one of those instead of your opto and transistors.  As pedal designers we tend to use transistors and opto chips as it's traditional, I guess... but there are usually better options for just signal control. 

You may find a hex buffer chip in a dip package that is cheaper and smaller than piles of opto and transistors.  That should fulfil your need of separating the Arduino from the relay.

Do you have any model numbers to look for?

I did some testing today - I'm not sure I'm setting up my S8050 properly. The pc817 opto works as expected. When I run pin 3 to pin 2 of the S8050, my voltage drops from 5.8v to .7v, and then pin 3 has no voltage at all.

I was also trying to figure out what resistor values to use to make it a NOT gate, but nothing worked... can't tell if I fried the transistors or what, but I haven't done anything that would have done that, I don't think.

For giggles, I used the MV57 chips that came from the pedalsync system - they "worked" but not quite right. I may need to go the IC route if there's something out there...
#24
Quote from: mjg on January 07, 2024, 01:07:43 AM
Another thing for you to research - look at non inverting buffer chips, and use one of those instead of your opto and transistors.  As pedal designers we tend to use transistors and opto chips as it's traditional, I guess... but there are usually better options for just signal control. 

You may find a hex buffer chip in a dip package that is cheaper and smaller than piles of opto and transistors.  That should fulfil your need of separating the Arduino from the relay.

I'll look into this, as well - I'm not as worried about parts, as I already have the parts. It's a long story - I originally built a pedalsync system, but the mute-during-relay-switch was a full second long and not subtle. I wasn't able to modify it, either, so I then turned to the arduino version I have on the breadboard now. I think in the 7 years since I started this, there are plenty of DIY switchers that have popped up, but I'm invested in this system and have the parts... gotta see it through, for better or worse, hehe.

Again, extremely helpful, so thank you! More to follow...
#25
Quote from: mjg on January 06, 2024, 11:47:40 PM
Another thing you could try, if you don't want to have the Arduino connected directly to the relay, is to have your opto chip controlling 2 transistors.  One will set 5v or ground, and the 2nd transistor will set the opposite.  Hook those up to your relay, and should be golden. 

Look for "transistor not gate" in your favourite search engine if you need pointers on how to do that?

Literally just had this exact thought! I'll do a little research and check out your project, as well.

I'm using an arduino mega, so I have some pins if I want to go the direct route. I may have enough parts to just double up the circuit and use 2 pins, as well! (Seems like overkill, so I'll look into the other ways).

Super helpful - thank you so much! Really appreciate the help!
#26
Quote from: mjg on January 06, 2024, 09:17:00 PM
The Arduino code isn't going to make any difference here, so I'd concentrate on the other parts. 

You can even take the Arduino out of it, and just apply 5v or ground to the opto to simulate what will happen when the pin goes high or low.

I'm struggling to work out the layout around that relay.  If the transistor is on, then you get 5v at one pin and ground at the other.  If the transistor is off, you get 5v at one pin, and the other pin is floating.  That doesn't seem right? 

I'd probably use a multimeter to check how voltages are changing when you switch the opto, that might help isolate the issue, and you could also try just apply your 5v and ground to the relay pins to check it works. 

I can't remember if that relay is only on when voltage is applied, and off when no voltage, or if it is one where you reverse the voltage to switch the other way.  Might be worth checking what sort of relay you have, to make sure it will work with this schematic. 

Hope some of that is useful!

Thank you for the reply! Good call on removing the arduino from the equation while I test - will do that next (I need more breadboards!). I'm convinced I just have the mix wrong - some connection just isn't right.

The relay I have is a DPDT latching type single coil - It latches when the voltage is reversed across pins 1 and 10. I tried 9v+9v and ground+ground - no dice. it only works if I fully reverse voltage. Looking at the diagram, there's nothing that would ground pin 10 when the arduino pin sends a signal. I need to think about this...

I looked into just controlling the voltage on the Arduino instead of an opto/transistor option, which would be SO much easier, hehe, but I had read that the relay can cause voltage spikes that could fry the arduino. If you have a different experience, I'm all ears on that front.

When testing with LEDs, I was able to control a photofet for temporary muting while the relay does its thing, and use the arduino to control the timing on the photofet to match that of an analog 3pdt footswitch. It's programmable with 11 banks and 9 loops per bank, so I can control 9 effects and which is on or off per loop. If I can make it work, great - but I gotta get the relays working first! Hehe.

More to follow... I'll work on the relay circuit...

When I started this project in 2017, there wasn't much out there. There may be now, but
#27
General Questions / Relay meets Optocoupler Question
January 06, 2024, 07:12:00 PM
Hi everyone!

Feel free to tell me where this post should go. I'm pulling my hair out...

I'm building an effects switcher with an Arduino - have had the parts for years, finally doing it. I tested everything using LEDs and it worked great.

for some reason, now that I've got the relays on here, I am unable to get my relays to actually switch - this is a problem, hehe. I've got a TQ2-L-5V relay, pc817 opto and S8050 transistor.

I would assume maybe I didn't code things correctly, which is still plausible, but I have a reset for all relays on power-up to switch on and off - none work, but it did work when it was just LEDs.

Here's my diagram (attached) - can someone tell me what I'm missing? (happy to share code from Arduino, too, if anyone is up to speed there, but again - in testing, it worked - I think it's something with my opto that's just not flipping the voltage between 1 and 10 so it actually toggles the switch).

Thanks in advance, as always! :-)

#28
General Questions / Re: Where are you buying parts
April 26, 2023, 01:23:16 PM
BLMS is great for certain things - they have Gorva enclosures, which I really liked for my recent 1590a builds (they have extra room in them so it's not so tight). Jacks, pots, knobs and switches are top notch there, too, so it's the best place to start out

Stomp Box Parts is where I got most of my other recent parts from - this is what Mammoth Electronics turned into, I believe... They're priced pretty good and have a really good selection of parts that's easy to navigate on their site. Unlike mammoth, however, they do have minimums, so if for example you only need 1 or 2 resistors of a certain value, you're getting 10 of them - again, pricing isn't bad, but something to be aware of. They also still have powder coated enclosures, though not as large a selection of colors (but still pretty good ones).

mouser was always a lot for me - unless I knew exact part numbers, I was always nervous to try and navigate what I needed there - I liked small bear and mammoth cause their sites were easy and parts were more specific to pedals, which is probably why I stuck with stomp box parts. ymmv.

Good luck! :-)
#29
I did find this thread below, so it looks like I have a couple routes to try out here - seems like either the cap needs to connect up with LED, or I need to add in a cap/diode combo... will experiment maybe this weekend, but for now - just trying to get my rig dialed in. :-) More to follow...

https://www.diystompboxes.com/smfforum/index.php?topic=76910.0
#30
Just tried the .1u cap trick you mentioned - didn't work... still hear the pulses.

So I tried to breadboard the schematic above. Couldn't get it to flash, so I went to the internet to find similar schematics. Tried it a couple ways - I can't get the LED to flash at all using the above schematic - just kinda slowly turns off and never back on again. Thought it might be the chip, so I threw it into my working circuit to test and it worked fine.

Might have to table this for now... I'll get it eventually, but it seems like I might need some new parts and some time to breadboard some other options... at least the footswitch is where it should be and the jewel lens doesn't look too insane, hehe.