Adc Pin "duplicator"

sedeap

Senior Member
When I need 2 ADC and have only one available, I use some "branching trick" for duplication (or even triplication) putting one relay and chaining the common gate to ADC pin, so when active (n/c) read one Analogic device, and when release (n/o), read the another analogic device, giving me two (or even three) reads to "play around".
This is specially useful when work with P08 (only one low res ADC pin). Of course this solution needs calibration and a debouncing wait.
Code:
The code is simple:

inicio:
wait 1
readadc 1,b1
high 0
wait 1
readadc 1,b2
low 0
if b1............
;)
Some pic worth more than hundred words...
Diagram HERE
For 3 adc simply chain in step-ladder another relay.
:)
 

KMoffett

Senior Member
Got this error when I tried to view your circuit:

The image “http://www.elpato.homeip.net/ventas/PicaxeWeb/ADC_Multiple.PNG” cannot be displayed, because it contains errors.

I did the same thing to get 2 ADC readings on one ADC input on a 08M. I used a C-Form MOSFET relay. Worked great. No switch bounce, and I had no errors using ADC10 reading 10T/10K pots. Though my schematic shows it driven from P0 like yours, mine was actually switched from another external circuit in my project.

Ken
 

Attachments

Last edited:

sedeap

Senior Member
revision

Mmm... I don't have problems with the link... but... just in case I copy the diagram in JPG this time.
Same Diagram in JPG

Yours look good too !
seems you use one AQW614EH PhotoMos but my datasheet seems to be too vague in wiring diagrams.
How control it? half voltage to N/O? or invert?
In your diagram put the two states in single chain...:eek:

Same approach, but I've that relay available to 5v, and use it.
Another solution is using one 74HC4066 analogic quad switch and drive it in sequence.

:rolleyes:
 

KMoffett

Senior Member
The photomos is constructed so that with both LEDs off: pins 7 and 8 are "closed contacts", and pins 5 and 6 are "open contacts". When both LEDs are on: pins 7 and 8 are "open", and pins 5 and 6 are "closed". The two sections can be used independently, or by putting the LEDs in series and connecting Pins 6 and 8 together (as in my circuit) the IC becomes an SPDT relay (as in your circuit). For critical circuits the AQW612EH might be a better, with Ron of only 1Ω to 2.5Ω.

Ken
 
Top