hi I´m trying to control a velleman relay card (k2633) with my arduino. the problem is that its acording to the manual is controlled with an open collector.
to switch the relays i have to connect the input to ground. is it possible to do this with the digital outputs on the arduino. if i am setting the output as LOW it shuld switch the relay.
but i dont want to set the output as high when i want to it to switch again. so is it possible to do this or do i have to change my design.
to switch the relays i have to connect the input to ground. is it possible to do this with the digital outputs on the arduino
Yes providing it draws less than 40mA when connected to ground a logic output of zero will do this.
but i dont want to set the output as high when i want to it to switch again.
That doesn't make sense. If it is low the relay is switched. Setting it high un switches the relay, therefore to switch it again, you have to un switch it (turn it off) by setting the output high then set it low to switch it on.
Maybe you are not expressing clearly what you want to do.
sorry for not beeing specific enough.
but the problem is when i set the output as high the relays start buzzing and sometimes does not un switch. but when im doing it the anlog way and using a cable connected to ground they switch and when disconnected they un switch. so is it possible to solve this un switching problem that couses when the output is set to high.
I think you need to make sure it goes high by using a pullup resistor on the output. That chatter might be a symptom of "floating".
Use a 4.7K to 10K resistor on the Arduino output pin to the +5V to make sure the pin goes HIGH when you you set it that way.
Could you just redine the pin as an input? i.e. do a
pinMode(relaypin, INPUT);
when you want it to release?
but when im doing it the anlog way
Does this mean you're using PWM to drve the relays?
Yup, that'd chatter.
All the talk of pull up resistors is wrong because this is an output we are talking about not an input.
but the problem is when i set the output as high the relays start buzzing
How is this wired up? Have you got one end of the relay coil to ground and the other to the Arduino output pin? If so you should not have it like this but should be driving it through a transistor. This is because the Arduino output can't supply enough current for most relays.
The start of this link shows you how to drive a relay:-
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html