Help: BOD and lpd8806 = PNP

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Help: BOD and lpd8806 = PNP

Postby SamBamboo » Wed May 16, 2012 10:25 am

Ok so here is my issue. When my microcontroller reaches BOD level due to low battery I need it to set the strip off. As of right now when the controller reaches BOD level, the micro is held off but the strip is still lit, and the only way to turn it off is by charging the batteries for a moment, turn it back on then normally turn it off. "sleep_mode". I know some controllers offer BOD as interrupt, but the one I am using doesn't. One suggestion was to use a PNP transistor in hopes that when the controller turns off by BOD, it'll set the base pin low (by default), "turning the strip off".

Q1: will this work?

Q2: I am using 3 meters of strip, will the strip cause the PNP the burn up? If not will it wear on the PNP and eventually cause failure?

The way I will hook it up is: collector to 5V on strip, emitter to 5V rail, base to resistor to digital pin
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby adafruit_support_bill » Wed May 16, 2012 11:24 am

If I understand you correctly, that should work. I'd use one of these MOSFETs: https://www.adafruit.com/products/355
Follow the link in the "Tutorials" tab for driving led strips.
User avatar
adafruit_support_bill
 
Posts: 16644
Joined: Sat Feb 07, 2009 9:11 am

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Wed May 16, 2012 11:52 am

Thank you!

I did do a simple test with an led, and yes once the BOD level is reached it does set the pin low, turning the led off.

Are you suggesting a MOSFET because it can handle more power? less ware over time*
There then poses an issue, the threshold is a little less than 2.5 volts, but if I have the BOD set to 1.8 volts will the strip turn off before the BOD initiates?
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby adafruit_support_bill » Wed May 16, 2012 12:03 pm

You microcontroller and strip are still running at 1.8v? The strips are designed for 5v. I'd be surprised if you got them to run much below 4. What kind of battery are you using?
User avatar
adafruit_support_bill
 
Posts: 16644
Joined: Sat Feb 07, 2009 9:11 am

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Wed May 16, 2012 12:09 pm

*separate supply / sharing ground*

So for your lpd8806 I would wire it the same but instead of r, g, or b pads, I would hook it to ground?
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby adafruit_support_bill » Wed May 16, 2012 12:14 pm

instead of r, g, or b pads, I would hook it to ground?

Yes.
User avatar
adafruit_support_bill
 
Posts: 16644
Joined: Sat Feb 07, 2009 9:11 am

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Wed May 16, 2012 1:24 pm

One more thing: I see you recommend 100 - 220 ohm resistors, since I will be using one MOSFET that will be supplying r, g, and b should I change the recommended resistance?
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby adafruit_support_bill » Wed May 16, 2012 3:26 pm

There are two wiring diagrams on that page. The top one is for the MOSFET and needs no resistors. The diagram with the resistors is for a TIP120 BJT.
User avatar
adafruit_support_bill
 
Posts: 16644
Joined: Sat Feb 07, 2009 9:11 am

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Tue May 22, 2012 9:20 am

So N-channel MOSFETS don't do the trick. You need to switch the 5V, not the ground. The strip will stay lit (dim) when ground is switched off, even when ground is disconnected.

Waiting for some P-channels.
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Tue May 22, 2012 9:25 am

Gate - VCC; // pullup resistor.
Source - data pin
?
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby adafruit_support_rick » Tue May 22, 2012 10:39 am

Have you considered fielding the BOD interrupt, and just turning the lights off in code?
BOD comes in on Vector #1, which is also External Pin, Power-on Reset, Brown-out Reset and Watchdog System Reset.

I'd think you would be to handle the interrupt, turn off the lights, and then jump to the bootloader RESET handler.
User avatar
adafruit_support_rick
 
Posts: 3158
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Tue May 22, 2012 4:36 pm

That was my original idea, but I didnt think I could do that using the 1284p... How would I do that?

http://www.atmel.com/devices/atmega1284 ... =documents
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby adafruit_support_rick » Tue May 22, 2012 5:18 pm

MAJOR DISCLAIMER: I haven't tried to do ANY of this. It's all a guess.

You can't do it using the arduino attachInterrupt() call, since arduino doesn't have a number for reset interrupts. You would have to use the ISR() macro. I don't know if there's a mnemonic for the reset vector, but
Code: Select all
ISR(0){
}
ought to work.
After you turn off the lights, you will have to jump to the real reset handler in the boot loader. To do that, I think all you have to do is jump to 0x0000.
User avatar
adafruit_support_rick
 
Posts: 3158
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Tue May 22, 2012 7:42 pm

This idea is a little crazy but...

First of all I don't exactly understand the data sheet specs for MOSFETS, but I know these will eat up some power RDS(on).
I dont like the idea of having to throw 2.5V+ to turn the thing OFF, that is sort of the opposite of what I want to do.

I could easily pair an ATtiny45 to the system to handle this ridiculous situation. Have it read a digital pin from the 1284p,
once it reads LOW that mean BOD has been triggered on the 1284p, then ATtiny45 will run some code to turn the strip off, wait a second, turn itself off, set external interrupt and wait for the 1284p to turn on.

I do like this idea much better, I can understand it much easier than digging into ISR(), but will ATtiny45 consume way more power than the MOSFET?
I am going for a well working system, as well as making this system run as long as possible on batteries
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Re: Help: BOD and lpd8806 = PNP

Postby SamBamboo » Tue May 29, 2012 2:50 pm

Ok very easy solution that is actually better than the original.

I built an on/off latching circuit using a momentary push button, some components and the FDS4465 P channel mosfet. This thing is sweet, 2.5-7VDC operating voltage and 10A maximum current! Small circuit that can easily be implanted in any design. When in off state it typically uses < 0.01uA.

Ada you should design this and sell it, there are probably many people who would want this. With this people wouldn't need to dive into the low level programming to put their micro into sleep modes.
SamBamboo
 
Posts: 19
Joined: Sat Sep 24, 2011 1:05 pm

Next

Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit

Who is online

Users browsing this forum: No registered users and 3 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [113]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]