Author Topic: 2 bits into 1 analog  (Read 1357 times)

0 Members and 1 Guest are viewing this topic.

Offline UstaryTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
2 bits into 1 analog
« on: February 19, 2011, 03:01:59 PM »
Hi, for my problem with contact switches,'m trying to experiment every option. One thing i would like to do is to read 2 contact switches using a single analog pin. so that a 00 would be 100 , a 01 200, a 11 300, and a 10 400, for exemple. All that matters is that each combination gets a completely different valu on the analog output.

Since i don't know much about electronics, an someone help me design this circuit?

Thank you

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: 2 bits into 1 analog
« Reply #1 on: February 19, 2011, 04:08:38 PM »
Hint1:
Look up R-2R resistor ladder DAC (Digital to Analog converter).

Hint2:
Instead of switches of 00, 01,10,11 equal to four ADC values, use ranges ie: 00 == (>75 && <125), 01 == (>175 && <225), etc.

Offline BEAMer

  • Full Member
  • ***
  • Posts: 105
  • Helpful? 0
Re: 2 bits into 1 analog
« Reply #2 on: February 22, 2011, 01:44:39 AM »
Hi,

How about this... Use an analog multiplexer to channel analog signals by using the digital signals from the switches as mux select lines. Before that, you will have to use resistor voltage dividers and have 4 analog voltages ready....!

BEAMer

Offline UstaryTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: 2 bits into 1 analog
« Reply #3 on: February 22, 2011, 05:29:01 AM »
Sorry, but i have no idea what any of that is.. anyway, i serched on the ADC, it seems both simple and practiucal enough for me.  Thank you

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: 2 bits into 1 analog
« Reply #4 on: February 22, 2011, 02:14:56 PM »
Hi,

This should help.

(Click for a better resolution)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

 


Get Your Ad Here