hi noobie to the forum

elec_mech

Joined Nov 12, 2008
1,500
New demo!

Prompts controller (OP) to enter master code at power-up. Servo "locks" once code is entered. Both red and green LED's are lit to indicate master code is to be entered. Display changes each digit from a dash to a P to indicate it has received and stored the number entered for that digit. * and # symbols are ignored.

Servo "unlocks" and stays unlocked once correct code is entered.

I need to add a command to unlock the servo at power-up in case it was left in a locked condition for ease of use.

OP may have to tweak servo values in code depending on servo used - not all servos operate at the same angles.

For now, I'd suggest using the flashing LED's you bought earlier to attract passersby - perhaps spell out Crack the Code. While you could buy or build large LED displays and connect these in parallel to the existing digit LED's, I'd recommend doing this for a later fete. This is going to add time, complexity, and cost and I think there is plenty to do right now. I'm just afraid of running out of time to finish the design and having enough time on your end to get this altogether.

Let me know what you think. I'm going to tweak the code a little and polish up the schematic so I can get you a parts list. While the parts are on order, I'll begin working on the PCB layout to make it easy for your friend. If you really want something more than what is shown in the video, please let me know now so I can incorporate it. Once the design is done, it will be difficult to add to after the fact.
 

Thread Starter

scrivs

Joined May 21, 2014
54
Oh I did think of something but not really connected to this project.
It was a countdown timer, only to give more options in other situations.
 

elec_mech

Joined Nov 12, 2008
1,500
It was a countdown timer, only to give more options in other situations.
What is it you had in mind? 00-60 seconds or something else?

Are thinking about a separate circuit or using the existing circuit and display as a countdown timer (when not being used for the code game)? It could work as a MM:SS. The PICAXE won't be terribly accurate by itself, but if you don't need high precision it would work. If you did need high precision, you could add a DS1307 or similar to generate an accurate 1-Hz clock fed to the PICAXE which then controlled the display. I've done that before successfully.
 

Thread Starter

scrivs

Joined May 21, 2014
54
What is it you had in mind? 00-60 seconds or something else?

Are thinking about a separate circuit or using the existing circuit and display as a countdown timer (when not being used for the code game)? It could work as a MM:SS. The PICAXE won't be terribly accurate by itself, but if you don't need high precision it would work. If you did need high precision, you could add a DS1307 or similar to generate an accurate 1-Hz clock fed to the PICAXE which then controlled the display. I've done that before successfully.
Yes using the existing circuit when not used as code game. Doesn't have to be high precision.
 

elec_mech

Joined Nov 12, 2008
1,500
Certainly doable. I need to wrap up the parts list and start on the PCB design. Adding a simple countdown shouldn't take too long and I can do it after I finish the other items. For operation, I'm picturing two slide switches: one for ON/OFF and the other for selecting code or timer. If I get clever, I may be able to do this with one SPDT switch.

How do you want the timer to operate? MM:SS only or HH:MM? What is the maximum time you're looking for?

I assume you'd like to use the keypad to set the time, then perhaps press * or # to start. Would that work?

Do you need the ability to pause or stop the time? Possible, but a little more tricky on my end.

Do you want the LED's to do anything? Say go from green to red when there is less than a minute left or something similar?

Do you want the piezo to sound at the end of the time?
 

Thread Starter

scrivs

Joined May 21, 2014
54
Certainly doable. I need to wrap up the parts list and start on the PCB design. Adding a simple countdown shouldn't take too long and I can do it after I finish the other items. For operation, I'm picturing two slide switches: one for ON/OFF and the other for selecting code or timer. If I get clever, I may be able to do this with one SPDT switch.

How do you want the timer to operate? MM:SS only or HH:MM? What is the maximum time you're looking for?

I assume you'd like to use the keypad to set the time, then perhaps press * or # to start. Would that work?

Do you need the ability to pause or stop the time? Possible, but a little more tricky on my end.

Do you want the LED's to do anything? Say go from green to red when there is less than a minute left or something similar?

Do you want the piezo to sound at the end of the time?
MM:SS with like you say * or # to start ( not really thought further into it ) just would set a task for the school children to do and then set the countdown going and when it got to say 10 seconds away from zero would bleep down to zero.
 

elec_mech

Joined Nov 12, 2008
1,500
Okay, schematic, BOM, and PCB layout attached.

I threw in some headers (without calling out of the PCB, ah well) so you can attach and remove the servo and add a F-F cables to do the same for the display module and programmer. Otherwise you can solder wires directly.

I have not included things like wire - I looked for a small piece of ribbon cable to run between the keypad and the PCB, but you have to buy a roll of it.

I've tried to keep everything local to you using either CPC or PICAXE store. The only gating item is the "programmer" which comes from eBay. This should work and appears available in the U.K. You can get these a little cheaper from China, but you risk not having it delivered in time. You'll also need a USB mini cable, but if you keep cables from computers and cellphones, you probably have one lying around.

The enclosure I selected is the cheapest I found that would house the PCB, although you may still need to trim the PCB a bit.

There are two sliding switches - one controls power to save battery life, the other allows you to select between timer and game.

I've tried to double check my work, but I can't guarantee perfection. However, I'm here if you or your friend run into problems.

I do suggest buying a couple extra IC's of every type just in case. The sockets aren't required, but they allow you to quickly change out a bad IC if needed.

To get by cheaply, you can drill holes and mount the LED's from the back and secure with hot glue or epoxy. A slightly more elegant solution is using LED mounts.

Good luck! :)
 

Attachments

absf

Joined Dec 29, 2010
1,968
Hi, what's the latest development of this project? Has the OP completed the project and put it into operation? Though the deadline is still 3 weeks away, I hope he can finish it on time.

BTW, it seems like the software part is missing on this thread as I couldn't find it anywhere. My son is also interested in doing this project after I show him this thread.

Allen
 

Thread Starter

scrivs

Joined May 21, 2014
54
update from me is:
my mate seems to think it might be beyond him but going to have ago.
My local pcb maker quoted at least £150 off the top of his head ( so that's a no go with him ).
 

elec_mech

Joined Nov 12, 2008
1,500
BTW, it seems like the software part is missing on this thread as I couldn't find it anywhere. My son is also interested in doing this project after I show him this thread.
The software is forthcoming, hopefully later today. The OP wanted a timer function added so I designed in the hardware to the circuit posted previously and have been working on the software since. The last few days have involved a lot of testing to fine-tune the accuracy.

Unfortunately, the PICAXE is not a good standalone timer, especially when you're simultaneously having it do other tasks like updating the display. I've got it to 90 minutes give or take 30 seconds or less. I've tweaked the pause function to death, so I think that is the best we can do. Since the OP stated high accuracy wasn't a must, I hope this will suffice.

If one wanted a more accurate timer, feeding a 1 Hz clock from a CD4060/4013 combination or a MAX1307 into an interrupt pin on the PICAXE (and making some code changes) would do it. I did this for another member a year or so ago also using a countdown display.

I just want to run a few more timing tests and make sure the code is fully commented correctly. Otherwise it is ready to go.

150 pounds?! :eek: Was that for a PCB layout too or just to make boards? If there is interest, I could do a PCB layout. You could then send it to either a local PCB manufacturer or have it done in China for cheap. This wouldn't be done in time for the fete unless by some miracle I got it done in a week and you found someone to make and deliver the boards to you before the fete in time to solder parts and test. China PCB manufacturers usually take a month between placing an order and delivering it to your door. Of course, you can pay more to have them made and shipped faster. Just some thoughts. Let me know if there is interest.
 

elec_mech

Joined Nov 12, 2008
1,500
Code attached. I haven't done extensive testing so I may need to make some changes, but I thought it good to go ahead and post.

Because of all the comments I added to explain everything, I had to break it up into two files so I could keep it under the AAC file limits. Just paste part b at the bottom of part a.

To open, download PICAXE programmer here . Save the attached files and delete the .txt extension so you are left with a .bas extension. Open the PICAXE programming editor then open both files. Cut and paste b at the bottom of a.
 

Attachments

Thread Starter

scrivs

Joined May 21, 2014
54
hi Elec mech can you upload the the pics in a higher res. my mate can't enlarge enough to be able to see it.
 

elec_mech

Joined Nov 12, 2008
1,500
my mate can't enlarge enough to be able to see it.
Odd, I can enlarge it on my computer screen, but perhaps it's not printing well? In any case, I've made it into a PDF which will hopefully help.

Here is a short demo of the timer in action. Note the decimal point for each digit comes on as a number is pressed so you know which number is next (in case you enter in mostly zeros or something similar to start with). The code, as written, does not sound the buzzer at the end of the countdown, but this can easily be changed.

Let me know if you need anything else. And please be sure to post some pictures of the device in action at the fete. Few things are as rewarding as seeing a design you helped with in use. Well, at least to me anyway. :rolleyes:
 

Attachments

Thread Starter

scrivs

Joined May 21, 2014
54
well didn't get it done in time the guy I was hoping to do it said he had to do a course at work and wouldn't have time, So I ended up doing giant jenga at the fair and hopefully I can get someone to do this for the Christmas fair.
 

elec_mech

Joined Nov 12, 2008
1,500
That's a bummer. :(

With some wire, a soldering iron, and some solder you can do this yourself. If you're interested, let us know and we'll show you what you need and recommend some tutorials.

Again, I'd offer to do it for the cost of parts and shipping, but if you're trying to keep the budget to a minimum, the shipping costs about as much as the parts.

Think I'll have a go at designing a custom PCB, good practice for me if nothing else.
 

Thread Starter

scrivs

Joined May 21, 2014
54
well still trying with this
elec-mech can you send me better quality pics of images you uploaded they are out of focus when i zoom in.
 
Top