Offline
Newbie
Karma: 0
Posts: 15
|
 |
« on: February 26, 2013, 12:56:04 pm » |
i am try to connect the electric door strike to Arduino and i d'ont know how to start. how i connect him? what the code to open and close? this what i have :  alot of tnx!
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6408
-
|
 |
« Reply #1 on: February 26, 2013, 01:33:21 pm » |
i d'ont know how to start.
Find the spec for the door strike. Understand what the electrical characteristics are. Design a circuit capable of driving the electrics which can be controlled by TTL levels. Build that circuit and connect it to the Arduino. Write a sketch that provides the appropriate TTL output signals to make your driver circuit operate the device. Design the rest of the sketch to implement whatever control algorithm you want. Presumably you'll have some form of inputs to determine when to operate the door strike; you'll need to carry out a similar exercise to interface the Arduino with those.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #2 on: February 27, 2013, 02:22:09 pm » |
this what i do, what wrong? the transistor is 2N222A 
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #3 on: February 27, 2013, 02:26:42 pm » |
According to that pic, you have the load on the transistor's base,
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #4 on: February 27, 2013, 02:30:46 pm » |
According to that pic, you have the load on the transistor's base,
what i need to do  ?
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #5 on: February 27, 2013, 02:34:46 pm » |
Have a look at this tutorial. And look at a data sheet for your transistor to make sure you understand which pin is which. You'll need to get a diode as well.....
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #6 on: February 27, 2013, 02:57:16 pm » |
Your mechanism should be driven exactly as you would drive a heavy-duty relay. I think a 2N2222 might be a little lightweight. If that's all you've got for a transistor, it may be simpler to use it to drive a relay, and drive the strike from the relay's contacts.
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6408
-
|
 |
« Reply #7 on: February 27, 2013, 04:52:08 pm » |
this what i do, what wrong
Once you have sorted out the hardware side, you need to get the sketch to compile - which it won't currently.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #8 on: February 28, 2013, 11:12:41 am » |
this what i do, what wrong
Once you have sorted out the hardware side, you need to get the sketch to compile - which it won't currently. you can give my the code? I'm really desperate I want to continue with the project even online I found something similar to what I'm trying to do
|
|
|
|
|
Logged
|
|
|
|
|
UK
Offline
Tesla Member
Karma: 89
Posts: 6408
-
|
 |
« Reply #9 on: February 28, 2013, 09:39:23 pm » |
you can give my the code?
There's really no point trying to move forwards on the code until you have got the hardware right, and then the next step will be to get your code to compile. Which it currently won't, for reasons which should become obvious when you try.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #10 on: March 03, 2013, 02:00:05 pm » |
i connect like this :  Uploaded with ImageShack.uspdf of ULN2803A: http://www.alldatasheet.com/datasheet-pdf/pdf/169423/ETC2/UNL2803.htmlnow the lock get power but still the software code not work!
void setup() { //Start serial Serial.begin(9600); pinMode(13,OUTPUT); }
void loop() {
digitalWrite(13,255); delay(1000); digitalWrite(13,255); delay(1000); }
Can someone direct me?
|
|
|
|
« Last Edit: March 03, 2013, 02:01:45 pm by dimona »
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #11 on: March 03, 2013, 02:01:29 pm » |
digitalWrite(13,255); delay(1000); digitalWrite(13,255); what do you expect that to do, other than leave the pin HIGH?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 15
|
 |
« Reply #12 on: March 03, 2013, 02:09:05 pm » |
sorry the 255 is "HIGH" :-\
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #13 on: March 03, 2013, 02:32:58 pm » |
255 is the same as HIGH, as far as digitalWrite is concerned. Why write it twice?
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Offline
Edison Member
Karma: 36
Posts: 1253
|
 |
« Reply #14 on: March 03, 2013, 06:39:18 pm » |
I think the ULN2803 is already broken, perhaps the Arduino is also damaged.
You have to rewire the connections to the ULN2803. The chip doesn't use a positive voltage, but pin 10 is for the flyback diodes. The pin 10 shoud be connected the + side of the motor (and both should be connected to the (+) of the 9V battery). The ULN2803 does need a ground. That ground should be connected to the Arduino GND and the (-) of the 9V battery. Next you have to connect the input and output of the ULN2803 in the right way.
|
|
|
|
|
Logged
|
|
|
|
|
|