Shop OBEX P1 Docs P2 Docs Learn Events
BS2 and simple third party parts (LED, solar cell) - how to? — Parallax Forums

BS2 and simple third party parts (LED, solar cell) - how to?

IceFireProIceFirePro Posts: 86
edited 2010-06-09 04:32 in BASIC Stamp
Hello, I am pretty new, just got my BS2 stamp and I'm curious about certain things, as I have good experience with BASIC language from before and I am into some more interesting projects that I can do with the stamp.

Question: How do I go in order to use simple third-party parts? Example : A mini key chain flashlight with mini LiIon battery in it and a solar panel for recharging that no longer works. I take it apart:

-How do i measure the LED's (in terms of needed voltage and mA consumption) before using them in a project

-What do I need to know/measure in order to use the solar battery too?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-08 15:19
    First you need to learn about basic electricity and electronics, things like Ohm's Law and Kirchoff's Law. Both have good articles in the Wikipedia ... look them up and read them.

    To characterize an LED, you'd use a variable resistor to run some current through it and measure the voltage across it and the current through it (by measuring the voltage across the known resistor. Typically you'd start with a 1K resistor and maybe a 6V power supply. You'd then vary the resistance to get a set of other values across a range of currents and you'd plot a graph. Most LEDs will handle currents up to maybe 20mA. The approximate voltage depends on the material used to make the LED. For most red LEDs, the voltage is around 1.7V. Blue LEDs might have a voltage on the order of 3.2V. The Wikipedia has a nice article on LEDs too. I think they give some other typical voltages.

    For the solar cell, you'd do something similar. You'd estimate the amount of current produced (based on the size of the solar cell or what it's connected to) and connect an appropriate resistor across it. You'd expose the solar cell to a known light source and measure the voltage across the resistor and across the solar cell which would tell you the current being produced. You'd vary the resistance to get a set of values and you'd try everything at several light intensities and graph the results.

    Post Edited (Mike Green) : 6/8/2010 3:25:46 PM GMT
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-08 16:13
    Thanks a lot!

    What is the situation with the bright leds, the ones used in flashlights? What about the big ones (1W/3W)? Is there to power those thru BS2?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-08 16:35
    There are all sorts of LEDs as you've noticed and there's tremendous variation in their electrical characteristics. You need to do some web research and look for datasheets on the LEDs you're interested in. These will give you the Vf (forward voltage) and maximum current for the LEDs you want.

    The "white" LEDs usually have a Vf in the range of 3.3 to 3.6. Since power = voltage x current, a 3W LED will draw around 1A (at roughly 3-4V). A BS2 can't directly control that much current. Download and read Nuts and Volts Column #6 to see several possible solutions to that.

    Go to the main Parallax webpage and click on the Resources tab to find a link to the Nuts and Volts Columns index.
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-09 02:54
    Thanks! Can't te BS2 control that current thru the Vin pins (directly connected to the power adapter)?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-09 03:03
    Read the Nuts and Volts Column. It doesn't matter whether you're trying to run from Vdd or Vin, the problem is that the Stamp I/O pin can't directly control more than about 20mA.
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-09 04:32
    Right, but maybe if i use a transistor connected to Vdd/Vin AND the I/O pin... I'll read, thanks![noparse]:)[/noparse]
Sign In or Register to comment.