Arduino Lightsaber

billpealer: dazwadimzayin! wait? what? why do you WANT to go 3v? now you can use the WT588D_U guilt free. you get less wiring, and a faster cpu by double. all devices can be 5v and USB. no need for a 5v regulator,.. no need for 2 V+ going into the WT.. so many pluses.

Yeah, there are a lot of pluses to be sure. I have been building these for quite a while now and tried lots of different things. I just like the 3.3V setup because it offers the greatest flexibility and ease for the particular way that I do things. Remember that the parts I use (WT588D 16p and GY-61 ADXL335) both require a 3.3V source.

CrossRoads: Have you tried a legit distributor? http://www.digikey.com/product-search/en/sensors-transducers/accelerometers/1966355?k=ADXL335 http://www.mouser.com/Sensors/Motion-Position-Sensors/_/N-6g7q6?Keyword=ADXL335&FS=True

Good suggestion, but I think he needs a breakout board.

Look what I found from Sears of all places! http://www.sears.com/unique-bargains-2pcs-gy-61-adxl335-module-3/p-SPM7928239123?hlSellerId=29267&sid=IDx20110310x00001i&kpid=SPM7928239123&kispla=SPM7928239123

Must be some appliances they sell use them for something; it's under replacement parts.

CrossRoads: Have you tried a legit distributor? http://www.digikey.com/product-search/en/sensors-transducers/accelerometers/1966355?k=ADXL335 http://www.mouser.com/Sensors/Motion-Position-Sensors/_/N-6g7q6?Keyword=ADXL335&FS=True

WHAT?! Is this some kind of CS joke? That's a terrible suggestion! LOL.

If I asked you where to buy a fish sandwich, and you showed me a picture of a lake and said "try here",.. i'd either laugh or be insulted. So i'll just laugh.

And the people here are pretty dang legit.

I need the module, not the chip. as 99.99999999999999997651% of everyone else would too.

plus DigiKey sells the Chip for $6.00!!!!???? you can get the whole module for $5 on the bay and apparently at Sears! LOL

JakeSoft: Yeah, there are a lot of pluses to be sure. I have been building these for quite a while now and tried lots of different things. I just like the 3.3V setup because it offers the greatest flexibility and ease for the particular way that I do things. Remember that the parts I use (WT588D 16p and GY-61 ADXL335) both require a 3.3V source.

and the Nano is too big? it has 3.3v output pin. don't you want to 86 the linear regulator?

Canobi: All finished :)

|500x275

And here's a link to the high res pic as promised:

https://www.dropbox.com/s/e79t2a7bo8ggo4w/Spectrum%20saber%20board%20-%20ADXL%20varient.jpg?dl=0

It keeps getting better and better! I like the placement of the switch vias a lot better now.

Still a few issues.

1) The ADXL335 doesn't appear to have a positive power source linked in directly from any rail. The silkscreen seems to suggest that you intend to bridge it to raw battery power with a jumper maybe? If so, that will blow it up; the GY-61 ADXL335 is a 3.3V device. It needs to be attached to the 3.3V rail somehow and only fed regulated voltage. 2) This will work perfectly for a 3.3V Arduino variant, but will be incompatable with 5V Pro Mini or Nano. That's fine if that's what you intended, but 5V to the RAW pin will not power any standard arduino board. 5V will be under the dropout voltage of the arduino's on-board 5V regulator and it won't work. To compensate for this, you could A) Bring out the raw pin to a via at the edge of the board and allow for direct battery power to be fed to the Arduino B) Feed the 5V rail to the VCC pin via jumper as was done with the 3.3v rail. 3) [nit]The silk screen on pin 13 should be "SDA" as it is the one-line serial data, not a serial clock. Same with the "CLK" on the WT588D.

Just as a general comment, I've noticed that the power rail design meant to widen compatibility is adding some complexity that might be avoided if you simply made two distinct versions of the board.

JakeSoft:
It needs to be attached to the 3.3V rail somehow and only fed regulated voltage.
2) This will work perfectly for a 3.3V Arduino variant, but will be incompatable with 5V Pro Mini or Nano.

the Nano has a 3.3v rail. 3v3pin…

“The 3.3V regulated output is able to supply 150 mA”

I believe the 3.3V on a Nano comes from the FTDI chip, and is only capable of 50mA.

CrossRoads: I believe the 3.3V on a Nano comes from the FTDI chip, and is only capable of 50mA.

Oh? Good info. I don't think I've ever actually tried to use it on my Nano.

I once tried to power my WT588D purely from the on-board regulator of my 3.3V pro Mini (an official Arduino board too, not a cheap clone) and I don't think it can source enough current to operate it properly either. It did work, but the sound would crackle and cut out once in a while. I got the feeling I was pushing the limits.

I wonder how much current those pro-micro boards that were posted earlier can source.

"I need the module, not the chip. as 99.99999999999999997651% of everyone else would too." So I guess it's just me that mounts chips on boards. Module was not mentioned in the request. And I provided a specific link to a fish sandwich, not a lake. Modules are also available http://www.digikey.com/product-search/en/programmers-development-systems/evaluation-boards-sensors/2622557?k=ADXL335 I don't buy raw chips on ebay, too many questionable sources, counterfeits, fakes, repeatability is a problem, plus the long lead time. If I'm going to the effort of soldering down a minuscule sized part, I want to know I have a good part to start with.

QUOTE FROM CANOBI: "Here's one I mounted on a slightly different kind of cake I made for a stunt saber:

|500x500

Lithium charging was the first thing on my list to tackle when I decided to make my saber fx system, took me the best part of a year to learn what I needed so I could confidently make and try the circuit without quite so much risk of blowing batteries or myself up. Luckily (though frustratingly) they've been duds and didn't do anything, a much preferable outcome for a failure when dealing with lithuim but I think I've finally worked out where I'm going wrong so making another proto.

The circuit is also now smaller than the cell it charges which makes for some intersting ways to include it. I have three ideas I'm toying with. Two of them were inspired by some S1 flex PCB I bought to play with. It's normally used for making ribbon connectors or 12v flexible LED light strips and is only 4mils (0.1016mm) thick so is super bendy."

How about one of these charge controllers? Double 7.4 v http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_nkw=PCB++7.4V++18650&_sop=15 |500x500

Single, double, triple:Y 1, 2 or 3 cells 1-2A Lithium ion Battery Charger Module PCB 18650 iphone 14450

Single:PCB for 1S 3.7V Li-ion Battery Pack (1.5A cut-off)

CrossRoads: I believe the 3.3V on a Nano comes from the FTDI chip, and is only capable of 50mA.

that actually may be the case. But the ADXL335 has a low min operating current of... 350 μA. 50ma would do it. right?

I like the nano. i love the ease of USB connectivity and sending the 8.2v direct to the RAWpin, and 5v RIGHT to the WT via VCC. i hate soldering. we are a good match :)

billpealer: that actually may be the case. But the ADXL335 has a low min operating current of... 350 μA. 50ma would do it. right?

I like the nano. i love the ease of USB connectivity and sending the 8.2v direct to the RAWpin, and 5v RIGHT to the WT via VCC. i hate soldering. we are a good match :)

I'm sure you'll be very happy together. :D

Ha!

i tried to make that smaller.

Just wanted to give something back to this great community:

Well, here's my LED driver, in fact 3 of them, one for each RGB channel. Each one will get its own thermal-shrinking insulation sleeve.

|500x375 Red and black wires above are LED outputs, red and black wires below are power in, naked wire is the PWM switch input

This is a current source based on one N-MOSFET (T1) and one NPN transistor (T2):

The principle is very simple: the current that comes out from the Source pin of the T2 (S) must be the same as the one as enters the Drain pin (D), since current that enters the Gate (G) is zero. Therefore, by controlling the Source current we control the current through the LED, no matter the voltage on the LED. Setting the source current is fairly easy, since the BE voltage on a transistor is always around 0.5 V and the current that enters the T1 Base pin is also around zero. Therefore, the current through the R2 is Is=Ube/R2, that is R2=Ube/Is

So, if we want the current to be 700 mA, then the R2 has to be 0.5V/0.7A~0.7 Ohm! No matter the battery voltage, as long as it is above some 3.5 V, depending on the voltage on the LED. In practice, the current slightly depends on the input voltage, but does not depend at all on the diode voltage (or any consumer connected between Vcc and the Drain, for that matter), which is exactly what we need, since the diode voltage dramatically changes with the temperature. This way we completely override the problem with the changing voltage on the diode.

This is the Vcc-Current chart of the driver, driving one blue LED:

I used two 0,6 W resistors - 1 Ohm and 1.5 Ohm, resulting in 0.6 Ohm. Even though I used the same components in all the 3 drivers, the current varies from one to another from 0.70A to 0.73A - so you can see how it is hard to tweak. Fortunately enough, that does not affect the light intensity that much and it is still in the safe zone.

Now about switching the LED on and off: when the Gate pin is pulled up to Vcc, the Gate opens and the current flows. When the Gate is pulled down to 0V, the Gate closes and the current through the LED stops. That is done through a 100 kOhm resistor to minimize the pull-up current. By connecting it to a PWM signal from your controller, you can regulate the resulting current and the intensity of the light.

But, there is a caveat here - resistors that small are a pretty tricky thing to work with, because the very contact resistance between two wires ranges from 0.2 Ohm when not welded together (depending on the pressure used to hold them together and the properties of the wire) to around 0.05 Ohm when welded. And that's on each contact! So forget about testing it on a prototype board - you will just have to weld them directly on the other components as I did on the photo above, and tweak the resistors to get the right current.

Don't forget to insulate the pins with thermal-shrinking insulation sleeves to prevent wires from breaking off and short circuiting!

Components: - T1 : any N-MOSFET with a T-220 package (IRFZ44N) - T2 : any NPN transistor in a TO-92 package (BC337-40) - R1 : 100 kOhm, at least 1/4 W - R2 : 0.6 to 0.7 Ohm, at least 1/2 W - I used one 1 Ohm and 1.5 Ohm in parallel Power dissipation considerations: Bare in mind that all the voltage difference between the input voltage and the voltage on the diode, minus 0.5 V on the R2, remains on the T1 FET, producing possibly significant heat (P = U * I). For example, if you power it with a 7V input and the voltage drop on the LED is 3.2V, then the remaining voltage on the T2 is 3.3V, producing 3.3*0.7 = 2,3 W which is quite much. If you keep it at 4.5V, then the power dissipation on T2 would be only about 0.5W. Therefore, keep the driver input voltage as low as possible!

Important note on pinout: The black output line is the floating one, while the red output is the same point as the power input! Therefore, when using several drivers in parallel, you must connect all the anodes of the LEDs to Vcc, and cathodes to the driver's black output line!

Important note on handling FETs: FETs (MOSFETs) are very sensitive components and are very easy to damage if you are not properly grounded. It is also likely that you'll burn it (electrically, not thermally) with your soldering iron. You'll now you did it if you notice that you cannot properly fade your LED: with a healthy MOSFET the light goes linearly up from 0 to 100%, while on a burnt one the LED will start lighting up at about 75% of PWM input level. Therefore, it is necessary to wrap all 3 pins with a piece of naked wire short-circuiting all pins, while you are soldering it. Once all the components are in place, you can wrap-off the short-circuiting wire.

Johnnie, could you show a current (amps) read on a multi meter showing the 700ma for that set up?

"I find your lack of faith disturbing..." ;)

|500x375

is that a 4x AA ? alkaline?

This is something I hacked together in PhotoShop using Canobi's drawings as a reference. It's only meant to express concepts, but maybe someone more savvy could turn this into a real board by drawing it in PCB design tools that I don't know how to use.

This is intended to be the easy button; the most accessible, simple to build PCB that I can think of for an end user to assemble and still get full functionality. Anything that makes it complicated got tossed out in favor of simplicity. It's not the highest performing or the most flexible. It won't please everyone or accommodate every combination of parts. It's not the loudest. It's not supposed to be any of those things. It is what it is and nothing more. Simple.

|500x276

Click here for high-res image

Key Features: - 100% through-hole components. - Minimalist design: Everything you need, nothing you don't - Should be pretty easy to produce; only one jumper that could be end user installed - Uses Canobi's pinout - LDO regulator mounted under the WT588D to save space - WT588D assumed to be mounted on pin-headers or a socket interface to facilitate removal for reprogramming without any non-standard hardware - Arduino right-angle pin headers assumed to be available for reprogramming at the edge of the board over the FETs - Pure 3.3V design eliminates dual-voltage power distribution complexities - Narrow parts list removes parts selection ambiguity - Only easy-to-find, commonly available parts are required - Compatible with both ADXL335 accelerometer or SW-200D swing sensors

Parts: - Arduino Pro Mini 3.3V - 3.3V LDO Voltage Regulator (up to TO-220 size, >= 500 mA output) - WT588D 16p - GY-61 ADXL335 Accelerometer (Or SW-200D Swing Sensors) - I-PAK style N-channel MOSFETs (1 to 3, depending on how many channels you want) - SW-18020P impact sensor (mounted off the board)

I know I am probably off on the dimensions a few places. Like the holes for the main LED negative vias at the end of the board probably need to be moved left a bit to clear the FETs, but I think something like this would be good. It doesn't require any advanced soldering skills and could be built with a cheap iron without an especially fine tip. A decent high school student could probably build the board in an afternoon. A skilled person could do it in an hour or less.

With some modifications to the power distribution, a separate version could be made 5V capable to support Nanos and 5V Pro-Minis.

Feedback welcome. (Please read the second paragraph of this post before posting feedback, please.)

billpealer: is that a 4x AA ? alkaline?

No, that's 4xAA NiMH, resulting in 5,1 V. I added a current-vs-voltage chart in my original post (#455), which you might find useful.

I have not yet decided how I will power the driver, since I want the voltage to be around 5V. I will probably use a 3.3V Arduino with one down-switching buck stabilizer for the Arduino and another one down to 5V for the LED drivers.

The idea is to use switching-stabilizers rather than the semi-conductor based ones, since power dissipation is significantly lower.

Dear Jedi (or almost Jedi), i rly need some help with writing code. I'm using MPU-6050 accelerometer+gyro, so i'm incredibly dumb at this thing. I would appreciate any help with at least building an algorithm for triggering sound. And it would be sooo amazing, if someone here already has worked with MPU-6050 or just can share the code for it. Prayin' for your help :)