Connect with us

18dec to 5bin converter

Discussion in 'General Electronics Discussion' started by pyrohaz, Nov 22, 2012.

Scroll to continue with content
  1. pyrohaz

    pyrohaz

    33
    0
    Oct 28, 2012
    Hey guys, I've successfully designed a converter from 0-18dec to 0-11111bin using only diodes and resistors (cheap!) but I was wondering if there is a more efficient way of doing this?

    In the attached schematic, it requires 38 diodes and 5 resistors!

    Imagine the L's (logic input) to the left of the schematic to be low impedance voltage sources at 5v and the L's at the right (logic output) to be very high impedance (input of non-inverting schmitt trigger), worst case scenario will be 2 diode drops into 1Meg, in 100% efficient diode conditions, maximum current will be 5uA, therefore, using standard 1n4148 diodes, gonna expect a maximum voltage drop over 2 diodes to be around 1.2v (minimum stated value on the datasheet is 5mA). This is within specification of high being >(+V/2) and low being <(+V/2)

    But to the point, is there any more efficient ways, chips that can do this for me?

    Thanks, Harris
     

    Attached Files:

  2. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Depends on what you mean by efficient. Speed, power, component count, board area, which is it?

    Bob
     
  3. pyrohaz

    pyrohaz

    33
    0
    Oct 28, 2012
    Preferable component count and board area, are there any better ways to do this than just using steering diodes? Speed is not essential.
     
  4. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    A single 28-40ish pin micro, overkill in MANY ways but still cheap (about $1) and very low board real estate if you go with a small SMD package...
     
  5. pyrohaz

    pyrohaz

    33
    0
    Oct 28, 2012
    Well the thing is, i'm using it to input 18 switches into an arduino using as little pins as possible, i considered using an 18 part potential divider and analog reading but doing a direct port read is much more time efficient than analogread so unfortunately, using an extra IC seems a tad pointless! Any other suggestions?
     
  6. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Well, that is a different problem than you originally posted. Your circuit will not work If more than one switch in on.

    Are you talking about 18 switches, which can all be in either state at any time? Or are you talking about a keypad where you expect one key to be pressed at a time?

    If the latter, you can arrange them in a 4x5 matrix and you would need 9 pins on the micro to read them.

    Bob
     
  7. pyrohaz

    pyrohaz

    33
    0
    Oct 28, 2012
    1 Switch at a time is no problem! Also, if they're not high, they will be in a high impedance state (unconnected to either rail). Getting significant data out of switch combinations is not a big deal, I just need to know which switch is on at what time. This is where I will just do a direct port read of the 5 bits and at any instantaneous time, get the result of which of the 18 switches is high.
    Cheers!
     
  8. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    Why? You listed your primary concerns as board space and parts count, based on that criteria your original solution is the one that is a tad pointless... There is always a give and take on all solutions weigh your options based on your criteria, a matrix input as Bob suggested is generally the best choice...
     
    Last edited: Nov 22, 2012
  9. pyrohaz

    pyrohaz

    33
    0
    Oct 28, 2012
    Very true! Apologies for my ignorance. I shall be more specific next time I post questions.

    What I should ask then is:
    Based on my above diagram, can I achieve the same results using less components BUT sticking to discreet components?

    Sorry about that one guys!
     
  10. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,497
    2,838
    Jan 21, 2010
    Yes, you have 11 diodes you don't need. (All the ones pointing from left to right in the first "column".
     
  11. pyrohaz

    pyrohaz

    33
    0
    Oct 28, 2012
    Brilliant! I've now omitted the unneccessary diodes, Thanks for the help guys :)
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...
Electronics Point Logo
Continue to site
Quote of the day

-