newbie- timed relay project

Hi, this is my first post here and I am totally new to the arduino world....
my electronics knowledge is average and I highly appreciate your help.

I have available the Arduino Uno, 2 channel 5V relay. Is it possible to achieve the following?

  • Input 1 = 12v DC (as a pulse but will be available for 2 seconds) <<<<>>>> Output = channel 1 relay operates 30 seconds only
  • Input 2 = 12v DC (as a pulse but will be available for 10 seconds) <<<>>> Output = channel 2 relay operates 10 seconds only

NB: note that the two DC inputs will NOT be operating simultaneously........
NB:

Any guidance that can put me through my project is highly appreciated...
thx.ed

Is it possible to achieve the following?

Yes
For the 12v inputs you need the move these down to 5v.
Can use optoisolators or transistors or voltage dividers.

And don't forget that if that same 12V is supposed to supply the 5V to the coil, you'll need to drop it to 5V for that too, but with a dc-dc voltage converter. Or have you got 5V handy for the coil?

By the way, when you say "2 channel relay" do you mean just a standalone relay or a "relay on a board" module with a control input?

If the former, you'll need a transistor to do the switching of the coil 5V with the Arduino i/o to its base. If the latter, you switch the relay with an Arduino i/o pin and the board has electronics to do that.

1- no problem in reducing the 12V to 5V as a sensing input for the arduino
2- the relays are relay on a board" module with a control input... thus they can be connected directly to arduino outputs
3- I have no experience with coding languages
.. Is there any available coding example similar to mine so that I can elaborate accordingly? I tried looking here to no avail...
Any help in this respect is highly appreciated. thx in advance

I used minibloq application to come out with the following code parameters.... did i do it right? am i on the right track?
D0 & D1 are used to sense the 5V (converted from 12V through a voltage divider using a 2.2k and a 1k resistors would keep my input voltage under 5 for all the way to 16v source)
D14 & D15 are the digital outputs that should trigger the relays 1 & 2 accordingly for the below specified values in milli-seconds. right?

#include <mbq.h>
#include <PingIRReceiver.h>

void setup()
{
initBoard();
while(DigitalRead(D0))
{
DigitalWrite(D14, true);
delay(10000);
}
while(DigitalRead(D1))
{
DigitalWrite(D15,
delay(30000);
}
}

void loop()
{
}

D0 and D1 are used for Arduino communications so try to avoid using them if you can.
Why don't you just use the Arduino IDE for witing your code?

noted for D0 & D1.
working with minibloq is a fully GUI application for writing codes in comparison with the Arduino IDE...

working with minibloq is a fully GUI application for writing codes in comparison with the Arduino IDE...

I know.
I was just suggesting you should use the IDE.