0

power for led strip is frying my breakbeam sensors
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

power for led strip is frying my breakbeam sensors

by heaversm on Wed Feb 18, 2015 4:11 pm

Hi - I am trying to set up breakbeam activated led lighting for my stairs. I've got the following components

led strip: https://www.adafruit.com/products/887
power supply: https://www.adafruit.com/products/352
breakbeams: https://www.adafruit.com/products/2168
mosfet transistor: http://www.adafruit.com/datasheets/irlb8721pbf.pdf

I've attached photos of how I've got everything wired. If you're using the fritzing diagram, the 9V represents the 12V DC, the IR sensor on the left is the transmitter, the IR on the right is the receiver, and the white LED is the led strip.

My sketch is as follows:

Code: Select all | TOGGLE FULL SIZE
int ledPin = 6;

int sensorPin = 3;
int sensorState = 0, lastState=0;


void setup() {
  pinMode(sensorPin, INPUT);
  digitalWrite(sensorPin, HIGH);

  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

// the loop function runs over and over again forever
void loop() {
 
  sensorState = digitalRead(sensorPin);

 
  if (sensorState) {
    Serial.println('low');
    digitalWrite(ledPin, LOW);
  } else {
    Serial.println('high');
    digitalWrite(ledPin, HIGH);
  }
 
  lastState = sensorState;

 
 
}


When I run this - the whole thing works for a second, and then malfunctions. The last time I tried it, my IR transmitter started smoking. I've tested all the components individually and they still work, but I'd like to know what I'm doing wrong so I can avoid destroying $130 worth of components. Can you provide any advice?

Thanks!
Attachments
Screen Shot 2015-02-16 at 7.11.37 PM.png
Screen Shot 2015-02-16 at 7.11.37 PM.png (332.1 KiB) Viewed 796 times
IMG_20150218_145851.jpg
IMG_20150218_145851.jpg (970.6 KiB) Viewed 796 times

heaversm
 
Posts: 31
Joined: Thu Apr 12, 2012 10:58 am

Re: power for led strip is frying my breakbeam sensors

by heaversm on Wed Feb 18, 2015 4:12 pm

Just a note that in the photo, the + wire from the LED strip should be going to the power rail, I reassembled it improperly for the photo (it is currently going to the ground rail).

heaversm
 
Posts: 31
Joined: Thu Apr 12, 2012 10:58 am

Re: power for led strip is frying my breakbeam sensors

by adafruit_support_bill on Wed Feb 18, 2015 4:16 pm

The fritzing diagram shows the break-beam sensor powered by VIN which is 12v (shwn as 9v).

The sensor is designed to be powered from 3.3 - 5.5VDC

adafruit_support_bill
 
Posts: 74965
Joined: Sat Feb 07, 2009 10:11 am

Re: power for led strip is frying my breakbeam sensors

by heaversm on Wed Feb 18, 2015 4:20 pm

Yes - but the LEDs need 12V - is there a way to lower the voltage to the sensors without implementing a separate power source?

heaversm
 
Posts: 31
Joined: Thu Apr 12, 2012 10:58 am

Re: power for led strip is frying my breakbeam sensors

by adafruit_support_bill on Wed Feb 18, 2015 4:26 pm

You can power the sensor from the 5v pin on the Arduino.

adafruit_support_bill
 
Posts: 74965
Joined: Sat Feb 07, 2009 10:11 am

Re: power for led strip is frying my breakbeam sensors

by heaversm on Wed Feb 18, 2015 6:31 pm

Ah! It seems so simple now that you say that. I did not know you could take a single power source and distribute it among the 5v and Vin pins. So is the arduino sort of dividing the voltage among 5v and 12V? Or alternating?

I've attached a revised diagram of the wiring. It seems to be working well, but let me know if there's anything else that could potentially be harmful when running this for a prolonged period of time.
Attachments
Screen Shot 2015-02-18 at 5.30.50 PM.png
Screen Shot 2015-02-18 at 5.30.50 PM.png (341.67 KiB) Viewed 764 times

heaversm
 
Posts: 31
Joined: Thu Apr 12, 2012 10:58 am

Re: power for led strip is frying my breakbeam sensors

by franklin97355 on Wed Feb 18, 2015 6:38 pm

The Arduino is passing the 12v line directly to the Vin pin and passing the power it needs through a regulator and then passing what it does not use to the 5v pin.

franklin97355
 
Posts: 21309
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: power for led strip is frying my breakbeam sensors

by heaversm on Wed Feb 18, 2015 7:58 pm

Thank you very much!

heaversm
 
Posts: 31
Joined: Thu Apr 12, 2012 10:58 am

Please be positive and constructive with your questions and comments.