Arduino with Velleman RFID + servo control

Hi guys,

This is my first thread at this forum, and I hope someone have a little time to get me started with this project. I´m pretty new with arduino, but quit good with electronics in general. I´m a mech engineer so sometimes I can´t understand a heck what goes on :slight_smile:

My project is following: Get a servo to run 90 degress with start from Velleman VK179 Rfid relay VDC output and also with a bottom. The Vk179 is powered with 12VDC and I´m hope to use this as power output also. The servo is powered with external 6VDC.

The code and electronics should do as follows:

  1. The relay gets triggered in the Vk179 RFID boad and send out a output on 12VDC.
  2. The output from Vk179 triggers the arduino boad. The push should also have the possibilty to trigger the arduino board.
  3. Servo turns 90 degress clockwise, holds for 3 secounds and returns to start pos.
  4. System wait for a new trigger from bottom or vk179.

Can somehelp me how to wire to Arduino, and some of the coding? I will be so happy for the help!!

Maybe I ask for too much, but maybe someone could help which input and output I should use on the arduino.

Thx again

You're going to have two inputs and one output.

One input will come from the pushbutton. The other input will come from the 'Rfid relay'. The output will be to the servo.

You can use any Arduino I/O pin you want for each of these functions. The Servo output library can be used to control a servo on any I/O pin, and the digitalRead() needed to read the two inputs is also available on any I/O pin.

Simple servo/button test code.

//zoomkat servo button test 7-30-2011

#include <Servo.h>
int button1 = 4; //button pin, connect to ground to move servo
int press1 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
}

void loop()
{
  press1 = digitalRead(button1);
  if (press1 == LOW)
  {
    servo1.write(160);
    delay(2000);
    servo1.write(20);
  }
}

Thx for your reply!

I will try it tomorrow. I'm not sure I follow how to wire the boad exactly. I hope I will figure it out :roll_eyes:

Again thx