Driving LEDs Directly From Microcontroller Pins

The first and third methods you show are fine, assuming the resistor is sized so that the 8 mA maximum port pin current is not exceeded. The difference between these two methods is whether the low or high side drive transistor in the processor is in series with the LED. Sometimes the low side transistors are a little more beefy, which is why you see method three more than method 1. However, either method is fine as long as you take care to not exceed the current spec for the pin. Also note that some processors have a total current spec that must not be exceeded. For example, you could have 10 pins each driving a LED at 8 mA, which would be fine individually for each pin. However, if the overall processor spec is that all I/O pins together can't source our sink more than 50 mA, for example, then you're still out of spec.Your method two is wrong as drawn. It will likely damage the LED or transistor. To fix it, add a resistor in series with the LED so that the LED current does not exceed its maximum rated value. For example, let's say the LED is rated for 20 mA max, and it drops 2.1 V in that case. With a 9 V supply, that leaves 6.9 V accross the resistor and the transistor. The saturation voltage of the transistor is probably around 200 mV, but for worst case analisys let's just say it's 0. 6.

9 V / 20 mA 345 , so the next size up common value of 360 would be fine. Working backwards, and this time assuming the 200 mV drop on Q1, the LED current will be 6.7 V / 360 18.6 mA. Even in a side by side comparison, it will be difficult for humans to distinguish that from the brightness achieved by 20 mA thru the LED.

Here is yet another method, which is useful when there is a external supply available that is a bit more than the processor voltage plus the LED drop:This uses the transistor as a switchable current sink, so the exact power voltage (9 V in your case) doesn't matter over a wide range. When the base is 0, the transistor is off and the LED is off. When the base is driven to 3.3 V by the digital output, the emitter will be about 700 mV less, or 2.

6 V in this example. The current thru R1 will therefore be 2.6 V / 150 17.3 mA. Since most of this current comes from the collector due to the gain of the transistor, that will be the LED current to a reasonable approximation.Note that the 9 V supply voltage didn't enter into the calculations. As long as it is above a minimum value, the transistor will sink very nearly the same current because the transistor gain changes little with collector voltage. If we give the transistor about 700 mV C-E voltage so that it is nicely in its linear region, then the supply must be at least the digital output level plus the LED drop, which comes to 5.4 V in this case. That means the "9 V" supply can vary down to about 5.

4 V without effecting the operation of this circuit.The maximum allowable supply is limited by the power dissipation in the transistor. Let's say we want to keep it to 150 mW or less. 150 mW / 17.

3 mA 8.

7 V, which is the maximum C-E voltage for the transistor when it is on. Since R1 will drop 2.6 V and the LED 2.1, that means the supply can't exceed 13.4 V. So this circuit will work nicely and run the LED at the same brightness even if the "9 V" supply ranges from about 5.4 to 13.4 volts

In the circuit I'm designing, I'm using an at91sam7s128 which is a micro-controller with an ARM7 core.

Its PIO0 to PIO31 provide 8mA max which is low to handle direct driving of LEDs like this:

simulate this circuit Schematic created using CircuitLab

UPDATED: thanks to jippie and Olin Lathrop for telling me about the resistor in series with the LED.

So some designers use a safer method, connecting PIO to the base of a transistor that acts like a switch:

simulate this circuit

Others just make a simple trick. They connect the anode of the LED to the power supply and the cathode to a PIO:

simulate this circuit

In the last method the LED will turn on when the PIO goes low - acting like GND - and current will be taken from power supply, not from the PIO like in the first method. So do I have to take care of maximum current of the PIO, although it just acts like GND, not like a power supply (like in the first method).

When I set the PIO low, does the pin really get connected to GND or something else?

NOTE: In this Atmel evaluation kit they use the last method, but I need to make sure.

·OTHER ANSWER:

In the circuit I'm designing, I'm using an at91sam7s128 which is a micro-controller with an ARM7 core.

Its PIO0 to PIO31 provide 8mA max which is low to handle direct driving of LEDs like this:

simulate this circuit Schematic created using CircuitLab

UPDATED: thanks to jippie and Olin Lathrop for telling me about the resistor in series with the LED.

So some designers use a safer method, connecting PIO to the base of a transistor that acts like a switch:

simulate this circuit

Others just make a simple trick. They connect the anode of the LED to the power supply and the cathode to a PIO:

simulate this circuit

In the last method the LED will turn on when the PIO goes low - acting like GND - and current will be taken from power supply, not from the PIO like in the first method. So do I have to take care of maximum current of the PIO, although it just acts like GND, not like a power supply (like in the first method).

When I set the PIO low, does the pin really get connected to GND or something else?

NOTE: In this Atmel evaluation kit they use the last method, but I need to make sure.

GET IN TOUCH WITH Us
recommended articles
news
What Would Happen If a Charger Tried to Pull More Current Than a QC 3.0 Source Can Output?
There are four possibilities maybe more but mostly 4.One the voltage will drop relative to the current being pulled. The voltage source is going out of regulation.Two the regulator will going into a overload mode and turn off Many Regulators have self protection circuits. This may cycle on and off until the condition is fixed. Three, the circuit will burn or short circuit or some other destructive state. A burned fuse or inductor or mosfet or ic. Four, unlikely, the circuit will go into a current limit mode.There is no way to know without all the part numbers and schematic. Of both your charger and the target (how it will act to under current conditions is even more complicated and guesswork) So best to not overload your circuit. The significant difference between the two source power output should be enough to make this common senseI've got this charger: It takes 12.7 - 16V input from a car and outputs 13.05V at 6.1A (80W)I want to utilize a USB-PD and / or USB-C QC 3.0 charger.I can get a USB-C trigger: It connects to a USB-C QC or PD power source and allows me to select the output voltage.What I want to do is connect:QC 3.0 Power Supply -> USB trigger set to output 12V -> 12V car charger for DJI battery -> DJI batteryThe idea is to use a QC 3.0 power supply to recharge a DJI battery (albeit slowly).QC 3.0 can only output up to 18W of power, so if I used the USB trigger to select 12V as the output voltage, the QC 3.0 source would only output a max of 1.5A, but the DJI battery charger wants to output 80W of power.Would this destroy the QC 3.0 source? Or would the QC 3.0 source just happily output a continuous 12V @ 1.5A and the DJI charger would simply charge the batteries at a slower rate (18W?) without damaging anything?·OTHER ANSWER:I've got this charger: It takes 12.7 - 16V input from a car and outputs 13.05V at 6.1A (80W)I want to utilize a USB-PD and / or USB-C QC 3.0 charger.I can get a USB-C trigger: It connects to a USB-C QC or PD power source and allows me to select the output voltage.What I want to do is connect:QC 3.0 Power Supply -> USB trigger set to output 12V -> 12V car charger for DJI battery -> DJI batteryThe idea is to use a QC 3.0 power supply to recharge a DJI battery (albeit slowly).QC 3.0 can only output up to 18W of power, so if I used the USB trigger to select 12V as the output voltage, the QC 3.0 source would only output a max of 1.5A, but the DJI battery charger wants to output 80W of power.Would this destroy the QC 3.0 source? Or would the QC 3.0 source just happily output a continuous 12V @ 1.5A and the DJI charger would simply charge the batteries at a slower rate (18W?) without damaging anything?
The Hottest Questions About Power Supply
Do you want to know about power supply? Here are some frequently asked questions.1. Will this video card work with this power supply?It needs approximately 149 Watt because the PSU requirements on most graphic cards are not really what they need to be. I am running a HD 4650 that needs "400W" but I only have 305W and has been working well for 2 years. Oh yeah not sure if it needs a 6 pin power connector so can not help you on that question. At the bottom is a link to "REAL" PSU requirements. EDIT: Oh I just looked on amazon and the XFX version needs a 6 pin power connector so it just depends on your model. I prefer XFX brand.2. How does a switching power supply differ from a power supply?Edit, solutions is doing weird and wonderful issues. I even have got here upon that while you are applying/ construction some thing with diverse relays, and applying SPDT and DPDT relays, it fairly is extra low priced interior the long-term to apply DPDT relays in determination to SPDT relays. it can be a 3PST Wingman3. Why is my power supply not staying on?A few ideas (and no, I am not making ANY assumption on your knowledge/Tech Level) A) Is board touching the case (Mounted correctly) B) Have you Disconnect all Peripherals and just booted the board. C) Are you using on-board Video or a separate Card (Voltages) Different cards (Video) use different voltages, the same as CPU's etc so I would disconnect all the extras and just boot the board. Does it beep? If the shut down is instant, then I would look towards you having a bad Motherboard (and/or CPU) but generally I would lean towards the board, but bear in mind, I am not there to assess, nor here to Judge.. Did you connect the speaker so you can hear any Bios Beep codes?4. Help with creating a computer--Power Supply?It depends on what you are going to be using it for besides average gaming. If you are going to power two monitors and color laser printer and some external USB drives as well as a high end multi-core CPU 600w wo not do. Some gamers get a bigger than necessary PS since they know they with get more memory, solid state harddrives, etc as their budget allows ( 1000W makes sense). However, if you are running only one monitor, no externals, and have a reasonable CPU 600 w is sufficient5. Power supply problem on my laptop?Your battery may be completely discharged. Just like other rechargeable NI-CD batteries, the Lithium-Ion battery will eventually loose its ability to keep its charge. The most simple solution is to buy a new battery.6. Buck converter based switching power supply?This is a simplified version of the circuit you have. Note the polarity is backwards from your circuit:7. How to test a Power Supply?Power supply Tester. They are cheap and will test ALL of your out put voltages and wattage. You can get them about anywhere. Very smart thing to do!8. 12VDC power supply for backyard stereo?go find your self a old pc in the trash and gank the power supply and tie into the 12vdc lines9. What power supply do i get?450w is fine!10. will my power supply power a 9600gt?It really depends on how long and how hard you push your system, you max out your wattage all the time might burn out that PSU, but most likly not11. help about power supply please?while a capability furnish is rated at 4 hundred watts meaning it may furnish as much as 4 hundred watts of DC capability. the capability furnish takes AC capability out of your wall outlet at a hundred and twenty volts and converts it to 12v, 5v, 3.3v DC for the drives, CPU, motherboard, and so forth. .. the certainty is that your computing device will use around one hundred watts AC capability or much less. A Kill-A-Watt meter might properly be bought for around $20 and that assist you to comprehend the real capability utilization of any equipment12. Power supply upgrade? ?Put it this way, a good quality 460W PSU may be better than a cheap 500W PSU. The key thing is the 12V current capacity, and the 6870 requires two PCI-E 6 pin power connectors. Most 460W PSU have only one, or none. So, I do question how they can properly power the 6870 with a 460W PSU, unless they had one designed to match the card. Do not accept that system if they use Molex to PCI-E power adapters, that can cause voltage drops and strange video card problems... PS: Their web site says there is an option for a 6770 video card, no mention of the 6870... A 6770 will run with a 450W PSU...
What Warning Labels Could You See on Products to Be Used in Space?
Nowadays there are warning labels on most everything: this is flammable, that will cause injury because it's sharp, this substance is poisonous, and that canister is under pressure, but what types of warning labels would you need for items designed to be used in a weightless environment? There is a very large set of possibilities. For real-world examples do some research on what NASA, Roscosmos, JAXA, ESA, CNSA do. The list below is just off the top of my head. Cannot be used in microgravity. Must be used in gravity field greater than X% of earth.Must be used in gravity field less than X% of earth.Cannot withstand acceleration greater than Y. Must be aligned along a certain axis for acceleration.Must be used at an atmospheric pressure greater than X.Must be used at an atmospheric pressure less than X. Cannot be used in Heliox atmosphere. Must only be unwrapped/used in an environment with a scrubber that can handle a particular chemical.Must be decontaminated via (some method) when moving from atmospheric composition X to composition Y.Must be exposed to hard vacuum for X hours before being brought into atmosphere. Requires shielding in a certain EM range. Requires grounding. Requires shielding from certain cosmic rays.Cannot be used during a solar flare of greater than X intensity.Cannot be used if organism X is present.Can only be used if organism X is present. Cannot be taken to an uncontaminated planetary environment.Can be injected into a person only if they have a certain symbiote/implant/genetic marker.Can only be used in temperature range X to Y. Can only be stored in temperature range X to Y.Do not change temperature at a rate greater than Z/sec OTHER ANSWER: The thing about silly warnings on earth is that most of them were added because someone, somewhere actually did it and did try to sue the manufacturer. Whether the warning can be followed in practice is irrelevant, as the only purpose is to try to give the manufacturer more leverage in case of a legal claim.So considering the actual incidents and accidents that have occurred in spaceflight, we can color things up a bit and warn:.
Related Questions of Gift Box
Here are top 10 questions about gift box asked by people online.1. How do you feel when you open a big gift box?I feel like I am opening the box for more than hour. It seems like you take forever!2. Wedding invitation etiquette regarding "no gift box" request?Where are you getting married? I ask because I am half Greek and in our tradition people pin money to your dress (or to ribbons on your dress). One of my cousins ended up with 10,000! I think it would be tricky to ask overtly for money but if you worded something carefully, and asked a close relative to start the money pinning perhaps you could 'adopt' this tradition? How about something like?: We are so grateful that you will be joining us on our special day and hope you understand that because we will be leaving the country soon afterwards we cannot carry wedding gifts. However!... we thought it would be fun to adopt the Greek tradition of pinning money on the Bride! Obviously, when you have been kind enough to travel to be with us we do not expect you to do this but as we cannot transport presents we feel it is a fun alternative for anyone who wanted to give us a gift. I am sure you could word it better than I have, but something along those lines. The great thing about this is that people get competitive! Enjoy!3. American Eagle outfitters gift box/wrapping?Yes you absolutely can! Just bring in your reciept, or even better yet, bring the item in too and they will wrap it all up again for you! That is if the particular store has gift boxes in stock and around this time of year, there is a greater chance they will not have any. Maybe call the store first and ask if they dos o you don;t waste a trip to the mall! Good Luck!4. I'm making a gift box for my best friend, help?her favorite movie? candy,beef jerky!:) stickers! nails polish(her fav color) tickets toa movie u can see togeth cd of her fav singer, poster a homemade bookmark:) her fav book hope this helps!5. Where to find a large gift box?Most of the card shops do large flat pack boxes6. i need a big gift box a human can pop out of ( kind of like a cake) denver area?go to the appliance or furniture store and get a big box. cover it with pretty paper7. What is the worst chocolate gift box you ever received?Do not recall the name brand, but some of the pieces of "fudge" were excrement, nuts included........way too chewy for my taste8. How do I wrap a gift in a box?Like any other present smarty!9. A birthday gift box ideas for my 19 year old brother?my suggestions are: - gift certificates for a spa; P500-P1000) - if he likes coffee, how about a mug from starbucks and a pouch of coffee to go with it; (P300-P1300); - his fav cds or a compilations ofhis fav music (original P250-P400/ burned P50-P70); - a 'pogi points' pouch or basket which includes blotting paper for face/ hand sanitizer/ hair wax, gel/ cologne (those are from BENCH are affordable and cute not to mention good smelling; - a bead necklace from beadworks (P50-P350); have fun filling the box!!10. Plain Black Large Gift Box?the post office. office max. target. walmart. big lots.11. What should I put in a themed gift box for my boyfriend?I would not worry too much about the theme, just fill it with stuff that he will love. Here's some suggestions =) -Make a homemade card -Homemade cookie or muffins -New earphones or an itunes gift card -snowboarding gloves -X-box game or points -Coupons (good for one massage etc) -Love jar (make 100 slips of paper or paper hearts and write out reasons why you love him cute quotes, or lyrics and put them in a decorated jar) -message in a bottle (love letter) -Sunglasses -Favourite candy or chocolate -cologne or body wash -framed photo of you guys -Photo calendar (use an online photo lab or google a template and make your own...add in important dates) -scrapbook -make a little book with the story of how you guys met -a watch -new T-shirt -snowboarding magazine -Movie tickets -Tickets to an upcoming concert -Wine -Mixed CD -Sports drinks -Buy some pillowcases and decorate them with fabric markers (put the best boyfriend in the whole world sleeps here, goodnight I love you etc) If you buy a roll of plain brown paper you can decorate it with markers for the wrapping. You could write lyrics all over it that remind you of him or draw cute pictures. Good Luck!
Occupancy Sensor Immediately Off After On
The first step is to read through the user's guide, and make sure it's not in a "test" mode. If after reading the manual it still wasn't working, I'd exchange it for a different unit.If the new unit didn't work, I'd either try a different brand/model, or forget about using an occupancy sensor.I attempted to install a Lutron 2 AMP occupancy sensor this weekend, replacing a simple single-pole switch.Installation seemed to be straightforward enough. However, when the time came to test it, it exhibited a funny symptom. About 9 out of 10 times it detected motion and tried to turn on the lights, the lights would be on for a split of a second, and then went off. Very occasionally, the lights would turn on and stay on, functioning normally.I suspected the switch might require a minimum wattage - I was using 4 LED bulbs, but after changing to 4 incandescent bulbs, the issue still remained.This sensor requires a ground wire, which is used to power the standby circuit. I made sure grounding worked. It did. In fact, the sensor wouldn't even function without the ground wire connected.I then tested the switch on a different location, also replacing a single-pole switch. The configuration of wires was identical to the previous location. This time, the lights wouldn't even turn on at all.I thought I must have broken the sensor, but I tested it again at the first location to be sure. It's not broken (at least not completely), and still exhibited the "immediately off after turning the lights on" issue at the first location.I am stumped. Was it likely that I got a bad unit? Or is the problem the quality of grounding ("weak ground")? Any advice/suggestion is appreciated!.OTHER ANSWER:I attempted to install a Lutron 2 AMP occupancy sensor this weekend, replacing a simple single-pole switch.Installation seemed to be straightforward enough. However, when the time came to test it, it exhibited a funny symptom. About 9 out of 10 times it detected motion and tried to turn on the lights, the lights would be on for a split of a second, and then went off. Very occasionally, the lights would turn on and stay on, functioning normally.I suspected the switch might require a minimum wattage - I was using 4 LED bulbs, but after changing to 4 incandescent bulbs, the issue still remained.This sensor requires a ground wire, which is used to power the standby circuit. I made sure grounding worked. It did. In fact, the sensor wouldn't even function without the ground wire connected.I then tested the switch on a different location, also replacing a single-pole switch. The configuration of wires was identical to the previous location. This time, the lights wouldn't even turn on at all.I thought I must have broken the sensor, but I tested it again at the first location to be sure. It's not broken (at least not completely), and still exhibited the "immediately off after turning the lights on" issue at the first location.I am stumped. Was it likely that I got a bad unit? Or is the problem the quality of grounding ("weak ground")? Any advice/suggestion is appreciated!
Mobile Water Treatment Unit Helpful After Flooding and Disaster
Mobile water treatment units can be attached to a trailer and it can be rented for location projects. The unit is equipped usually with a reverse osmosis treatment membrane as well as filters and other steps to filter and clean water.With a combination of the reverse osmosis and softening elements, the water is able to filter out water and give the water some balance. As you know, hard water consists of magnesium and calcium, when you add softeners it is able to neutralize the magnesium and calcium.Reducing the fluoride in the waterThey also will reduce chlorides and sulfur in the water, as well as, take out arsenic, fluoride, nitrates, and other ions that can cause heavy metal poisoning. It will allow you to clean the water in order to reuse it. They are used when it comes to oil field brine and mining tailings (or water recovered from within the mines). It is considered an industrial waste treatment, because it cleans the water that is found and then it separates the waste.These systems are to clean the groundwater or storm water that is found in construction areas. It will work well when the air is highly contaminated with some type of micro-particles. Mobile water treatments will place drinking water chemicals into he water that is pumped.Most of these machines can hold up to 12,500 gallons of water. It will discharge the solid material and sediments and is constantly processing the water so that it can eliminate as much of those contaminates as possible. The intake and discharge is sixty gallons of water a minute, so it is constantly taking more water in and releasing clear water.Reducing problems with drinking waterThe reason why many companies will rent this machines is so that they can get rid of the water that blocks or prohibits them from working and allowing the water to become cleaned and emptied into man holes. This is one way that construction and mining companies can be socially responsible. They clean the water before they dispose of them so that it doesn't harm anyone when they dispose of the water.When a company rents one of this machines, they will spend somewhere between $900-$1200 a day to pump out the water from their work area. Mostly construction, mining, and oil companies will find the need to rent these machines to help them with their work. They will do their best to get out as much water at once as possible so that the water can be pumped out quickly and so they can reduce the renting costs of a mobile water treatment.
How to Make Amazing Car Vending Machine From Cardboard
Cardboard is one of those materials that can be used in different ways. This material is quite flexible which is why it is easy to recycle. Many people make a range of items from this material.If you are one of those people who want to make lovely toys for their kids, then you can do it! All you need is DIY guts and a lot of cardboard material. No doubt that for this project, you have to get a lot of cardboard. Worried about where to find cardboard boxes? Well, these boxes are readily available at online box companies.At the moment, we are going to tell you the simple method of making an Amazing Car Vending Machine from Cardboard. Have a look:1. First of all, you have to mark lines on a plain cardboard sheet and then cut it with a sharp blade.2. Take another cardboard sheet of the same size and then apply hot glue on it with the hot glue gun.3. After that, you have to fix this sheet onto another sheet to make a side.4. Take two more cardboard sheets to make the 2nd and 3rd side of the vending machine. Apply a small amount of hot glue on the base of these sheets to fix them.5. Now you have to get a small piece of cardboard, and the fix it in the middle of one side with the help of hot glue.6. Take three more cardboard pieces and join them in such a way that it makes a slide for the cars.7. You have to fix this sliding piece onto the middle piece of the cardboard.8. To give support to the slide you have to put a big piece of cardboard under it.9. Apply glue on a small rectangular piece and then fix it down to one side10. Pass a big toothpick from the supporting cardboard and this small piece. In this way, both of these will not move at all.11. Take three ice cream sticks and then cut one and fix its pieces on the other two to join them.12. Now you have to get five square pieces of cardboard of the same length. You have to join them one after the other to make a small square shaped box.13. Glue the ice cream sticks beneath this box.14. Now fix this piece under the slide pieces of cardboard. The ice cream sticks will be making the box movable so that the cars could easily slide.15. Take paper pieces and roll than on a thin wooden stick one after the other. Now take two pieces of ice cream sticks and glue it on these wooden sticks.16. It is the time to make the entire system of the vending machine. You have to do some engineering stuff to make the system perfectly.17. Make use of wires and then fix them onto the battery. Make sure you have used a small battery. 18. Take an aluminum foil and use it in the system so that the wires don't move at all. You have to do the systematic steps carefully.19. When your system is ready, then you have to fix it in your vending set of cardboard.20. Join the ice cream sticks box with the thread to the roller. Fix the roller with glue onto the base of the box.22.Complete the remaining vending machine with cardboard according to your desire. You can do the finishing on your own in any style.21. Now you have to close the front side so that the internal systems hide completely·RELATED QUESTIONI didn't get Google Glass Explorer Edition. Is trying to learn Glass dev without the hardware a futile effort?No, you can still learn the fundamentals of Glass development without the hardware.There are three main approaches for accomplishing this:1) Visit the Mirror API documentation, get into the playground, and start hashing up some code. Download the PHP, Java, and Python library, whichever you're most comfortable with. Familiarize yourself with the jargon and converntions (timeline, bundles, menus, etc). Read the support documentation (second link below) to see how the Glass hardware actually functions. Build some apps to this specification. Soon enough, you will find a friend with hardware to t
no data
Manual has become one of the most competitive manufacturers with key strengths in industry experience, professional team and premium services.
no data
Contact Us

+86 020-22139352

If you have a question, please contact at contact

service@lifisher.com

Copyright © 2020 Manual - lifisher.com |Sitemap | 粤ICP备05105686号