project: power mitt

Hello everyone I'm sigma-x but call me x.

right now I have a project I wish to attempt.

it's simple yet complex it involves controlling 12 leds and two servos
all with pushbuttons

the 12 leds are in 3 pushbutton loops meaning

button1: controls four leds in counter sequence

button2: controls four leds in counter sequence

button3: controls four leds in counter sequence
=12 led's in sequence

button4: when pressed servo1 rotates 180 when released returns to 0

button5: when pressed servo2 rotates 180 when released returns to 0

button6: is an output to random device maybe another led
making 13 leds rather than 12

any and all help is appreciated

What's your hardware/software background?
Do you have a microcontroller in mind?
As written, you need 13 outputs to control LEDs,
6 push buttons,
2 outputs for servos.
ATMega328 based boards only have 20 outputs, so a bigger chip (like a 40-pin ATMega324 or '644 type chip) is needed, or you will need to do some simple multipexing.
For example, arrange the buttons as 2x3 keypad & save an input, or set up the 13 LEDs in a 4x4 matrix and save a few pins.
Be a good idea to leave D0/D1 free for ease of serial transfers while testing, or use them as outputs to some of the LEDs.

You can use the Keypad.h libray to read the button pushes, use the Servo.h library to move the servos. Write some simple code to act on the button pushes and drive the LEDs.

Ok, was a slow night, too tired to think about serious stuff, needed to have some fun ...

Building the hardware is no prob
but the software aspect is a bit rough
so I have to ask what is multiplexing?

but I do have "some" programming skills.

Multiplexing:
Set up the first 4 LEDs, turn on Anode 1 for some time. Turn off Anode 1.
Set up the second 4 LEDs, turn on Anode 2 for some time. Turn off Anode 2.
Set up the third 4 LEDs, turn on Anode 3 for some time. Turn off Anode 3.
Set up the fourth 4 LEDs, turn on Anode 4 for some time. Turn off Anode 4.

Conceptually:
void loop () {
if (10mS elapsed) {
turn off current Anode, set up next LEDs based on LED flags (set below), and turn on next anode.
}
if (keys pressed) {
set flags for next LEDs to light
make any servo adjustments needed.
}
} // end loop

Ok, I get it now but the led's must be lit in counter sequence

but I got an idea now!!
I recently learned why I chose the arduino board.
the simple ability of it's networking making abilities!

the arduino can link to another arduino thanks to it's RX TX
function so what if I use three pushbuttons and four leds
so for example

button1: controls four leds in counter sequence
button2: controls four leds in counter sequence
button3: controls four leds in counter sequence

then have an RX TX link to another arduino
then have

button4: when pressed servo1 rotates 180 when released returns to 0 then stops
button5: when pressed servo2 rotates 180 when released returns to 0 then stops
button6: is an output to random device maybe another led

this will leave other posabilites for other inputs and output as well
but I have two problems I have nothing small enough for it
and I have NO IDEA where to start in terms of programming.

@crossroads: this type of multiplexing will cause the led's intensity will change with the number of leds switched on/off..p.

That may be pito - need to limit current out, or into, any 1 IO pin tho, and without additional hardware there are not may options.
Is a good introduction to multiplexing no matter what.

X: You create a variable that represents the state of the 4 LED groups.
Then base on button pushes or time or whatever, you change the variable accordingly, values 0x00 to 0x0F (0000 to 1111).
When the 10mS elapsed, you output the data.

"but I have two problems I have nothing small enough for it
and I have NO IDEA where to start in terms of programming"

I don't know what the first part of that means.
You haven't discussed any arduino-arduino comm's before, but that is certainly do-able.

Programming - go start with the blink without delay code, that working and then expand it.
Use Serial.begin() to output status messages to IDS serial monitor to help with code debug.
Then add the keypad library and make the LEDs do something based on button pushes.
Then add the servo library and make the servos move, and then move based on button pushes.
Then add Serial message to/from another arduino for whatever.

..none 180ohm resistor, common anode and 1 resistor in each of the led's cathodes may help.. Of course, you need 16 resistors then..most modern leds work nice with 200uA when not muxed..p.

Okay, I guess that would work too.

thanks for the tutorials crossroads
and what I ment is there is no arduino board small enough
till i saw the pro mini

I have a small board too, a promini replacement
1.3" x 1.3"
Wanted something with more power/ground connections, no regulator/power led/reset switch, run on 3.7 Li IOn, Li Po, or3 AAs.
Had PCBs made & sold 45 of them. Not too good surface mount soldering myself, so I don't have one assembled yet.

mini-uino_closeup_small.jpg

I'm pretty good at surface mount soldering
and 1.3" you say that's smaller than the pro mini I think
will this board be able to handle the power mitt

Sure. Same microprocessor, mounted on a different board.

I have a coupe left, send $2 via paypal to cardinalflyer@comcast.net, I'll mail you one. It needs an external regulated power source, like 3 AAs, Cs, Ds (depending on how long you want to run) or a LiPo battery.

Search for the "very small arduino" thread (use quotes like that), schematic & suggested parts have been posted.

$2 for a board great deal but let me practice smt first then i'll make my order
because i'll need a lot of boards

How many is a lot? I only have a couple left from the 50 I originally ordered, sent them all over the US and internationally also (that was a surprise!)

I can offer up another bulk buy to the forum if you after a bunch, see if others want more also.

right now i'm looking at 10 maybe more

but right now I wanna get the power mitt program up and going
the first half... anyway

so after some scaling down
here's what I believe the duemilanove can handle

3 pushbuttons analog input and four led outputs for each button

when pressed...well you know

so what do you think?

also what programs I will need to use to make the following work?

so after some scaling down
here's what I believe the duemilanove can handle

3 pushbuttons analog input and four led outputs for each button

Sorry, did someone take Sigma-X's place for that last message?

Did you see the schematic that was posted? Showing 6 push buttons, 4 banks of 4 LEDS, the 2 servos, and still has 3 IO pins free along with the 2 serial lines for downloading your sketch? Those are all the same pins the Deumilanove has. Its the same microprocessor.
The only part I didn't show was the difficult to solder FTDI chip and a reset switch, which your end users aren't to need.

C'mon dude, keep up with the program here.

Yes, I seen that schematic but the led's were all linked
the project requires that the leds remain on each of their own pins = 12 which takes all the digital I/O
pins thus using the analog input pins for the pushbuttons
hence why the pushbutton controls the one of four leds at a time when pressed
this will require more I/O pins for the servos and other pushbuttons
hence why I came with the solution to use another board to control the servos and remaining three buttons
via RX TX link

sorry for the poor explanation

ok ...