Hi,
Can someone please assist me with creating a pulsed output on a digital pin?
I am not an experienced programmer, but I have used and compiled the certified 10 channel sketch. I have also modified it a little bit, for the purpose of creating more digital inputs for door/window sensors. This is now working.
I was thinking of modifying one of the LED outputs from 10 channel sketch for the pulsed output.
Does anyone have a smart solution for this?
Brgds
Thomas
Digital output - pulse
-
- Posts: 201
- Joined: 05 Sep 2016 22:27
Re: Digital output - pulse
Hi Thomas,
what kind of pulses do you need? A PWM (pulse width modulated) signal?
This can be done in hardware, but I think that it is currently not possible to change the frequency of the signal.
What do you plan to control with this signal?
Best regards,
Andreas.
what kind of pulses do you need? A PWM (pulse width modulated) signal?
This can be done in hardware, but I think that it is currently not possible to change the frequency of the signal.
What do you plan to control with this signal?
Best regards,
Andreas.
fhem.de - ZWave development support
Re: Digital output - pulse
Hi Andreas,
I want to trigger a relay, for just ex 500 msec.
This relay will again work as a dry contact for my garagedoor motor, to be able to open/close the door remotly.
Brgds
Thomas
I want to trigger a relay, for just ex 500 msec.
This relay will again work as a dry contact for my garagedoor motor, to be able to open/close the door remotly.
Brgds
Thomas
-
- Posts: 201
- Joined: 05 Sep 2016 22:27
Re: Digital output - pulse
Hi,
that should be quite simple...
#define doorRelay 9
then in setup() you define the pin as output and initialize the state
pinMode(doorRelay, OUTPUT);
digitalWrite(doorRelay, LOW);
and in the function where you want to trigger the relay you just use something like
digitalWrite(doorRelay, HIGH);
delay(500);
digitalWrite(doorRelay, LOW);
Regards,
Andreas.
that should be quite simple...
#define doorRelay 9
then in setup() you define the pin as output and initialize the state
pinMode(doorRelay, OUTPUT);
digitalWrite(doorRelay, LOW);
and in the function where you want to trigger the relay you just use something like
digitalWrite(doorRelay, HIGH);
delay(500);
digitalWrite(doorRelay, LOW);
Regards,
Andreas.
fhem.de - ZWave development support
-
- Posts: 201
- Joined: 05 Sep 2016 22:27
Re: Digital output - pulse
Hi,
I forgot to mention, be carefull when you connect a relay to a digital pin!
First make sure that the current needed for the relay is not higher than what the Z-Uno allow -> Z-Uno specification says 8mA for normal pins, 16 mA for pin 3-6.
Second a relais is a coil! That means if you switch back to LOW, a peak in the current/voltage will be created that can destroy the Z-Uno. You would need to protect the Z-Uno with a diode or a resistor and a zener diode.
So best would be to use a transitor to allow higher currents AND to protect also the transistor with a diode / resistor+zener diode or to buy a cheap "chinese" relay card that works on TTL level.
Regards,
Andreas.
I forgot to mention, be carefull when you connect a relay to a digital pin!
First make sure that the current needed for the relay is not higher than what the Z-Uno allow -> Z-Uno specification says 8mA for normal pins, 16 mA for pin 3-6.
Second a relais is a coil! That means if you switch back to LOW, a peak in the current/voltage will be created that can destroy the Z-Uno. You would need to protect the Z-Uno with a diode or a resistor and a zener diode.
So best would be to use a transitor to allow higher currents AND to protect also the transistor with a diode / resistor+zener diode or to buy a cheap "chinese" relay card that works on TTL level.
Regards,
Andreas.
fhem.de - ZWave development support
Re: Digital output - pulse
Hi again Andreas,
Thanks alot.
Appriciate your quick and helpful response!
I will try your tip and let you know how it goes.
The info about pin/Z-Uno limitations with regards to current etc is very much appriciated!
I had planned for a very small relay, but now I will have another look at the spec and reconsider the design.
Probably I will go for a transistor solution
Have a nice evening
Brgds
Thomas
Thanks alot.
Appriciate your quick and helpful response!
I will try your tip and let you know how it goes.
The info about pin/Z-Uno limitations with regards to current etc is very much appriciated!
I had planned for a very small relay, but now I will have another look at the spec and reconsider the design.
Probably I will go for a transistor solution
Have a nice evening
Brgds
Thomas
-
- Posts: 201
- Joined: 05 Sep 2016 22:27
Re: Digital output - pulse
Hi Thomas,
yes, 8/16 mA (at 3.3V) is not very much...
I would use a transistor and then go for a cheap relay card, just type "relay arduino", "relay module" or "relay board" into the ebay search and there will be hundreds of them. But take care of the voltage, most need at least 5 V and the lower TTL level need to be considered. If you go for a card with an optocoupler, take a close look at the specification, most of them need at least 4-5 mA.
Regards,
Andreas.
yes, 8/16 mA (at 3.3V) is not very much...
I would use a transistor and then go for a cheap relay card, just type "relay arduino", "relay module" or "relay board" into the ebay search and there will be hundreds of them. But take care of the voltage, most need at least 5 V and the lower TTL level need to be considered. If you go for a card with an optocoupler, take a close look at the specification, most of them need at least 4-5 mA.
Regards,
Andreas.
fhem.de - ZWave development support
Re: Digital output - pulse
you can have a look at a "Solid State Relais Modul Board".
These are small, switching completely electronically and the ready modules can be connected directly to the pins. The only question is which switching power is required.
... Oh, I'm too slow
These are small, switching completely electronically and the ready modules can be connected directly to the pins. The only question is which switching power is required.
... Oh, I'm too slow
-
- Posts: 201
- Joined: 05 Sep 2016 22:27
Re: Digital output - pulse
Hi,
yes that is also an option, but most (or all?) of these do not switch potential free. Depending on what you want to switch this can be an issue.
Regards,
Andreas.
yes that is also an option, but most (or all?) of these do not switch potential free. Depending on what you want to switch this can be an issue.
Regards,
Andreas.
fhem.de - ZWave development support
Re: Digital output - pulse
Hi,
I use for this in most cases a Darlington Array - here are the clamp diodes for switching inductive loads included.
Samples are:
ULN2803
UDN2981
TIP120
....
Michael
I use for this in most cases a Darlington Array - here are the clamp diodes for switching inductive loads included.
Samples are:
ULN2803
UDN2981
TIP120
....
Michael