I’ll post the code in about 9h… I’m still at work.
Gonna make a shematic for better visualisation.
The relays works to 99% when they are only used without switching actual power.
If I try to switch 5V 2A it works sometimes 5 times and then they start flakering’n’stuff >.< like the power would slightly hit through the relay to the board-electronic.
Brett: Right now I use a official ~10cm GHI cable… I thought I test it with that one, before I make a long one xD
I made 2 versions… one with the minimal commandos (which works without the motor connected) and one that always disables all relays after use which I used in the video.
minimal one:
void secundaryWeapon()
{
//relay16 INFO:
//relayISOx16.EnableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay1);
//relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay2);
//Relay X1 Power
//Relay X2 and X3 off sett direction for UP
if (lvl1 == 2)
{
if (secundaryW_up == true)
{
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay4);
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay5);
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay6);
System.Threading.Thread.Sleep(100);
relayISOx16.EnableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay4);
System.Threading.Thread.Sleep(2000);
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay4);
}
if (secundaryW_dwn == true)
{
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay4);
relayISOx16.EnableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay5);
relayISOx16.EnableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay6);
System.Threading.Thread.Sleep(100);
relayISOx16.EnableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay4);
System.Threading.Thread.Sleep(2000);
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay4);
System.Threading.Thread.Sleep(100);
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay5);
relayISOx16.DisableRelay(Gadgeteer.Modules.GHIElectronics.RelayISOx16.Relays.Relay6);
}
}
}
In the pic you can see my electronical setup.
I made some tests. with a lamp and a smaller motor… works pretty fine.
With the bigger motor the relay start to flip around on start and end of movement.
There’s probably a peak or some inductive energy. If that’s the case… is there apossibility to avoid that?
EDIT:
Got from my friend 2 condensators and a diode… it should fix my peaks. gonna try it today or tomorrow ^.^
Nah, No chance… the RelayModule keeps flippering. Seems it’s not that stable with stuff above 1A >.< everything smaller works so far
However, today arrived my new ordered material… unter that stuff also a LoadModule.
I made a small shematic about how I wanna solve it. Ofc it only works if the X1Relays are more stable in switcheing… else I have a problem
I would like to use a MotorDriverModule… but the last one I bought burned by 0.8A
Can someone tell me if I made the setup correct?
And if I add now my 2 Mikroswitches… do I need to edd em in the + or - line? (cuz of this SRG thingy)
I don’t wanna kill my LoadModule in the beginning -.-
NC + P2 is one direction
and
NO + P1 is the other direction
is that not correct? And the SRG I just connected like in the image shown by the documentation
this would be my code:
void secundaryWeapon()
{
if (lvl1 == 2)
{
if (secundaryW_up == true)
{
this.load.P1.Write(false);
relayX2.TurnOn(); //set to NO
System.Threading.Thread.Sleep(500);
this.load.P2.Write(true); //P2 is for UP
System.Threading.Thread.Sleep(2500);
this.load.P2.Write(false); //Turn off again
}
if (secundaryW_dwn == true)
{
this.load.P2.Write(false);
relayX2.TurnOff();
System.Threading.Thread.Sleep(500);
this.load.P1.Write(true);
System.Threading.Thread.Sleep(2500);
this.load.P1.Write(false);
}
}
}