I have an early raspberry pi. It is fab as it is currently monitoring the temperature of my office and manages door access via web page, relay and 12v electronic door latch.
It is this door latch I'm having issues with.
I have it wired as shown

Nice and simple, I'm hooked onto pin 23 with a 5v feed and ground.
I'm running a web server with this code
Code: Select all
<?php
if(isset($_GET['open'])){
$btn = exec('gpio -g write 23 1');
usleep(250000);
$btn = exec('gpio -g write 23 0');
// echo "Door is open<br />";
header("Location:index.php");
}
?>
<head>
<meta name="viewport" content="width=device-width" />
<title>Dans Den Door Control</title>
<style>
.btn {
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
background-image: -ms-linear-gradient(top, #3498db, #2980b9);
background-image: -o-linear-gradient(top, #3498db, #2980b9);
background-image: linear-gradient(to bottom, #3498db, #2980b9);
-webkit-border-radius: 28;
-moz-border-radius: 28;
border-radius: 28px;
font-family: Arial;
color: #ffffff;
font-size: 48px;
padding: 10px 20px 10px 20px;
text-decoration: none;
}
.btn:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
background-image: -ms-linear-gradient(top, #3cb0fd, #3498db);
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
}
</style>
</head>
<body>
<form method="get" action="index.php">
<!--input type="submit" value="ON" name="on">
<input type="submit" value="OFF" name="off"-->
<input type=submit class=btn name="open" value="Open Door">
</form>
</body>
</html>
Which works..... for a while.
Then the pin seems to die.
I've replaced the relays and no change
Changed the pin number and it works... for a while.
I can only assume I got something wrong and I'm killing the board one pin at a time - I'm on my third pin!
..or I have a duff board - it was bought 2nd hand so has an unknown past.
Any help or advice greatly received
Many thanks
Danny


