Car Keypad

Hi,
about pin change interrupts. You would have to read the datasheet for the Atmel to get an idea of how to use the PCints. But they do exactly what you want: when ANY of a set of pins changes, an interrupt can be generated. It's easier when they are all on the same port, but it can be done.

As for power saving. I don't know a lot about sleep mode, but there are several bits that turn off pieces of the chip that aren't used. like analog input, secondary timer, UART, TWI etc. Again it's in the datasheet. It saves some power when running, but sleep mode is probably going to save more.

HTH,

Connect a second wire from all keys to a interrupt pin. Probably, to avoid trying to awake the uC every time you press a key, you'll need a "state variable" telling you if the uC is awake or sleeping. I think it works...

Thanks chiick, I'll have to do some reading.

Lima, wouldn't that tie all of my buttons together? Then pressing one presses all?

I wonder how much my car actually pulls when it's off. I'll have to go measure sometime soon. If it dwarfs what the nano is using now, I won't worry about it. I'm really ready to be done testing and eager to install.

wouldn't that tie all of my buttons together? Then pressing one presses all?

Actually that will work if you isolate the buttons with diodes on the lines going to the interrupt pin.

It looks like the only real considerable power savings comes from power-down. To come out of power-down I would need to bring either pin 2 or 3 LOW.

The problem is, those pins are already held LOW all the time in my circuit. (HIGH when button pressed) Perhaps for version 2.

If a typical car battery is about 45 amp hours, and I'm pulling 20mA or so, does that mean it would have to run for 1125 hours (almost 47 days) to half-discharge the battery?

If a typical car battery is about 45 amp hours, and I'm pulling 20mA or so, does that mean it would have to run for 1125 hours (almost 47 days) to half-discharge the battery?

Yup. Unless something shorts out, you won't drain the car battery with the Arduino.

Just as an update, I've decided to go with a different keypad. You see, the one pictured above has a solid membrane across the front. The first few buttons had a nice tactile response to being pressed, that is, you could 'feel it' when you pressed the button. But the last two, although they did work, didn't feel like you were doing anything. Since I'm ridiculously picky (and worried about longevity) I found another keypad. I found this one on a 2008 Escape: (Although it's on heaps of other models/years)


Imgur

It has a nice feel, is good enough for Ford to use on their vehicles now, and still has the backlight. Unfortunately, it is not wired the same internally, so my old board is useless. I rewrote my program to handle the new keypad properly, but I still needed a new board. Instead of making another monstrocity like that first board, I learned enough Eagle to design a PCB and I've already sent it off to be profesionally fabbed. So now I'm waiting on this to come in the mail (a couple more weeks to go):


Imgur

Note: That 1K resistor on the right side, above the 330, is incorrectly labelled. It should be 100. This board should fit just perfect into a radioshack 1x2x3in project box, and already have holes drilled to line up with the internal mounts in it.

I have the weather-proof external connectors, all my headers, resistors, internal connectors, and optical relays also. This board is more modular than the other one with quick disconnects for all external connections, and I'll be able to easily remove the Arduino Nano for reprogramming. I think I'll stick it in the door with some servo tape, and see how it holds up.

I'll post more when I get the pieces in!

My board came in today and it looks good! I can't wait to get home and try it out. I ordered two, just in case I royally mess the first one up on assembly. :slight_smile: I really would hate to have to wait a whole extra month. I'll post more pics when I get it all put together.


Imgur


Imgur

So here I am, closer to the inevitable car door cutting.

Populating the board:

Imgur
I got a little better as I worked from right to left. I didn't realize how little solder that SMD parts required.

All assembled:

Imgur

Testing the board:

Imgur
Everything works perfectly!

Fitting into the box:

Imgur
The screw holes line up perfectly. The connectors on each end were a bit taller than I had expected, though. The lid still closes, but it pinches the wires a bit. I'll trim a little useless plastic off the top of the connectors and it should be fine.

VERY COOL - I love to see an arduino put to use in the "real world"

I didn't see much power protection going on there. What are you doing to keep away nasty voltage spikes and reverse voltage?

(a car's power is notoriously bad)

Thanks George!

I'm not exactly an EE, so I'm real green on most of this. I knew that car voltages can be nasty, but as per other discussions around these forums, people have been running Arduinos from cars seemingly fine. The datasheet for the Nano says it should be ok up to 20v. I hadn't even considered reverse voltages at all, does this tend to happen on a car? For reverse voltage, one would throw in a diode on the power line? As for the spikes, a capacitor on the power line?

Honestly the only thing I considered was a drop in voltage on cranking the car. I doubt much that anyone is going to be using the keypad while cranking, so I didn't think a restart would hurt anything. I suppose that the dip could lock up the chip instead of just restarting it. I'll be actually running it in my door soon, so I'll have to see.

If you have any good suggestions for cleaning up the power, or maybe a good place to look, let me know.

great project :slight_smile:

you should consider some safety for the arduino, there is quite some noise there!

i made this:

just take the input part, that should block the biggest problems

Thanks!

So the 1N diode keeps the current from flowing backwards, the zener diode would cut out voltages above 15v, and the choke would clean up the power a bit. What exactly do the two different caps do? Decoupling to clean up the power? Something else?

I assume that everything to the right of C3 I should ignore, as I don't want to reduce the voltage to 5v?

Yes, you dont need C3,IC1,C2 when it should only protect :wink:

L1 blocks HF noise (should be 2A cappable).

the 1N makes in case somebody messed up the polarity a safety, and in case the input drops it prevents the C1 from getting discharged.

D2, can also be a 20V type, this limits the voltage.

C1 (Ultra Low ESR) smoothens out small ripple.

C3 could be removed, but im used to always put C3 and C2 with a 7805 :slight_smile:

Maybe I'll work this into my board when I get home. This would mean waiting another MONTH before I could install, though. Ugh.

Nice and clean prototype work, First class job.
Keep on building,
make stuff.

KG2

hmm, nice =P

where did you make your own pc board =D

id like to make my own ;D

I used BatchPCB.com, which is a service of SparkFun. It's relatively cheap, but it takes a month or so to get your board.

You'll need to learn Eagle (or similar). There's a tutorial on PCB layout using Eagle on SparkFun's site here:
http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=109

wow >_>

well, i can wait a mont to get started on arduino sheild making lol