What do you do?

Submit the “Stuff” you have created! Share project ideas, completed projects and project horror stories in each of the three main categories listed below!

Submit your stuff!

How I do stuff.

My friend owns an acupuncture business and runs it himself. He bought one of those wireless (sonic proximity detector) doorbells that rings when someone walks through the door that you have mounted it next to but found that the loud ringing was disturbing his patients.

My solution was to create a device that will flash a backlit sign to alert him when someone enters or exits his business. The wireless (RF) sign will be mounted in his treatment room/s and the detector will be mounted at the main entrance.

- The detector uses a 741 OP amp as a standard break beam detector.
- The output is fed into the parallel port of a PC running any linux 2.4+ kernel.
- The PC runs a very simple C++ application that monitors the LPT port for state changes.
- A prefabricated (rc car) transmitter is connected to another pin from the LPT port.
- When a state change is detected the application alternates high and lows to the transmitter which causes it to turn on and off.
- The transmitter is a two channel (forward/backward, left/right) with four output states. With two small rectifiers you can drive four digital inputs. I.E. Four different color leds or four signs that mean different things.
- The receiver (located in another room) is used to directly drive the LED’s that backlight the sign.

- By using an additional breakbeam detector you could position them so that you could discern the number of people entering and the direction of travel (ingress or egress) and flash of illuminate as appropriate.
- The timing and interval of the illumination is directly driven by the transmitter which in turn is controlled by the LPT port which is controlled by the application.

Linux Application:

/*
This application is enough to get you started. It contains code that will control the output of the data pins on a LPT port. If your IO address is different you’ll have to change this.

This app provides only enough functionality to manually output values to the parallel port. To make it truely useful you would need to create a loop that reads the value of the port until the input value changes. When the input changes you can then automate the output state changes.

Make sure you know which pins are used for what, and that you protect your ins and outs with diodes. (I.E. Protect the output of your detector circuit (that the app “reads” because it is possible to “write” (turn on) to the pin that it is connected to.)
*/

#include
#include
#include
#include
#include

#define BASEPORT 0×378 /* lp1 */

void pulse(int iteration, int duration);

using namespace std;

int main()
{

int iteration,duration;
iteration = 0;
duration = 0;

system(”clear”);
cout<>iteration;
system(”clear”);
cout<>duration;
pulse(iteration,duration);
exit(0);
}

void pulse(int iteration, int duration)
{
if (ioperm(BASEPORT, 3, 1))
{
perror(”ioperm”);
exit(1);
}
for (int x=0;x<iteration;x++)
{
outb(255, BASEPORT);
usleep(duration * 1000);
outb(0, BASEPORT);
usleep(duration * 1000);
}

//This is how you would read from the port
/*printf(”status: %d\n”, inb(BASEPORT + 1));*/

if (ioperm(BASEPORT, 3, 0))
{
perror(”ioperm”);
exit(1);
}
}

What Do You Think? Star