Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Is this an effort to avoid multiplexing and consuming I/O lines?
As for 9v to 5v operating voltage, as long as the ADC module uses a fixed reference voltage and the keypad buttons are connected to this same fixed reference voltage, you will get consistance results.
I suggest a 5v or less regulator to power the circuit and a 3v zener as an external reference voltage.
So do all the keypads feed into a single ADC input? Will you be perform dual button decoding?
mcs51mc said:Key pad is battery powered with 2 9V batteries. Any idea why 2? Did you try with only one?
Where is your PIC powered from? Same battery?
mcs51mc said:I suggest you do the follwing tests first to know how your keypad is working:
1) With power supply (not battery) set @9V press all keys one by one and measure the output with a voltmeter. That way you will know the voltage of each specific key. If the maximum readout is 5V you can't use a 3V zener as a voltage reference for the PIC ADC like donniedj suggested
mcs51mc said:2) Repeat those measurements for some voltages below 9V (8, 6, 5, 3) and see what happen with the voltage/key. As long as they are equal to the first measurement you're ok. If you see variations from a 6V power you need to monitor that voltage in your PIC and:
a) give a "Change battery signal" or
b) make the compare values dependent of the keypad battery power voltage.
mcs51mc said:This is my learn, simulate, evaluate, coding approach
Coding starts only when you know how it works and you know what you want
Kyle-s4h said:It has 2 batteries, wired in parallel, simply to extend the "operating cycles" of the lock the keypad is designed for. It will work with one, equally as well.
Yes, the PIC is powered from the same battery.
Kyle-s4h said:What I do not quite understand is if it is better to have a lower "range" -- ie. 0-3VDC over 0-5VDC, as I have it setup now.
Kyle-s4h said:It is a 4 wire setup, one ground, one power out, one control line for LED/peizo and 1 analog output line for key reads.
Sorry but I don't get thisKyle-s4h said:The maximum readout will only be what I put into it.
Kyle-s4h said:The ADC line (RA0/AN0) has a pull up resistor attached to the 5VDC power rail
Kyle-s4h said:So, eric1388, can you point me in the direction of a good regulator for use with 9VDC batteries (I did a quick search this morning and didn't find what I was looking for
msc51mc said:Now the final question. Why the 22k resistor?
If it's only a resistor network between green wire and ground you can connect power supply directly to it and also to the Vref of the PIC ADC.
mcs51mc said:Since you make your own system why not using 4 AA rechargable NiMh batteries? That gives you 4*1.2 = 4.8V / +2500mAh.
Will last way longer than your 9V batteries
Single 9VDC battery -- 1700 cycles to low battery warning, 2560 cycles to failure to retract solenoid.
Double 9VDC batteries -- 4000 cycles to low battery warning, 5520 cycles to failure to retract solenoid.
Large battery pack" 29,000 cycles to low battery warning, 36,000 cycles to failure to retract solenoid.
eblc1388 said:I have not used them before. I just put in a search phase in Google "low quiescent current voltage regulator" and I got many hits.
eng1 said:I've used the LM2936-5. It's a Low Drop Out - Ultra Low Quiescent Current regulator. Here's the datasheet: https://www.electro-tech-online.com/custompdfs/2007/08/LM2936-1.pdf
It's expensive if compared with other regulators, but perfect when low quiescent current is required.
msc51mc said:Now the final question. Why the 22k resistor?
If it's only a resistor network between green wire and ground you can connect power supply directly to it and also to the Vref of the PIC ADC.
Kyle-s4h said:Actually, I remembered later why I did it this way -- like I said, 22K just because it was there, but I could have used anything really -- it was just a matter of getting voltage to the keypad and I didn't really care exactly how much to start with.
The resistor was put there in the first place because, although the resistor network would work fine under normal use, the pin on the PIC *could* go low during initialization and cause a direct short to ground if the power rail were connected directly, without a pullup resistor.
Me neither but I think it's something like the attached file. The value of R1 should be calculated not "because it was there"Nigel Goodwin said:I'm not really very clear on exactly how it's wired
mcs51mc said:Me neither but I think it's something like the attached file. The value of R1 should be calculated not "because it was there"
Don't care about the PIC type, just select first from list
But I think here it's better maximumNigel Goodwin said:... ...than the minimum 2K source impedance!... ...
#0 0x00 .00
#1 0x05 .05
#2 0x0A .10
#3 0x0F .15
#4 0x14 .20
#5 0x1B .27
#6 0x22 .34
#7 0x2B .43
#8 0x35 .53
#9 0x41 .65