Connect with us

Switch inputs

Discussion in 'Electronic Basics' started by Jan Nielsen, Apr 9, 2007.

Scroll to continue with content
  1. Jan Nielsen

    Jan Nielsen Guest


    Since most picaxe´s have a very limited amount of analoge inputs, I was
    wondering if its possible to make a switch using some of the digital

    For exsample. using 4 outputs to control which sensor is being read.

    I tried a simple expiriment with a transistor and a LM35 sensor, but
    when I apply power my meter reads 3.6V from a 9V source on the LM35
    output pin (which should be 0.26V).

    I have made a rough schmatic here
    VDC+ is top, ignore the small + signs eagle has placed.

    As stated readout is 3.6V and should be less than 1V (10mV per degree C)

  2. John Fields

    John Fields Guest

    The transistor is being driven like an emitter follower and your
    LM35 readout is dropping whatever voltage is left after the resistor
    and the base-to-emitter junction take their share of the 9V.

    If you want to switch sensors like that you'll need to use a proper
    analog switch, or reed relays.
  3. Jan Nielsen

    Jan Nielsen Guest

    John Fields skrev:

    Do you have some model numbers to search for.
    Maybe another controller for 3 more outputs is better/cheaper, its only
    about 4$/pcs.

  4. feebo

    feebo Guest

    yep - this entirely possible.

    You need an analogue multiplexor (google this). Basically this is a
    multi-way switch - I have on my desk a tube of twenty-five 74HC4051
    eight-way multiplexors as it happens.

    These have eight inputs and a single output (not strictly as they are
    analogue and an input can be an output etc, but lets' think of it like
    this for now) you select which input is connected to the output with a
    3 bit binary address - this could be provided using 3 outputs from
    your pic, so now with just four pins on the PIC, you have 8 analogue
    in/out pins, and this is just to wet your appetite.

    there are loads of other chips that will do this and you could even
    build your own out of analogue switches like 4016 or 4066.

    remember that these three chips I have mentioned are fairly "rough 'n'
    ready" (but then so is the PIC analogue input) so they probably won't
    be any good for *really* precision audio/video or signal processing
    but such chips do exist - with an appropriate price-tag :eek:)
  5. John Fields

    John Fields Guest

  6. Jan Nielsen

    Jan Nielsen Guest

    John Fields skrev:
    The sensors are primary LM35 and LM34.
    I am using picaxe 18X to read them (has 3 adc inputs, would like 6 or 8)

    0.5C would be nice but 1C will work too.

  7. Jan Nielsen

    Jan Nielsen Guest

    feebo skrev:
    Thanks, I have ordered a few of these to play with.

  8. Lord Garth

    Lord Garth Guest

    Beware letting the input go below'll let the magic smoke out.

    If the chip runs on a bipolar supply such as Vss=-5V and Vdd=+5V, you'll
    be fine. If Vss=0V and Vdd=+5, beware of the input swinging negative
    by more than about .6V (one diode drop).
  9. jasen

    jasen Guest

    yup, there's chips for this eg 4051 (3 pins to select from 8 inputs)

  10. Jan Nielsen

    Jan Nielsen Guest

    Lord Garth skrev:
    The control pins (ABC) will be handled by the picaxe digital out, so a
    logic 5V og 0V.

    The in/output goes to picaxe adc in.

    The 8outputs goes to the output pin of LM35 (0.02V - 1.50V)

    The power source is battery, 4.5V, maybe I can find a 5.0V pack instead.

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.
Electronics Point Logo
Continue to site
Quote of the day