Arduino Mega based DIY Remote (XBee)

For XBees you need the actual xbee (First link), but could also order from Parallax: parallax.com/Store/Accessori … fault.aspx

I mostly use the chip Antennae as they are easy and I don’t need a long range. May for remote, get one with a connector for external antennae, but probably not necessary for me as I only use it in my office…

You then need something to plug them into as they have their specific pin pattern and they need 3.3V. The sparkfun regulated explorer is cheaper, but it can have problems with some boards as it does no voltage conversion of it’s outputs and it’s high value voltage is not high enough to register as high on some boards. The Parallax adapter does bidirectional voltage conversions, so I have had better luck.

Kurt

Ok

But my shield already have a space for XBee.

That module should do it ?
robotshop.com/ca/maxstream-xbee-transceiver-module-chip-antenna.html

If i want to start by connecting to a computer just to monitor the data it send… only a computer adaptor and the same module (so 2 modules the same)

Yep 2 of the same modules, plus probably an USB adapter. Sparkfun USB version cheapest and for most things works fine. But if you wish to reflash chip, some others make it easier to do the reset and the like.

Your shield is interesting, but if I read it right, it hard wires the XBEE to USART 0, which is same as USB (like a shield I have). Personally I like them on two different ones as you have 4 and I use both at same time…

Probably all for now. Hands say no more…

Kurt

It’s alive

http://farm6.static.flickr.com/5034/5912051953_fbed8b771c_z.jpg

Kurte: I will do a quick check on that (witch serial) cause i would like to have a seperate too…!

Will look to order parts soon. :wink:

I ain’t connect my keypad yet. Just take a look at it.
How do you connect it ? since there is 8 pins and no V-In…

a 4 X 4 matrix keyboard, perhaps?

Alan KM6VV

Exacly
elexp.com/a_data/17kp1604.pdf

Yep I was using a different one, bu I received 2 of the ones from elexp yesterday. Will replace the other one with one of these to standardize… Has 8 pin, for 4rows and 4 cols. to swap it in. Code is in place for reading, The only question will be which are rows and which pin is pin 1…

Kurt

i was more worrie about wiring… lol

OK, well I put in one of the other keypads. Wiring was simple, I used 3 3wire servo extension cables. On my Mega I plugged them in one after another starting at IO pin 22. Since no shield I used the 3 pin Male/Male connectors that come with the extension cables. On the keypad side I plugged them in with IO Pin 22 going to the pin closest the 0 Pin, with the 3rd wire of 3rd cable hanging off the other side.

For Rows/Cols different than other keypad. Could rearrange wires, but instead simply updated mapping table, like:

static const word c_KeypadMapping] = { /* 0x1, 0x2, 0x3, 0xA, 0x4, 0x5, 0x6, 0xB, 0x7, 0x8, 0x9, 0xC, 0x0, 0xF, 0xE, 0xD}; */ 1, 4, 7, 0, 2, 5, 8, 0xf, 3, 6, 9, 0xe, 0xa, 0xb, 0xc, 0xd};
Now getting the right mappings.

Kurt

Normally, you scan through four wires (rows), and look for lows on the other four wires (columns).

Then you know what key was pressed because one line will go low.

Not sure how Kurt reads it with just a 3-wire servo cable…

Alan KM6VV

No need for power… or resistor ?

Did some test with a “Slider” for batt.
I have started by only using a potentiometer as analog reff, since i don’t have anything yet to see batt voltage (Anyway i am on usb… lol)

We could mix that with a change in color too… :wink:

Looks good.

Nope use built-in PU resistors. Gets init in:

[code]void InitKeypad(void) {
// Assume first four pins are the rows and the next four pins are the cols.
byte bPin;

// Init Rows
for (bPin = FIRST_KEYPAD_IOPIN; bPin < FIRST_KEYPAD_IOPIN+4; bPin++) {
    pinMode(bPin, INPUT);        // set all of the pins to inptu
}

// Init Cols
for (; bPin < FIRST_KEYPAD_IOPIN+8; bPin++) {
    digitalWrite(bPin, HIGH);    // set the in high which when input, enables PU
    pinMode(bPin, INPUT);        // set all of the pins to input
}

} [/code]

I use 3 of the 3 wire cables…

Kurt

Normally, you would use open collector drivers on the rows, and have pull-ups on the columns.

So if no key was pressed, reading the four bits of the columns would give you all high (1). When a key is held down, a row and a column are connected together. when that particular row id driven low, the column line will go low. (one way).

You normally don’t want to press two or more keys at one time, although the open collector drivers can tolerate it. Adding an ‘OR’ gate to the output (column) lines can give you a “key pressed” line if desired.

Shift registers can be added to make an SPI interface, which cuts down on the pins needed for larger keyboard arrays. One can also “share” the drivers, and drive LED’s with them at the same time (simple multiplexing).

Alan KM6VV

Ok i have play with the color changing as well.
(Color doesn’t come right with the iPod cam)

Would be nice to have a live decrease in the color from green to red. But don’t know how…

Tell me if you want me to post on my DIY Thread instead of this one… :open_mouth:

Either place is fine as we are giving and taking of ideas for both of our projects…

in my DIY remote, what I am thinking is that I would like to emulate something like what is on my phone or the like, with a small symbol that looks like a battery that is filled with the percentage, with color changing as you mention from green to red to maybe blinking… Does not have to be very large, I am thinking one text line size (12 pixel tall, maybe fit 3 on the line so leaves about 32-40 bits of area to fill, which for me I think something like 8 states would be more than enough… But I don’t use Lipos…

Kurt

Something like the battery icon on the iPhone 4?

Alan KM6VV

Just done with the continious transition of the color from the percent value…!
(Also added a simple - one way bar)

It could be an icon. Or a little percent value… In fact i can import an icon from de SD card then show a % and change the color…

I wouldn’t want the continuous color change, (OK, maybe 3 shades), Just go to RED at the appropriate point (20%?).

Alan KM6VV