View Full Version : Project planning - Need some input from you guys!

02-19-2005, 05:42 AM

I'm a newbie to the BS world so I guess you'll see me here with a lot of questions from now on. ;)
I need some input and thought about a project I've been thinking of. Hear me out.

BASIC Stamp 2p 24-Pin Module
4x4 Keyboard
4x20 LCD display
# Relays

In short terms: I'd like to use a "PIN-code" (Personal ID Numer) input on the keyboard to activate a sertain relay by using a BS. The LCD displays what to do and what's going on.

I've attached a drawing that show's my project the easiest way.
(Parallax Description.jpg)

Need more description?

When I enter a PIN-code of 4 digits on the keypad, the BS detects what numbers I've entered and wich order they are entered. The BS is then checks if this exact order and numbers are a PIN-code that aktivates something. If it doesn't recognize the code, the LCD displays "Incorrect PIN" or something like that. If the code is recognized, an I/O port shall go HIGH and aktivate the relay that is connected to the exact I/O pin. (OPAMP if necessary) Now the LCD displays "RELAY 1 AKTIVATED" for 10sec, and then returns to the "Enter Code" mode. Now the BS is ready to get another code that aktivates another relay. If a relay is aktivated, it can be deaktivated by entering the same code one more time, and LCD displays "RELAY 1 DEAKTIVAED".

If I'd like to change these codes without removing the BS from the circuit, it can be solved by attaching a 9pin Serial connector to the Print card.

I'v attached a circuit drawing made in OrCAD. It's a little more details on this one.
(Parallax Pin.jpg)

Well, what do all you folks out there think?? It's for a school project, so it better work... ;)

Was this understandable?



02-19-2005, 07:35 AM
Make sure you treat the Relays like a woman. Put adiodge across them.

And you probably will want some decoupliing caps (.1uf, .01uf) between the power and ground pins on the bs2 (put them as close to the power in and ground on the bs2 as you can).

Don't know if that helps out any.. but it is very important... Also, when the bs2 powers up.. you might see the relays 'activate' whatever is behind them.

Jim McCorison
02-19-2005, 08:17 AM
You could get around having the serial port by having a master PIN that allows you to change the individual PINS. Of course you'd also want the ability to change the master as well.

Also, at an added expense, but reduced wiring and programming complexity, you could use www.parallax.com/detail.asp?product_id=30057 (http://www.parallax.com/detail.asp?product_id=30057) which is a 2x20 LCD which has a built-in keypad interface.


02-19-2005, 09:00 AM
If the SERIAL_9PIN in the circuit can be connected like the picture shows, it shouldn't be any problem getting it fitted. The complexity of the "putting-together" process is up to the Print Layout.


Don't think I reallt understood the "decoupliing caps" part. Do you have an example that might help. Picture of such a setup or anything?
About the relays. The point is that I have a circuit, let say a battery and a light bulb. This circuit is broken by the relay. As the relay get something from the BS, it'll complete the circuit, and "let there be light".

Was thinking of using this display http://www.parallax.com/detail.asp?product_id=30058
It has a built-in keybpad interface aswell.
Do you have an example where the keypad is connected to the LCD and further into the BS?


Jim McCorison
02-19-2005, 10:48 AM
Whipeout said...
Was thinking of using this display http://www.parallax.com/detail.asp?product_id=30058
It has a built-in keybpad interface aswell.
Do you have an example where the keypad is connected to the LCD and further into the BS?

Yup. That would work as well. The keypad, if your using the Matrix keypad from Parallax, is connected to the LCD controller by a cable also sold by Parallax. The LCD controller is then connected to the Stamp via serial or I2C. Since you're using the BSP2p (serious overkill for this project) you have the I2CIN and I2COUT commands, so I'd use the I2C connection. The keypad sends row/column connections to the LCD controller which in turn translates them to ASCII and sends them on to the Stamp via the data connection. As far as communicating, if you're using I2C, you send display commands to the LCD display via I2COUT and receive keypad input via I2CIN.


02-19-2005, 09:36 PM

That sounds like a good solution. And the LCD controller send the input from the keypad as the have been enterd. Sweet.

I know that the BSP2p is a serious overkill for this, but this is only a excuse to make the school buy me a Stamp and the other components. ;) Sweet...
Is there anyone out there that have some source code for something like this?