Shop OBEX P1 Docs P2 Docs Learn Events
LDR sensor — Parallax Forums

LDR sensor

wafa86wafa86 Posts: 44
edited 2010-09-06 08:04 in Accessories
Hi every body

I need your help in LDR sensor, I want to write a code on LDR and I need to read the value of lightness that the LDR sense and send it vai bluetooth, the problem is when I make serin to the LDR it take a value and cannot be uderstood, so it transmited vai bluetooth in rabish value. how can I use the basic stamp to convert the value of LDR into ASCII code and transmitted vai bluetooth?????

thank u

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-08-27 12:03
    Could you post links to the parts you are talking about. A LDR is a resistor, perhaps the sensor you are referencing has other parts that outputs serial but I don't know.
  • wafa86wafa86 Posts: 44
    edited 2010-08-27 12:16
    I know the LDR is a resistor but it job in my circuit is to sense the light, I want to send the amount of light that it is sensing by convert this amount to ascii code and send it to the bluetooth how to do such a thing?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2010-08-27 16:12
    Using an "LDR" is covered in PBASIC Help under RCTIME and sending the value/result is covered in PBASIC Help under SEROUT.

    Post Edit -- There is more information on LDR'ing in "Stampworks", too.
  • oscarkorneroscarkorner Posts: 2
    edited 2010-09-06 02:26
    There are two issues here:
    - the amount reflected back to the LDR will also depend on the particulars of the object (meaning you can't accurately determine distance for an arbitrary object)
    - background noise... there are some simple ways to get around this that I can tell you if you want.

    If you are serious about measuring distance I would suggest ultrasound. It is also possible to do this with light but short distances are very difficult due to the high speed of light.
  • MoskogMoskog Posts: 554
    edited 2010-09-06 08:04
    oscarkorner said
    If you are serious about measuring distance I would suggest ultrasound...

    Where did this distance issue come in here?
Sign In or Register to comment.