hi noobie to the forum

Thread Starter

scrivs

Joined May 21, 2014
54
ok, my friend seems confident he will be able to follow what you tell him and if it works I owe him a drink (result) oh and you elec mech.
 

elec_mech

Joined Nov 12, 2008
1,500
Cool beans.

Let's step through what you'd like.

Thus far we have a keypad, a piezo buzzer , and a red and green LED.

So, theory of operation at this point is:
  1. User presses four digits followed by # button.
  2. If code is incorrect, red LED lights up and buzzer goes off for two seconds then goes out.
  3. If code is correct, green LED goes on and stays on until * button is pressed - this is so user can show you they won.

To change the code:
  1. You enter a special six digit code followed by * button.
  2. You then enter new four digit code and press # button.
  3. Green and red LED's come on for two seconds then go out.
  4. Unit is ready to use with new code.

I've thrown together everything I could think of that you'd need for this project - see image below. Currently the total is just under £20 including VAT but not shipping. Most parts come from a UK company and a couple from eBay. I've not included things like wire, solder, and batteries, but assume you can get these easily enough.

Obviously, there are a lot of things that could be added or changed, so instead of listing a dozen of my ideas, let me know if the above will work and what you'd like to add or change. An LCD could be added, but it will increase the overall cost, so that is up to you.
 

Attachments

Thread Starter

scrivs

Joined May 21, 2014
54
You could punch a specific code into the keypad to get to allow you to change the player's code on the fly. We could light up four LED's, one per correct digit of the four-digit player code, then a fifth and a buzzer/fan to indicate a winner. These four LEDs could either be set to light up as the player pushes the correct button or on a timed sequence (the latter being a little more difficult). Alternately, you could punch in another code to manually eliminate the need for the 1st, 2nd, and 3rd digits (and light up corresponding LED's) as you saw fit depending on how the fete was going. Or use switches only you have access to to eliminate digits 1-3.

Just a thought.

quiet excited now, would like to make it a bit showy for the stall, don't think a lcd is needed, but don't know how.
timed sequence not needed.
have used cpc before for electrical stuff.
 

elec_mech

Joined Nov 12, 2008
1,500
Delivery (shipping) is free from CPC - http://cpc.co.uk and you should be able to get most of the things you require from there.
Every time I click on the link, it says the site is down. Don't know if it is really down or has something to do with me being in the U.S. If they carry electronic parts and PICAXE IC's that would work. If they don't carry PICAXE, then I don't think shipping will be much more from the PICAXE supplier to get all the parts from one place. Up to the OP of course. Hopefully the site will be up and I can locate and call out parts.

i know i said screen not needed but this seems impressive
http://www.picaxe.com/Hardware/Add-o...l-OLED-Module/

seems quite big.
I referenced a slightly cheaper one, but an OLED display looks quite nice. I don't think that one is much bigger than the keypad. They also carry a 20x4 LCD which would be much bigger.

So how would you like this to operate? You referenced an earlier post but did not comment on my last post. Is two LED's and a buzzer okay or do you want more? Use my last post as a template and tell us, step-by-step, how you'd like this to operate. Be sure to include details like LED colors and quantities, whether or not you want an LCD and what you see on the screen and when, etc. Spend some time and think this out. The more thought and detail you put in up front, the better the design will be.
 

Thread Starter

scrivs

Joined May 21, 2014
54
ok
name of the game crack the code
a four digit code to crack e.g. 1,2,3,4
first button pressed is say a "5" nothing would happen
second button pressed is say "7" nothing would happen
third button pressed is say "3" nothing would happen
fourth button is pressed say "6" THEN 3 red leds would light and one green led
to signify first press is wrong, second press is wrong third press is right and the fourth press is wrong, if the leds came on straight after the button press there would be no point continuing from the players point of view.
 

Attachments

elec_mech

Joined Nov 12, 2008
1,500
From your attachment:
Also how can I make the the effect of the leds bigger
You can do a number of things. The simplest is using larger LED's like 10mm in place of 5mm. You could also use several LED's instead of one (for each digit) and cluster them to make a shape or simply a large lighted circle.

You could use four 7-segment displays to show the value of each digit as it is entered. A single LED above each digit would blink when that digit was being entered. If one or more of the digits entered is correct, that digit value would remain displayed while the others went blank for the next entry. The blinking LED function would skip over any previously entered correct digits so the user would know what digit to enter next. I see some 0.56" high 4-digit modules on eBay for around 10 pounds with shipping. These use I2C to interface which would make connections and programming a breeze.

You could alternately build your own large digits using LED's to make up the segments. However, this would add a lot of manual labor and time and add a bit to the cost and complexity - perhaps for version 2 next year. :D

If you want to make this more interactive or at least rewarding, you could build a simple box or buy a cheap briefcase and paint it to look like a cool metallic spy container. Then add a servo to "lock" the box. Put whatever prize the winner gets inside the box so that when the correct code is entered, the box unlocks. Or make it look like a safe with a door in the front with a hinge on the side and the keypad on the door. Add a spring to force the door gently open whenever the servo is in the "unlocked" position.

Another thought for later is a timer. Allow the player x seconds or minutes to "crack the code". You could keep the same plan to somehow let the player know when a specific digit was correct. This would allow the player to try multiple times within a time frame (add a countdown timer) which may be more rewarding. Hmm, if you use an LCD, this could be done I think since the time and the code could be shown on the same screen.

Just some ideas. :)
 

Thread Starter

scrivs

Joined May 21, 2014
54
hi is this what you mean:

http://www.ebay.co.uk/itm/1-Pcs-0-5...al_Components_Supplies_ET&hash=item257b2730c9
if it is I will order this as it is in China.

think i am going to go with the safe idea.
so if i make box (safe) with the keypad on the front. Then could i build a separate box say 100mm x 50mm with 8 10mm leds (4 green 4 red) that via a cable fixes to the safe box. I could then have the safe box at table level and the led box at a higher level.
 

Thread Starter

scrivs

Joined May 21, 2014
54
just been looking on ebay for a suitable wooden box and come to the conclusion that for this year going to keep it simple and @ £30 max.
So I think a keypad with small housing then a separate box containing the leds that plug into each other via a cable.
 

elec_mech

Joined Nov 12, 2008
1,500
More like this. This contains an I2C IC which makes connection and communication to the microcontroller extremely simple. If you decide to use this, let me know and I'll pick one up on this side of the pond too so I can be sure I test the program out.

If you want to stick with just the LEDs and keypad, that will keep things simple and inexpensive. You could look for a diffused 10mm RGB (red/green/blue) LED. This way you can use one LED for both red and green.
 

elec_mech

Joined Nov 12, 2008
1,500
I purchased a 4-digit display via Amazon too. I'm going to figure out how to program a PICAXE to talk with it.

The keypad you link to should work, but the one from RevEd I linked to earlier is 2 pounds less (not including tax and shipping). Not sure which will be less expensive for you in the long run.

Give me a few days to write and test some code to get the display and keypad working before you buy anything else. I was originally thinking a 20-pin PICAXE, but if we're going to control a keypad and effectively eight LED's plus a buzzer and the display, we'll either need a bigger PICAXE or use a shift register like the 74HC595 to control the LEDs. I need to work out these details so we have a complete design upfront and you don't buy multiple parts multiple times.

When is the fete again?
 
Top