Operate a mag lock with a relay and photo sensor

I have my Elegoo Uno R3 running and my Arduino program works to read the SparkFun Ambient light sensor TEMT6000. (Set up to fire the 2 pin on light over 200) I can then wire in a 5V relay board (2 X 5V 1-Channel Relay Module With Optocoupler Low Level Trigger for Arduino ) and get it to switch from the 2 pin signal, but I don't know how to wire in my little 3v to 12v mag lock to get it to unlock. I am new at this and have tried for two weeks to get this to work with various LDRs and resistors, and went to the pieces that have them built in. I would think that I could wire the NO and COM of the relay to another battery and the mag lock wires and when the switch gets the signal and closes the current would flow and retract the mag lock, but I don't seem to be getting enough power. And I'm not sure which is actually closed/connected in the relay when the digital 2 pin fires since the green light goes out on the relay. I may have this working backwards. I have read the Wikipedia article on relays. I need a little help so that I don't burn out any components. Here is the Arduino program, very simple: void setup() { pinMode(2, OUTPUT); //pin connected to the relay Serial.begin(9600); //sets serial port for communication }

void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); //Serial.println(sensorValue); //prints the values coming from the sensor on the screen

if(sensorValue > 200) //setting a threshold value digitalWrite(2,HIGH); //turn relay ON

else digitalWrite(2,LOW); //turn relay OFF

delay(100); }