Triger a low for a second

Discussion in 'General Electronics Chat' started by stadham, Mar 6, 2008.

  1. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0
    I have a light sensor that is connected to my microcontroller and I need to send a logic low for only a second. Telling it it is dark out side. Is there a circuit that can hold that input pin low for a short amount of time then put it back high?

    Thanks in advance,

    Randy
     
  2. mik3ca

    Active Member

    Feb 11, 2007
    189
    0
    I remember seeing a circuit in 130-in-one electronics lab that Radio shack sold to my family years ago. I think it is called "One-shot multivibrator".

    Do a search for that and see what happens.
     
  3. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0
    Thanks I will look that up now.
     
  4. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    Another name for "one shot multivibrator" is "monostable multivibrator."
     
  5. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    Does your µC have an interrupt function that can tell the program to look at the light sensor input for one second to verify that it stays low that long? Or, am I going off on a wild goose chase...not knowing why you need the 1 second input? ;)

    Ken
     
  6. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0

    Thanks another google search I go
     
  7. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0
    Good Question: I am not sure but I think it is because the software wants it that way. My MC does have interrupts but when it stays low longer it hangs up.
    BTW I am using a Arduino. I have posted over there at the Arduino forum with no luck so I came here for help.
     
  8. mrmeval

    Distinguished Member

    Jun 30, 2006
    833
    2
    That's strange! Can you post the text of your program? I've held the suckers low for *days* without that problem. I have a normally closed contact and the arduino monitors it for change. I've done it with normally open but in this case I wanted to monitor for broken wires.

    Ah I notice you're trying to make the arduino wake and sleep via light. I've not done that but was planning on it for a data recorder as soon as I can figure out SPI flash chips.

    Take a look at this
    http://www.arduino.cc/playground/Learning/ArduinoSleepCode
    http://www.evrimsahin.com/itp_blog/?p=32
    http://www.freeduino.org/ The World Famous Index of Arduino & Freeduino Knowledge
     
  9. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0
    Thanks for the links I have the code from the Arduino site using the 2 pin code. The others refer to a sleep and wake up using serial input. I would like it to sleep and wake on its own.

    I fixed the circuit and can sleep and wake my Arduino manually now all I need to do is get a sensor to do it.

    Still looking...
     
  10. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0
    I seem to have solved the problem. The Arduino does not seem to mind having the interrupt pin held high in the dark. I just have the Arduino check the status of the pin and when it goes high it is dark. Seems to easy but then software was never my strong suit.
     
  11. KMoffett

    AAC Fanatic!

    Dec 19, 2007
    2,576
    231
    Glad to hear that it worked. I too am working with an Arduino for a robot for our Computier Science lab. Actually I'm on the hardware side, but have to be aware of the programming our students need to do. Also, have been playing with a PICAXE and was using the interrupt function to watch a switch...so thus my question.

    :)

    Ken
     
  12. stadham

    Thread Starter New Member

    Mar 6, 2008
    7
    0
    I would like to use the Arduino with my middle school students building robots. but I am not sure if they are ready for c programing. I have looked at the picaxe it is a bit pricy when you add the development board on to the cost of the chip. Also it would have to be imported into where I am at. I like the simple flow chart programing of the picaxe though. I am using a simple (but a bit buggy) software to program a Mega 168 in the students robots I got localy and at a good price.

    Sorry i cant help with the picaxe.

    for my home use i prefer the Arduino.
     
Loading...