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. 💬 Light Level Sensor - LM393

💬 Light Level Sensor - LM393

Scheduled Pinned Locked Moved Announcements
19 Posts 6 Posters 5.8k 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.
  • A AndreD

    how to connect 2-5 lm393.

    mfalkviddM Offline
    mfalkviddM Offline
    mfalkvidd
    Mod
    wrote on last edited by
    #8

    @AndreD said:

    how to connect 2-5 lm393.

    Use the other analog pins (A1 to A7)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AndreD
      wrote on last edited by
      #9

      Use the other analog pins (A1 to A7)

      It's clear. I do not know what variables need to assign additional.

      1 Reply Last reply
      0
      • hekH hek

        This thread contains comments for the article "Light Level Sensor - LM393" posted on MySensors.org.

        ramoncarranzaR Offline
        ramoncarranzaR Offline
        ramoncarranza
        wrote on last edited by
        #10

        @hek hi, I've been searching to see if I can find anything on th LM393 Sound sensor, I know I saw one but can't find it, looking to build a simple soundsensor with the LM393 unit.

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #11

          @ramoncarranza said:

          LM393

          google on "LM393 datasheet"

          ramoncarranzaR 2 Replies Last reply
          0
          • hekH hek

            @ramoncarranza said:

            LM393

            google on "LM393 datasheet"

            ramoncarranzaR Offline
            ramoncarranzaR Offline
            ramoncarranza
            wrote on last edited by
            #12

            @hek I found this sketch, but how do I incorporate it to my sensors library and serial gateway?

            1 Reply Last reply
            0
            • hekH hek

              @ramoncarranza said:

              LM393

              google on "LM393 datasheet"

              ramoncarranzaR Offline
              ramoncarranzaR Offline
              ramoncarranza
              wrote on last edited by
              #13

              @hek
              int soundDetectedPin = 10; // Use Pin 10 as our Input
              int soundDetectedVal = HIGH; // This is where we record our Sound Measurement
              boolean bAlarm = false;

              unsigned long lastSoundDetectTime; // Record the time that we measured a sound

              int soundAlarmTime = 500; // Number of milli seconds to keep the sound alarm high

              void setup ()
              {
              Serial.begin(9600);
              pinMode (soundDetectedPin, INPUT) ; // input from the Sound Detection Module
              }
              void loop ()
              {
              soundDetectedVal = digitalRead (soundDetectedPin) ; // read the sound alarm time

              if (soundDetectedVal == LOW) // If we hear a sound
              {

              lastSoundDetectTime = millis(); // record the time of the sound alarm
              // The following is so you don't scroll on the output screen
              if (!bAlarm){
                Serial.println("LOUD, LOUD");
                bAlarm = true;
              }
              

              }
              else
              {
              if( (millis()-lastSoundDetectTime) > soundAlarmTime && bAlarm){
              Serial.println("quiet");
              bAlarm = false;
              }
              }

              1 Reply Last reply
              0
              • hekH Offline
                hekH Offline
                hek
                Admin
                wrote on last edited by
                #14

                Not sure I understand what you mean by "incorporate".

                Suggerst sending a TRIPPED value 1 when sound is detected for the a SOUND child sensor.

                ramoncarranzaR 1 Reply Last reply
                0
                • hekH hek

                  Not sure I understand what you mean by "incorporate".

                  Suggerst sending a TRIPPED value 1 when sound is detected for the a SOUND child sensor.

                  ramoncarranzaR Offline
                  ramoncarranzaR Offline
                  ramoncarranza
                  wrote on last edited by
                  #15

                  @hek what extra code do I need to add to the sketch so tha it sends the tripped value to my gateway?

                  1 Reply Last reply
                  0
                  • hekH Offline
                    hekH Offline
                    hek
                    Admin
                    wrote on last edited by
                    #16

                    Look at the motion sensor as an example.

                    ramoncarranzaR 1 Reply Last reply
                    0
                    • hekH hek

                      Look at the motion sensor as an example.

                      ramoncarranzaR Offline
                      ramoncarranzaR Offline
                      ramoncarranza
                      wrote on last edited by
                      #17

                      @hek will do thanks

                      1 Reply Last reply
                      0
                      • pgregg88P Offline
                        pgregg88P Offline
                        pgregg88
                        wrote on last edited by
                        #18

                        Hello. I need a sensor that can sense the green status led on an audio amplifier and report state via MQTT. The goal is an accurate source of Power State (ON/OFF) for the audio amp. The light is a fairly dim led. The sensor could mount directly on it. Is the LM393 appropriate for this type of requirement?

                        Here is the problem... Home theater setup. TV and sound app both start at the same time. However, the audio amp has a "feature" where it cuts it's power off if it doesn't sense audio for more than two minutes. As soon as you mute the TV for an advertisement, the audio amp shuts down (while the remote control thinks the audio amps state is ON). Then, everything is out of sync and my wife and kids start calling me names. Bad ones.

                        1 Reply Last reply
                        1
                        • hekH Offline
                          hekH Offline
                          hek
                          Admin
                          wrote on last edited by
                          #19

                          Oh, what a crappy thing. 2 minutes is nothing. You can't fix this by bypassing the circuitry that shuts the thing down?

                          The only way of knowing is to mount a photo resistor over the led and see if you get any reading when it is on. Use the trimpot to adjust the binary output.

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


                          24

                          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