Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Announcements
  3. 💬 Parking Sensor

💬 Parking Sensor

Scheduled Pinned Locked Moved Announcements
8 Posts 7 Posters 2.2k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by hek
    #1

    This thread contains comments for the article "Parking Sensor" posted on MySensors.org.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alex B Goode
      wrote on last edited by
      #2

      I am going to abuse this use case to handle the 'toilet occupied' events because it is a well known challenge of presence detection

      :-)

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Reza
        wrote on last edited by
        #3

        i think HC-SR04 is a bad sensor for parking . this sensor can not detect distance If there is some angle.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Alex B Goode
          wrote on last edited by
          #4

          Now after hundreds of tests I can only confirm that HC-SR04 isn't really a sensor to rely on.
          Yes it shows something and it is somehow correlated with reality but... the deviations are so big!
          In my case it shows stable results if you point it onto a wall... if you put a book, hand or try to dance in front of it... so unreliable measures! I even tried to apply statistical methods to filter outfitters silly errors etc... too bad!

          1 Reply Last reply
          0
          • David PinnockD Offline
            David PinnockD Offline
            David Pinnock
            wrote on last edited by
            #5

            I've had some success with this but not using the HC-SR04. As others have commented this sensor is rubbish at anything except detecting a good flat surface like a wall for example.

            I instead used the Sharp GP2Y0A02YK0F. You have to re-write some of the code to use this as it just provides a sense voltage you have to convert in to a distance. There is lots of useful information on the comments section here https://www.sparkfun.com/products/8958. Which is where I managed to come up with the function below.

            int pingSharpSensor(){

            int voltageLevel;
            int sum = 0;
            int averageReading;

            for(int i=1; i<10; i++){
            voltageLevel = analogRead(distancePin);
            sum=sum+voltageLevel;
            delay(20);
            }
            averageReading=sum/10;

            float v = (averageReading/1023.0)*5;

            int cm = int(61.681 * pow(v,-1.133));

            if(cm>MAX_DISTANCE){cm=MAX_DISTANCE;}

            Serial.print("Distance ");
            Serial.println(cm);

            return cm;

            }

            1 Reply Last reply
            0
            • X Offline
              X Offline
              xypzo
              wrote on last edited by
              #6

              Hey David,
              Could you share the working code (with the SHARP sensor integrated) with us?

              1 Reply Last reply
              0
              • E Offline
                E Offline
                ElectroLund
                wrote on last edited by
                #7

                Cool project! I like the LED ring. But not near as cool as a traffic signal. Just sayin'.
                http://www.electrolund.com/2010/07/traffic-light-parking-assistant/

                1 Reply Last reply
                1
                • A Offline
                  A Offline
                  APL2017
                  wrote on last edited by APL2017
                  #8

                  Thank you for great project. I built it, it works fine except occasionally it starts flashing red when was left along for couple of hours without any objects moving in front of the sensor. It happens at least couple times per day. Sensor replacement did not fix it. The only way to get out of it is to restart Arduino. Any idea what is going on?

                  Found fix for this problem at https://forum.mysensors.org/topic/1734/parking-sensor/57 by Dan.S. Please update the library.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  14

                  Online

                  11.7k

                  Users

                  11.2k

                  Topics

                  113.1k

                  Posts


                  Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • MySensors
                  • OpenHardware.io
                  • Categories
                  • Recent
                  • Tags
                  • Popular