How to replace a button with a light sensor

Discussion in 'The Projects Forum' started by Wehinges, Nov 2, 2015.

  1. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    I have a remote control with 3 buttons: open, close, and stop (the remote controls drapes). I am trying to convert it to the lazy persons remote, in that instead of needing buttons pressed, it will sense light or dark and move the drapes accordingly without human interaction.

    I have created several separate versions of light/dark detectors that work on their own. But I can't figure out how to combine those functions with the remote. I have also tried replacing the LED tester in my circuits with IR lights, before I learned remotes have IR codes.

    I have removed the open/close buttons on the remote (stop is useless in my desired outcome), and soldered wires to the leads. The remote still works if I short the leads.

    I have attached some pictures. The first is the remote as it currently is.
    14465182338911634024977.jpg
    The top 2 wires (white) go to the close function. The bottom 2 wires (gray) go to the open function. The other 2 pictures are 2 different versions of light/dark detectors.
    14465182863291487601961.jpg 1446518319930-747955989.jpg
    They are currently set up with LEDs as the output.

    In the end, I would like the drapes to close when it's dark, and open when it's light.

    Sorry in advance for any errors or stupidity, this is my first circuit project in many years. Also, a little warning: I really struggle at reading circuit diagrams. So please bear with me if it's more than something extremely basic.
     
  2. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Does the light sensor go into a Schmitt trigger so that there is a sudden and clean edge generated once in the morning and in the opposite direction at night?
     
  3. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    I think no. Sorry, but I'm not well versed and I don't understand a Schmitt trigger. Both of the sensors I sent images of do only one or the other (one senses light, the other senses dark, but neither do both). The dark sensor currently has a tlc3704 comparator and the light sensor has a 555 timer. But I would like to combine functions so one circuit could trigger one event in the morning and the opposite event at night, if possible.
     
  4. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Can you supply a link or schematic of the light sensor you have built. I frankly don't have the time or inclination to try to follow the wiring in a photo...
     
  5. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    F6CENTRGU7FA4LO.LARGE.jpg
    Sorry about that! This is the circuit for a light detector I have (not included in the picures), but my dark detector is based on the same circuit with the ldr and variable resistor switched.
     
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    No hysteresis (Schmitt trigger) there... Crap circuit posted by a newbie...

    The job can be done with a single light detector.

    How many TLCxxxx comparators are in your package?

    How long a pulse ("button push") do you need to open and close the drapes?

    Are you wedded to a 9V battery? Presumably you want this thing powered from AC because the light detector has to be on 24/7?

    Finally, do you own a DVM? You will have to measure the open-circuit voltage across the push buttons you are hacking into. What battery voltage does the remote run on?
     
  7. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    I have (9) tlc3704.

    The pulse can be nearly instantaneous. There was no need to hold the button down for it to work.

    I am not set on a 9v. My next step after I got this working was going to be to wire it up.

    I do own a dvm. Voltage across the buttons is 2.94v. The remote is run on (3)AAA currently.
     
  8. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Can you find an old cell plug-in phone charger that puts out regulated 5 to 9Vdc. They are a dime a dozen in the Thrift Shops around here... You could use that to power your project. Let me know the voltage you have or get...

    You connected wires across where the push-button switches were in the remote. We need to reduce the wiring between the remote and your outboard light detector circuit to just three wires (not four). To that end, you have to determine if any pair of the switch contacts are common to each other. Remove the batteries from the remote, and use your Ohmmeter to measure between pairs of the four contacts (six measurements). See if any two have a very low resistance between them. If so, then we will call that the "common" from the switches. That reduces the interconnect from four wires to three.

    Next, you need to determine if the common point is positive or negative with respect to the other two terminals. Put the batteries back in, put the voltmeter black lead on the newly found "common", and use the red lead to probe the other two contacts. Are they +2.94V or -2.94V?
     
  9. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Are your TLC3704's four per package as shown on the TI data sheet?
     
  10. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    Four per package? They are tlc3704cn if that helps?
     
  11. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Follow the link in post #9, look, and report back.

    Answer the questions in post #8.
     
  12. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    I have the circuit working using only one LDR, utilizing three of the four comparators in the package. I need your answers to post #8 in order to finalize the "button pushing" part of the circuit. Going to sleep now, be back tomorrow.
     
  13. roger finder

    New Member

    Nov 3, 2015
    5
    0
    Its depends either you want use it with analog electronics components or want to use microcontroller
     
  14. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    I have an old charger. It outputs 5.2Vdc.

    Both the set of left contacts and the set of right contacts output 0V. All other combos have a charge. Putting black on the left set gives a positive output, putting black on the right set gives a negative output.
     
  15. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Here is a simulated circuit. Uses three of the comparators plus almost any two small-signal NPN transistors. For simulation, I am letting 1 sec=1 hour. The independent variable of the simulation is LDR resistance (upper plot pane); outputs are shown on the lower pane.

    I didn't understand if you want to open the drapes in the morning or close them. If the reverse, just swap the outputs.

    I am simulating a LDR that goes from 50KΩ (night) to 200Ω (day), but the 10K pot will cover a wide range. I added R1 to minimize risk of damage if the pot gets set to zero Ω. Added supply bypassing.

    The LDR illumination detector U1 has a lot of hysteresis, so should make only one clean transition in the morning, and one clean transition at dusk so you get only one "open" and one "close" pulse per day. With the original circuit, you might have had hundreds.

    Drape.gif
     
  16. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    Thank you! I will test it out this evening when I'm home from work. I may have some questions on the diagram, but on my quick check I think I can follow along.
     
  17. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Obviously, the stuff inside the dashed boxes is for simulation only; you do not build it...;)
     
  18. Wehinges

    Thread Starter New Member

    Nov 2, 2015
    8
    0
    Sorry for taking so long, but I've been struggling to get this to work with no luck so far. I modeled it in Autodesk 123D Circuits to make sure my breadboard matched your diagram, and it did (with a placeholder for the TLC3704 that wasn't available, so I couldn't actually test it before I built it). I've attached a picture of what I built. It's messy, so I don't know if it'll be of any use. But I'm not really sure how else to troubleshoot. If it's any help, I'm getting 7.6V straight out of the power source, and by the time I get to the IR LEDS in the remote it's down to .25V. Any ideas on where I may have made mistakes?

    20151108_140356.jpg
     
Loading...