How hard to convert this sketch to be used with a different sensor

Discussion in 'Embedded Systems and Microcontrollers' started by james211, Feb 4, 2014.

  1. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    So I have a sketch that works very well, its a water level sketch using a URM37 ultrasonic sensor. The problem with using that sensor is they are no longer available in the US (DFRobot has them, but they ship from China). I would like to be able to use this sketch with a different ultrasonic sensor, but I have no clue how hard it would be to convert the entire sketch to use a different sensor.

    Would anyone be willing to take a look at the sketch for me?

    My biggest concern is that these sensors don't seem to be designed to be in a humid environment so the rate of failure is higher than other sensors. Ideally I'd find a system that maybe uses differential pressure as those sensors seem to more stable under humid conditions for long term. Agree or disagree?

    In the end I need to be able to monitor the depth of the tank remotely. With my current setup I can see it from anywhere either via the built in server on my network or via Xively, it works very well!

    Thank you!
    D
     
  2. inwo

    Well-Known Member

    Nov 7, 2013
    2,433
    315
    Can you post the pertinent sketch?
     
  3. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    It's attached to thread as a zip file.
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,798
    1,103
    People don't trust zip files :(. Post as a .gif or .png.
     
  5. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    Good to know! It's a multi-page so I figured that was the best option. I'll have to post each individually then...not sure it will let me attach that many in fact.
     
  6. inwo

    Well-Known Member

    Nov 7, 2013
    2,433
    315
    Isn't there just one that covers the basics?

    Saves time.
     
  7. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    Here are the basic code pieces.
     
  8. james211

    Thread Starter Member

    May 29, 2012
    210
    2
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,544
    2,369
  10. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    for one the URM37 has its own built in arm processor, it is basically a standalone unit that interfaces to other uC's or a PC through serial communication.... those other ultrasonic sensor modules still require a uC to operate them and do all the data conversion to get the distance measured...

    Why not get an Arduino UNO or something similar to connect these ultra sonic modules to?
    http://arduino.cc/en/Tutorial/Ping?from=Tutorial.UltrasoundSensor
     
  11. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    I am connecting it to an arduino uno!
     
  12. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Well, there you go, looks like a whole sketch has been written already for you, :)
     
  13. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    Well I already have a sketch written that I like, I just want to know how hard it would be to replace the current sensor with a new sensor on the current sketch.
     
    Last edited: Feb 4, 2014
  14. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Unfortunately, the first module you mentioned is controlling the ultrasonic transducers itself, there is no "driver" circuit, so if you want to "copy" that first module, the other 2 you mentioned wont work, you will have to get some ultra sonic transducers and re create the circuit to drive them.
     
Loading...