IR Sensor for LED Lightbox Artwork Questions

Discussion in 'The Projects Forum' started by wattsDXB, Mar 26, 2015.

  1. wattsDXB

    Thread Starter New Member

    Mar 8, 2015
    6
    0
    Hi All,
    I was very glad to find this forum as someone who is very new to building electronics from scratch! I am an artist and have previously disassembled solar-powered garden lights for my work, but am now trying to create lightboxes that will react to the viewer as they approach the wall-mounted piece by lighting up in a way that increases with proximity. After various attempts (and a fair share of burnt components :)) I think I have the design I want to use. This functions pretty much as I need, aside from a few issues mentioned below. The box is designed for interior spaces and is planned for gallery or private homes. This led to the decision to use a rechargeable 9V battery, rather than 4AAs (easier to change), but I am still not certain this is optimal.

    The reason I am posting is to ask a few questions and see if anyone might have suggestions for improvements. I'm hoping that listing my questions numerically might make it easier, as there do seem to be quite a few... Thank you so much for looking at my post and please do let me know if you have any suggestions at all or need any additional info. (PS: sorry for the hand-drawn diagram- I hope it is clear enough!)

    1) Is the 9V rechargeable battery the best to use? I am using a 5V regulator to step down voltage, which seems wasteful. Is there a more optimized solution that is easily rechargeable? The current setup only runs for a bit over 2 hours at full load (lights on). Although this should be fine in a gallery or home each day, I'd rather get more out of it if possible. I am trying to avoid the need to plug this in to run, although plugging in to charge would be excellent as the battery could stay in the box.

    2) Should I have resistors or diodes anywhere on this to protect components?

    3) Is 22 AWG wire ok for this?

    4) (minor issue) There is a slight "jitter" from the light at times, which seems to happen at the outermost distances. Is there a way to smooth this?

    Thank you all again for any assistance you might have. I'll do my best to address any replies or questions as quickly as possible.

    ir sensor wired photo small.jpg drawn wiring for ir sensor small.jpg
     
  2. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    Search for Sharp brought no result.
    My battery choice would be either 4 AA NiMH or 2 LiFePo4.
     
  3. wattsDXB

    Thread Starter New Member

    Mar 8, 2015
    6
    0
  4. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    Hello,

    It can well be that you already blew the opto device, as you have a battery of 9 Volts and the maximum voltage allowed is 7 Volts:

    Sharp_GP2Y0A0YK0f_absolute_ratings.png

    Also the output is a function of the distance and does not switch:

    Sharp_GP2Y0A0YK0f_distance_vs_voltage.png

    I have also attached the full datasheet.

    I also am missing the decoupling capacitors at the voltage regulator.

    Bertus
     
  5. wattsDXB

    Thread Starter New Member

    Mar 8, 2015
    6
    0
    Thank you, Bertus!
    I'm glad you pointed out the issue of connecting the IR directly to the 9V, rather than the regulated voltage... totally missed that!
    All of the sensors seem to have survived somehow, but I'm swapping over to 4AAs for now and ditching the regulator entirely.

    Even with a new sensor, I was still getting the slight flashing of the light at maximum sensor range. It took me a bit to figure out that the gray sweater I was wearing was the cause- using a white paper or T-shirt removes the issue entirely.
     
  6. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
  7. wattsDXB

    Thread Starter New Member

    Mar 8, 2015
    6
    0
    Thank you again for your feedback, Bertus!
    I've read the section you mentioned (and those preceding) a few times last night and this morning, but must admit the concepts explored are a bit over my level of competence at this point. I am still learning the basics of DC circuit building. Could you let me know the advantage of using a comparator over the setup I am presently using? Would it be more stable or draw less power perhaps?

    Right now, the unit is working exactly as I would like, but I am still looking for a better power supply solution, as asking a gallery or private owner to switch out 4 AA batteries regularly would be cumbersome. I looked into the LiFePo4 batts, but am hoping for something that would get me 5V optimally. I have found USB power packs that look promising, but need to order and test.

    I updated the newest circuit using a drawing software- this removes the regulator and changes power supply to 4.8V from 4 AA NiMH batteries. Are there any points I should consider putting a resistor or diode in this?

    Thank you all again,
    Josh
    IR Sensor (1).jpg
     
  8. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    I would try adding a resistor, ( pot ) between Sharp output & the base. With a close reflector, max V output, adj R for just full LED brightness.
    Battery life: A Li Ion battery pack eroneously called " SOLAR CHARGER " provides 45,ooo mA hours @ 5 V, rechargeable from 5V charger. Assume 50 mA drain then good for 900 hr. Size about 3 X 5 X .75 in.
     
    Last edited: Mar 27, 2015
  9. wattsDXB

    Thread Starter New Member

    Mar 8, 2015
    6
    0
    Thanks so much, Bernard! I think this will work great. I had to order online as there are no local suppliers here, but will hopefully have it in a few weeks.

    I actually ran into a major issue with this circuit that I am at a loss to explain and have been trying to solve the last few days through testing... After running for a while, the light will begin to dimly flicker, even though there is nothing to trigger the IR sensor. If the sensor is triggered, the light becomes bright, but still remains flickering afterwards. I have tested this with 3 different units (entirely new pieces and power supply on each) but all have led to the same issue afterwards. I am still using the circuit diagrammed above with 4AA batteries (fully charged). Any ideas what might be causing this issue at all? I even tried a different model Sharp sensor, but got the same result.

    Thanks so much for any ideas!

    (EDIT: Sorry, I forgot to mention that I tried a few versions without the capacitor, with the same result)
     
  10. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,779
    932
    it could be, your sensor is reacting to a build up of heat in your circuit. try a new position for the sensor that is further away from any source of heat
     
  11. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    Speculation: The plot only goes out to 150 cm, so beyond 150 cm the output is not specified, if receiver has automatic gain control, then it would be wide open & looking for a signal or any thing it could find, maybe a few gamma rays? If the noise is short bursts then maybe some of it could be filtered out?
    Strange that no specs listed for output other than voltage, presume it is something like output of an OP Amp.
     
  12. wattsDXB

    Thread Starter New Member

    Mar 8, 2015
    6
    0
    Thanks so much for the suggestions everyone!
    I ruled out heat and thought to follow Bernard's suggestion to find a way to filter out any noise coming from the sensor (either internal or external). This led me to http://www.robotroom.com/DistanceSensor3.html, where he did some extensive tests on these particular sensors. Using his idea of adding capacitors (although my own method is much less precise), I was able to remove any light flicker with an additional capacitor across the ground and sensor output. I'm not quite sure if I am following his instructions correctly, but it seems to be working great so far! I will run 2 units all day tomorrow to see if this continues. In the final version, my LEDs will be a much greater distance from the circuit, which may require additional testing, if I understand the principle of this correctly.

    One (likely stupid) question: do I have the polarity of the capacitor correct here? I am circling it on the diagram and it seems pretty straightforward. But after seeing some videos on how they can act if hooked up incorrectly, I thought it best to double check!

    Thanks again! Josh
    Engager v.4.jpg
     
  13. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,779
    932
    your neg. leg is attached to the most negative point in your circuit. I would say it is correctly hooked up.
     
  14. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,170
    395
    Just a thought: What if we did not let the LED & driver see the Sharp out untill there was a legal signal, SIG. Not knowing what the output looks like, made it into a two step process; first filter signal, R6, C3 then compare sig. to .5V, R12, R7 & R8; if filtered sig. is greater than .5 V , comparator ( LM393 ) goes low turning on 2N3906, PNP, connecting SIG to driver, 2N3904. If raw sig contains noise pulses they will pass thru C1, be inverted triggering 555 one-shot set for .1 to .5 sec. If 555 output goes hi , + bias on comparator is increased, shutting out unwanted noise. This came up as I was trying to go to sleep last night. Lightbox 00000.jpg
     
  15. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    The Sharp sensor takes heavy current in short bursts, so as a minimum you need a 10µF (or preferably higher) cap directly at it's supply terminals.
    If, after fitting this cap, you still have the issue, isolating the supply to the LEDs with a diode and a cap will make the LEDs more or less immune to the sensor drain.
    However... You're asking a lot from your battery. If you pull 200mA to the LEDs and the Sharp takes 100mA to 200mA pulses IIRC, your battery will soon be moaning - a 'scope on the supply would probably not be bad.
     
Loading...