Help required with build

Hi there, first time in the forum here.

I want to build a small toy for my new grandson: a plastic ball with an accelerometer inside with led steps joined to it via npn transistors as switches and of course resistors.

I don’t know what transistors/resistors to buy!

I’ve already bought the accelerometer and led strips.

Here’s my simple schematic:

Untitled Diagram


Hi Rohan
As usual DF Robot are very vague. They only say it is a 3V LED strip so if your supply is 3V there probably is no need for a resistor.
You will however need the resistor for the transistor base. This will depend on the DC gain of the transistor.
You need a collector current of 80mA so assuming a gain of at least 80 you will need about 1mA into the base. The base will be always 0.6V more positive than the emitter so assuming a max 3V from the accelerometer you need to drop 2.4V. At 1mA that will be 2.4kΩ. Nearest preferred value above this would be 2.7kΩ.
If the gain of the transistor is greater use the above method to calculate a resistor. Approximations are OK, Transistor gains are quoted over a fairly wide range and are pretty tolerant beasts. The one thing you can be sure of is the 0.6V between base and emitter so the things tend to self bias.
Cheers Bob


Thank you Bob!


The ADXL335 outputs are not designed to directly drive a transistor.
The data sheet states they are voltage outputs varying between 0.1 & 2.8V.
It shows a 32k resistor in the series with the output. (see pics below)

You will need a micro device or some other circuitry in between to read the analog voltage of the ADXL335 and drive the transistor.

As the lights only need 80mA I would look at using a N-Channel Mosfet, they provide up to 200mA and driven by a GPIO pin on a micro would work nicely. Mosfets are voltage devices, transistors are current devices.




Hi James, Rohan
Sorry, I didn’t take the time to look at a data sheet. James you are correct, that device would not drive a transistor, nor would it I believe charge and discharge the gate capacitor in a mosfet. Whatever you do it seems to require some sort of high (read very high) impedance interface. It would appear to have a short circuit capability of something less than 100µA.

On another tangent I got the impression that Rohan would like an analog type of output like small movement dim light, large sharp movement bright light and things in between. I thought a transistor as shown would be the best for this as a mosfet has a very limited and tricky range where some sort of variable current control is possible. They are more easily used in an on / off situation. One down side to using a transistor is that it needs to get the input to 0.6V before anything will happen.

On the assumption an interface is required irrespective of whether a transistor or mosfet is chosen I would suggest the LMC6484 ( if as I suspect all 3 outputs are to be used, LMC6482 if only 1 or 2 used) connected as a unity gain or voltage follower configuration. It has a very high input impedance and low output Z to supply adequate drive current. The data sheet indicates it will work with 3V supply. Figures are quoted for 5V supply and quote a short circuit current of 20mA and output voltage swing 0.1V to 4.9V which is almost true rail to rail.

If a transistor is used my previous statements regarding base resistor will apply.
If a Mosfet is used you will need one that will turn fully on at about 2.8V. and will still need a gate series resistor.
The LMC648? will source and sink so a resistor to ground a Mosfet gate may not be needed.

The real advantage of a Mosfet over a transistor is the voltage drop across the device. The Mosfet is much lower. This must be subtracted from the 3V supply to get the actual drop across the LEDs. This is one disadvantage of such a low supply voltage. All these little bits add up and before you know it you have nothing left. If the supply was increased and an appropriate current limiting resistor used these small voltage drops would be insignificant.

Yours to ponder over.
Cheers Bob


For an analog output that varies with the intensity of movement, a transistor could be more suitable than a MOSFET due to its ability to provide variable current control. However, as you’ve noted, the voltage threshold for a transistor is a factor to consider. If you opt for a MOSFET, selecting one that fully turns on at around 2.8V is essential, and including a gate series resistor is a good practice to protect the gate from voltage spikes.

Hi Redicis

The gate resistor is there to limit the inrush current an thus protect the driving source. Mosfets have a “Gate Capacitor” as part of the construction and like all capacitors present a short circuit at switch on. In this case to ground so the gate inrush current can be quite large. On the other hand this R should be as small as possible to prevent excessive switching time and thus heat build up when switching larger currents.

It has nothing much to do with suppressing spikes.
Cheers Bob