Shop OBEX P1 Docs P2 Docs Learn Events
Analog output to Digital Input on Sensors — Parallax Forums

Analog output to Digital Input on Sensors

MarkDeSouzaMarkDeSouza Posts: 17
edited 2014-12-19 06:59 in BASIC Stamp
I am using a GEMS Sensor (#224508) to detect liquid level. I have connected it to the Basic Stamp 2 Board of Education USB board as follows
Sensor Red Wire - Vdd
Sensor Black Wire -Vcc
Sensor Blue Wire - P0

However I am not able to get the Basic Stamp 2 to detect High or Low,

When connected to a multimeter in Low condition I detect a voltage of 0.3V and in High I detect 5.1V. Shouldnt this change cause P0 / P1 to detect a HIGH / LOW condition?

When I use a sensor from Honeywell (LLE102101) I do not experience this problem.

Any idea? The only difference between the two sensors I see is the presence of a Schmitt Trigger in the Honeywell Version. Would adding a Schmitt Trigger to the Gems sensor help me get the Basic Stamp to recognize High / Low ?

http://www.gemssensors.com/~/media/GemsNA/InstructionBulletins/225480.ashx
http://sensing.honeywell.com/index.php?ci_id=50127

Comments

  • MarkDeSouzaMarkDeSouza Posts: 17
    edited 2014-12-12 11:18
    Here are the files
  • Hal AlbachHal Albach Posts: 747
    edited 2014-12-12 11:48
    The Honeywell device output provides both logic levels. The Gems device is open-drain, meaning you must provide a pullup resistor to see a logic 1.
  • MarkDeSouzaMarkDeSouza Posts: 17
    edited 2014-12-12 12:05
    I was going to connect it to a Schmitt Trigger (Inverter) to convert the signal to analog using this. I was assuming that the only difference between the Honeywell sensor and the Gems one was the Schmitt trigger. Does the Vdd need to be conditioned in any way prior to supplying the sensor?

    http://www.newark.com/texas-instruments/sn74ahc1g04dckr/ic-single-inverter-sc-70-5/dp/67K2818?ost=67K2818

    Not being an electronic engineer, how would I go about selecting the right pull-up resistor ?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-12-12 12:47
    Not being an electronic engineer, how would I go about selecting the right pull-up resistor ?

    Hopefully someone will give you a real answer but my preferred method of selecting a pull-up is to use a 10K ohm resistor unless told otherwise.
  • Hal AlbachHal Albach Posts: 747
    edited 2014-12-12 13:03
    A Schmitt Trigger does not change a digital signal to analog, it basically cleans up slow changing signals and provides a clean digital output.

    On the Gems datasheet, second page, left side, under "Typical circuits" the middle one is the one you need. However, the diagram is very corrupt. At the bottom of that diagram it tells you to use a 4.7 K 1/4 watt resistor and it is connected between the red and blue wires of the sensor. If you look at the top diagram the resistor would be where the "load" box is. Just continue the blue wire to the Stamp input pin. Per the data sheet, use shielded cable or grounded metal conduit. You may or may not need a Schmitt trigger. It won't hurt but you will need to take into account that the Schmitt trigger is an inverter.
  • MarkDeSouzaMarkDeSouza Posts: 17
    edited 2014-12-19 06:59
    Thanks a lot Hal. I totally missed seeing the resistor in the middle diagram. So I had a few 4.7K Ohm 0.25W resistors ordered from Newark and in the meanwhile I had a couple of 2.2K and 1K Ohm resistors lying around, so I had them connected in series on a breadboard to amount to around 4.7KOhms and the sensors worked beautifully.

    Now I can have crystal glass tipped sensors work to detect level instead of the polysulphone variety that do not wear well with solvents.
Sign In or Register to comment.