Connect with us

38Hz flash

Discussion in 'General Electronics Discussion' started by Tony Cross, Oct 17, 2016.

Scroll to continue with content
  1. Tony Cross

    Tony Cross

    Oct 17, 2016
    Ive been asked to setup a Arduino infra red sensor which detects if something is placed between the transmitter and reciver, however they want the transmitter to generate a square wave form at 38Hz.

    Im not sure how to do this using an Arduino, however as its just a flash I need, I was hoping to have a seperate circuit that I can power off the 5v power of the Arduino to flash the LED at the required Hz.

    Any ideas if such a curcuit component exists?
  2. dorke


    Jun 20, 2015
    With the Arduino no extra component is needed.
    You simply use a single output pin ,and turn it on and off to drive a LED.
    each period at about [1/2] *[1/38] = 13.158 mSEc.

    BTW an Arduino is a gross overkill here.
    The simplest would be a 38Hz square wave osc with enable controlled by the infrared receiver.
  3. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    Toggle an output every 13ms. That corresponds to 38.5Hz.

    Far more easily, you can use the "Tone" command if you're not using PWM on certain pins.

    But... are you sure you don't mean 38kHz?
  4. AnalogKid


    Jun 10, 2015
    If the arduino is interfaced to both the transmitter and the receiver, then you can use it as both a modulator for the transmitter and frequency-detecting demodulator for the receiver, all in software. One way goes like this:
    Turn on the transmitter.
    Sample the receiver multiple times to see if it is in the on state continuously.
    Turn off the transmitter.
    Sample the receiver multiple times to see if it is in the off state continuously.

  5. BobK


    Jan 5, 2010
    If you are using a TSOP 38KHz IR sensor, be aware that it will reject a steady signal. Look at the datasheet carefully. You need to send bursts of 38KHz followed by a silent period.

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day