Shop OBEX P1 Docs P2 Docs Learn Events
Simple Project — Parallax Forums

Simple Project

MarkUKMarkUK Posts: 2
edited 2014-12-19 14:20 in Learn with BlocklyProp
Hi

I'm starting to plan one of my first project with you guys, and i'm wondering if anyone can give me some advice.

I would like to take the following components;

LM34 Temperature Sensor
http://www.parallax.com/product/604-00011

PING))) Ultrasonic Distance Sensor
http://www.parallax.com/product/28015

and output both the values they return to a small LCD screen

Is this quite an easy project? If so, can someone give me some pointers and advice to get started

Thanks all

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-12-19 12:14
    It's an easy project once you know what you're doing but it takes a bit to get the hang of programming.

    Your project looks like a great match for the Ping object I recently posted. It allows one to calibrate the Ping sensor based on the temperature.

    The Ping object I wrote/modified, includes a demo program which shows who to output data to a terminal window. If your LCD screen is the type with a serial connection, the program should be easy to modify to use with the display. The less expensive parallel LCD screens will take a bit more work to use with the object.

    You'll need some way to convert the analog output of your temperature sensor to a form the Prop can read. One easy way to do this is with a chip like the MCP3208 (Parallax sells these).
  • MarkUKMarkUK Posts: 2
    edited 2014-12-19 12:53
    Thanks man, i'll checkout the link

    What's the smallest board available that the modules could be connected to?
  • Mike GreenMike Green Posts: 23,101
    edited 2014-12-19 13:33
    "smallest board" ... that depends on your experience level. An Activity Board has a built-in 4-channel Analog to Digital Converter and a little breadboard area where you can construct your device without soldering. You can use a 3-wire cable to connect one of the "servo" connectors to the PING off the board if you want. You could even use another cable to connect the temperature sensor to ground, +5V, and one of the ADC inputs. Use a small serial LCD ... they're easiest to use. Parallax and others sell them.

    If you want to go small, you'll have to do some soldering. A QuickStart Board would be good. You could use a QuickStart Prototype board to mount the LM34 and a header for the PING. You'll need an ADC like the MCP3208. The QuickStart Board needs a +5V power supply. Dimension Engineering sells small modules that take in voltages from +7V to well over +24V and produce +5V with a switching regulator.
  • edited 2014-12-19 14:20
    Here are some examples with the Propeller Activity Board programmed in Propeller C that you could use as ingredients:

    Ping)))
    http://learn.parallax.com/propeller-c-simple-devices/sense-distance-ping

    LCD
    http://learn.parallax.com/propeller-c-simple-protocols/half-duplex-serial

    LM34
    (Replace the potentiometer with an LM34)
    http://learn.parallax.com/propeller-c-simple-circuits/measure-volts

    I also wrote some LM34 test code the other day, but have not posted it on the learn site yet. Here it is:

    attachment.php?attachmentid=112411&d=1419027701
    /*
      Monitor LM34.c
      
      Displays LM34 outout voltage and temperatures in terms of degrees Fahrenheit
      and Celsius.
    */
    
    #include "simpletools.h"                      // Library includes
    #include "abvolts.h"
    
    float volts, degF, degC;                      // Voltage/temperature variables
        
    int main()                                    // Main function
    {
      while(1)                                    // Main loop
      {
        volts = ad_volts(3);                      // Meausre LM34 outpout voltage
        degF = volts * 100;                       // Convert to degrees F
        degC = (degF - 32.0) * 5.0 / 9.0;         // Convert to degrees C
    
        print("%c", HOME);                        // Top-left home position
        print("A/D3 = %1.3f V \n", volts);        // Display volts
        print("Degrees F = %3.1f \n", degF);      // Dispaly degrees F
        print("Degrees C = %3.1f \n", degC);      // Display degrees C
    
        pause(200);                               // Wait 0.2 s before repeat
      }
    }
    
    540 x 236 - 77K
  • Is there a similar example for only regular propeller spin code?
  • hanchome wrote: »
    Is there a similar example for only regular propeller spin code?

    Welcome to the forums. For SPIN examples, see OBEX

    http://obex.parallax.com/

    Is there a certain product that you are looking for support on?



Sign In or Register to comment.