11 LED Counter Help Needed

Lets start with some background. I want to have a robot that automates all combinations between 0001 - 9999. what i want it to accomplish is a machine that can find certain combinations on a hand held GPS system. the easiest way i can see it working is having solenoids for the individual numbers 0-9. and maybe 1 more to aknowledge the current combination entered.

http://youtu.be/4EYdEnrJly0

I have the logistics of it all. i can MORE THAN LIKELY not blow anything up considering my hardware experience. the programming is my weakness considering i havent played with C++ in over 10 years.

i need to assign the 10 different pins to represent the individual solenoid then i need another assignment for the "done button" I need it to press all values between 0000-9999 and press done between entering the combination. i know a simple loop on integers can pull it off. i just dont know where to begin to implement it. also i need an advice for a sensor to tell the arduino to stop when the correct combination is entered. should i go with audio or a visual sensor?

Hardware: Arduino Uno microcontroller x11 9v push type solenoid X11 1k Ohm Metal Film Resistors 1/4w 1% X11 TIP120 transistor x11 1N4004 rectifier diodes x1 9V 1000mA 1A ,AC/DC Main Wall Power Adaptor 2.1mm

Am i missing anything? and will the AC/DC adapter be enough to power the solenoids without frying the microcontroller? Any help with programming or implementing this project would be GREATLY appreciated. Thanks!

What is the condition that can be recognized for the correct combination? Your hardware experience should be able to tell you if the power supply is up to the job; you haven't given us enough detail to answer the question for you.

its any combination of 4 numbers between 0000-9999 (example: 4510, 5590, 0012 etc...)

i get what you are asking now.. it gives both an specific audio tone and it has a screen saying that the combination you entered is correct.

Short of handing the code down to me. how can i assign the individual pins/solenoids for a specific number on the keypad? in the programming language, i know setting a range of "0000" would be incorrect syntax. how would i tell it to activate the solenoid within that specific range? i would assume a loop that would be something like 0000+1 then loop.

Goertzel's algorithm would work. where would be the appropriate place to put the interrupt?

No, how do we know when we've entered the correct combination?

Ok, so google 'goertzel's algorithm'

I'm sorry, I don't understand your questions.

Sorry, i have been thinking about all the steps at once.

First, i want to assign the individual pins/solenoids to a specific number (0-9) and another for the "done" button - I need a simple loop where it would run though all combinations from 0000-9999 -Last, i need an interrupt for after the combination has been correctly entered.

Question 1: I know that just putting a range of 0000-9999 is incorrect syntax because it might read the 0000 as just a simple 0. How can i avoid this? Question 2: If i am going to use goertzel's algorithm, what could be an example of an interrupt once the correct frequency is picked up?

for (int code  = 0; code < 10000; ++ code) {
  outputCode (code);
  if ( detectTone ()) {
    doThing ();
    break;
  }
}

Pushing the right buttons in the right sequence is straight forward to implement if you can build the hardware. Knowing when you have successfully unlocked it is the trick. Once you have unlocked it, do you need your system to stop and tell you what the PIN was, or are you prepared to blindly keep going and just know that after 10000 combinations the thing will be unlocked?

To be honest, i really dont need to know what the correct pin was. i just need it unlocked. if adding the sensor would greatly complicate things, i would prefer to run through the 10000 combinations and let the gps go crazy after the correct combination is entered. i just need a basic example of the coding to understand line for line what its supposed to do. i just dont know all the correct syntax for the language to make it myself from scratch.

Writing the code will be easy. I know it may not seem it to you now, but there won't be a lot of code and it won't be complicated. Do you have the hardware built yet? If not, I suggest you start by working out how you're going to physically install the actuators and how you will connect them electrically to the Arduino. Are you using an Arduino with nine output lines? If so the electrics should be relatively simple, but I expect you will still need to have the Arduino drive a transistor to drive your actuator. Have you worked out how much peak current each actuator will draw? This will define the requirements for your power supply, and also for the transistor that will drive the actuator.

Hi, All the nesessary parts are bought and are on their way if not already here. Essentially the schematic i am using is http://www.arduino.cc/playground/uploads/Learning/solenoid_driver.pdf

Here is the link to the solenoid http://www.goldmine-elec-products.com/prodinfo.asp?number=G18567

When working with this schematic, would a heatsink be necessary?

No, i havent worked out how much peak current. i assume no more than 4 amps. (i know assumption blows things up) I am using the Arduino Uno for this project.

I already have planned how to mount the actuators. i am going to house the individual solenoids in particle board thats is mounted on a stainless or chrome bar for movement for different space between the different numbers on the GPS unit. of course all this is pure theory until i have it all together.

Ok, im a total noob at Arduino. i am trying to put together the programming for this project. i understand that i am going to utilize an array.

  1. How can i program the unit to count from 0000 - 9999?
  2. After the array is set up, how can designate that particular pin/solenoid to a specific digit?

example code would be appreciated. Thanks!

  1. See reply #7
  2. pinMode

I was reading through reply #7. how will the program know that i need the output to be 0000 vs 0?

That will be down to whatever you write in "outputCode" Ask yourself - how many thousands? How many hundreds? How many tens? How many units?

The setup is built. it has been tested and works. i am just still trying to wrap my head around the programming necessary to designate an individual digit to a specific pin/solenoid. i am willing to contract help at a nominal price for this to be done for me. take it easy.. im a struggling college student. :grin: let me know if you are interested. im sure in the hand of an experienced programmer this can be done in a couple hours at the most. Thanks

Hi, Let me start of by saying that im completely new to the realm of programming. i have some minor electronics experience to not short out the microcontroller. other than that im a fish out of water. so if you find that my questioning is somewhat noobish, its because i am. now, on to the project.

I want to make a counter using LED's (later to be replaced by 12v push solenoids)

the parameters are 4 digits 0000-9999. what i want to accomplish is i want to assign individual pins/led lights to a specific number. (example, pin 3 = the digit 4, pin 5 = the digit 9 etc...) so when the running count is 0012, i want the LED that i designate for "0" to light up twice, the one i designate "1" to light up once, the LED i designate 2 to light up once in that order. i want that to continue until the count reaches 9999 then terminate.

The hardware setup is completed and all the individual LEDS are working correctly. i just need to implement the programming and im at a loss at where to begin. i just cant get my head wrapped around the programming logistics of this project. HELP! i know it should be a somewhat simple project for somebody that's familiar with the syntax. any bones thrown my way would be appreciated. Thanks!

Hi, Let me start of by saying that im completely new to the realm of programming. i have some minor electronics experience to not short out the microcontroller. other than that im a fish out of water. so if you find that my questioning is somewhat noobish, its because i am. now, on to the project.

I want to make a counter using LCD's (later to be replaced by 12v push solenoids)

the parameters are 4 digits 0000-9999. what i want to accomplish is i want to assign individual pins/led lights to a specific number. (example, pin 3 = the digit 4, pin 5 = the digit 9 etc...) so when the running count is 0012, i want the LED that i designate for "0" to light up twice, the one i designate "1" to light up once, the LED i designate 2 to light up once in that order. i want that to continue until the count reaches 9999 then terminate.

The hardware setup is completed and all the individual LEDS are working correctly. i just need to implement the programming and im at a loss at where to begin. i just cant get my head wrapped around the programming logistics of this project. HELP! i know it should be a somewhat simple project for somebody that's familiar with the syntax. any bones thrown my way would be appreciated. Thanks!

Where do the 11 LEDs come in?

Don