Go Down

Topic: Arduino Lightsaber (Read 441658 times) previous topic - next topic

thierryd75

Hi,

I see this excellent program and update it's great work !

but i have two problem with json error -> arduinojson 5 to arduinojson6 have you update code ?

and see for two variator potentiometer rv1 500k and rv2 100k how setting this please ? no oscillator

difference between 3002/6002 and 9032 ? more pcb stable ?

now i build this pcb (3002/6002) and it run (without json part program and no testing call for now)


Thanks ! 

Protonerd

Newest development from Jake and myself is the XStream running on a DIYino Infinity, here is the first shot at dynamic swing sound:
OmiSwing demo1

It is based on Jake's sound library made for the nRF52 BLE core, which is at the heart of the Infinity.

More saber and IoT awesomeness soon!

jenga67

Hi Protonerd, it looks super cool!

Are you planning to start selling infinity boards any time soon?

Protonerd

Hi Protonerd, it looks super cool!

Are you planning to start selling infinity boards any time soon?
How many would you need? I will start a group buy rather sooner than later.

jenga67


gdadourian

#1460
May 21, 2020, 07:56 pm Last Edit: May 21, 2020, 08:02 pm by gdadourian
Hi there
I'm trying to follow the circuit diagram for the homebrew pixel set up via the FX-saberOS on github, but am having no luck.  I adjusted the code as per the config specs, and got a "successful" compile & upload to my nano, and loaded the sound fonts onto the sd properly, but my circuit doesn't do anything.  The activation light doesn't even turn on.  I've tried with batteries to Vin as well as power via the micro usb, but still nothing.  

That was about a month ago.  After a break, I'm back to it.  This time, I thought I would try uploading the firmware via STREAM, and that hasn't worked either.  First problem was my computer won't recognize the nano on any port if it's connected to the full homebrew circuit.  So, I wired together a nano with the two switches and the speaker, which was recognized, but the handshake failed trying to connect it to STREAM. 

I really don't know much about coding, so any help would be appreciated. 

jbkuma

What does it say in serial when you boot up?

gdadourian

What does in serial mean in this context?  And what do you mean boot up?  (The saber activation button, saber power, or plugging the nano into the PC?)  Again, I don't know much about coding and computer programming.

I've learned that the arduino nano clones I'm using utilize the old bootloader, and don't communicate at 115200 baud, which could be causing the connection issues with STREAM.  Is Could that be what's happening?  Is there a way to fix that? 

Since the last post I think I got the firmware to upload to the nano.  It needs two 3.7v 18650's in series to power Vin, but the blade actually turns on "properly".  The audio doesn't really seam to work.  I can hear slight sounds through the speaker, but not enough to hear the menu sounds. 

I tried rewriting all the firmware on my nano's via stream, but no combination will take.  Additionally, now I can't even get the activation switch to work again.  However, when I give the circuit power, it'll play some odd sounds that sound like yoda and an old fashioned camera flash. 

In case it's not clear, I'm completely lost.

JakeSoft

Two 3.7v batteries in series would give you 7.4V. The nano and the DF Player are not happy if you drive them at higher than 5V. You may have fried something. If you meant parallel, then you're probably fine.

To try and answer your questions:

1) The wiring for STREAM is identical to that of FX-SaberOS. If you followed the wiring diagrams exactly for that, then you should be fine.
2) When uploading the firmware with the STREAM GUI, make sure to choose Baud Rate 57600 if you have an older Nano bootloader. (Choose the faster 115200 only if you have the Uno bootloader).
3) When you set up the SD card, you have to do it in a very specific way. This video may be helpful to you: SirRawTunderman Explains SD Card Setup. This is for FX-SaberOS, but the hardware and setup concepts are the same. If you are hearing the Yoda voice at all, then it must be partially working. That voice is the FontID sound for the 4th sound font. It's one of 4 possible boot sounds you might hear when your saber first starts.
4) The STREAM GUI operates at the same baud rate regardless of what bootloader you are using. If you are getting "handshake failed" it could be for a few reasons.
 4a) Check that your saber is in STREAM mode. When you first hit the "connect" button, the saber will reboot. After it reboots, hold in the activation switch until you hear the voice prompt "STREAM Mode". The blade (channel 1) will also start flashing at this time. Do NOT let off the button when you hear "Menu Mode", just keep holding it in until you see the blade turn on or you hear the "Menu Mode" voice prompt.
 4b) Make sure you have selected the right COM port. It should be the same as the one you used to upload the firmware.

I hope that helps. Check back in and let us know how it goes for you.





gdadourian

Ok, so I switched my wiring to reflect 1 battery to the 5V pin (exactly as it's shown on the fx-saber-os homebrew pixel wiring diagram), and it seemed like things worked for a fraction of a second, but I'm stuck again. 

I installed the firmware for diyino prime V1 pixel @ 57600 baud onto one of the nano clones I have.  When I give the circuit power, a neat saber effect plays, and then it sits idle (this is instead of one of the sound fontID's like last time).  The LED ring on the button doesn't light up anymore.  I think I mistakenly bought 6v buttons back when I ordered components, so perhaps I need to go back and get the 3v buttons. That's why the button worked with 2 18650's (now I'm using just one).  If I press the activation button, I get about half an ignition sound effect before the speaker cuts out.  Then, once the speaker is out, the blade starts to ignite as a pixel setup would, but it only gets about 5-10 pixels before the blade just "turns" on to a steady red color.  Then the circuit becomes unresponsive.  If I power down, and then back up, the same boot up sound happens, and if I hold down the aux button, it switches sound fonts properly.  BUT, as soon as I hit the activation button, I get the same error (with the different font activation sound).   Could this be caused by the activation button's LED voltage requirement? 

With the same chip/ circuit, if I plug it into the computer before giving it power via battery, when I turn on the battery (to give the LED's, dfplayer, and mpu power) the speaker starts making clicking sounds.  No boot up sound.  Handshake still failed, but it's hard to know what's going on with the modes without the speaker, activation button, or lights working. 

Lastly, I tried a few other chips to see if I had any luck.  Two of my other nano clones (one the same brand as the first, the other different) didn't give any results, and the last (the same brand as the first chip that partially worked) yielded the same results as the first test. 

Thanks in advance for your help. 

JakeSoft

Your description sounds like the Nano is loosing power mid-activation and rebooting. Try disconnecting everything except the switch contacts and the speaker. No blade. No accent LED. Removing these other power draws will simply your troubleshooting and reduce the power demands on the system.

Other possibilities:

1) Make sure your battery is fully charged
2) Make sure your battery can handle the current demands of a NeoPixel blade. It depends on how long your blade is, but generally you'd want a battery that can handle a maximum continuous current draw of ~15 amps to be safe. Most 18650's can't do that and have PCB's built into them that cut power if the current draw goes over their rated limit.

gdadourian

#1466
Jun 02, 2020, 05:39 pm Last Edit: Jun 02, 2020, 06:33 pm by gdadourian
I disconnected the blade, and the sounds all worked normally.  So, I wired another 18650 in parallel, and the blade turned on with the sound, buttons worked, etc, however the blade didn't "ignite" normally.  It just "turned on" after the ignition sound played.  Furthermore, when turned off, the blade (sometimes in sections, sometimes entirely) stayed on (with no sound).  I was able to connect it to STREAM and fiddle with the color and blade settings, but I don't think whatever I did to the sound timing made any difference.

It seems the protection circuit in the batteries I have limits them to 600 mA.  I should probably buy new batteries that have better power draw ratings, as I only have space for 1 cell in each hilt I'm making.  In the mean time, I could remove the protection circuit to allow unfettered power draw.  In this type of circuit, what are the main risks of an unprotected battery?  I have a smart charger that I should theoretically be able to use to charge unprotected batteries (they'll be disconnected from the circuit for charging via latching switch), but I feel like it's worth asking here, too. 

JakeSoft

Silly question, but did you remember to click the Save icon on the main STREAM screen before disconnecting the USB cable or switching to a new font? Each sound font has it's own timing parameters, so you have to save after you adjust each profile. To adjust all profiles, you'd have to hit the save button a total of 4 times.

I think the problems you are seeing are mostly power related at this point. You'll want more than 1.2A. You can try adjusting your blade length in the Options screen to make the blade smaller. Less LEDs will light up and make the blade draw less power. You can maybe see if it starts working better with a shorter blade. Also try reducing the volume with the in-hilt menu. That will make the sound amp draw less power. If those things have a positive effect than it's almost certainly just your battery not being up to the task.

On the DIYino and Brewboard boards for which STREAM was designed to work, there are FETs that can cut power to the blade when it turns off. That would at least eliminate the problem you are seeing with the blade staying on, although it really shouldn't do that anyway.

gdadourian

#1468
Jun 03, 2020, 06:30 pm Last Edit: Jun 03, 2020, 06:41 pm by gdadourian
I'm sure I hit save, but I went back and tested it today and there was no difference.  I have 4 protected 18650's wired up in parallel (which should allow for 2.4 amps) , but I'm still having all the same errors.  When I set the blade for 30 pixels, it kept lighting up the whole blade (all 60), but only doing the lockup and blaster bolt effects on the first 30 (still no turn on effect, just lights up the first pixel, then the next 59, as if it's trying to do the ignition effect, but falling quite short).  I'm not sure what the bug is. Where in the homebrew pixel circuit should the FET's be?  I hadn't included any in the first place, since the homebrew pixel circuit doesn't call for any.   I have some NPN transistors laying around, would those work?

JakeSoft

#1469
Jun 03, 2020, 10:32 pm Last Edit: Jun 04, 2020, 04:25 am by JakeSoft
I'm sure I hit save, but I went back and tested it today and there was no difference.  I have 4 protected 18650's wired up in parallel (which should allow for 2.4 amps) , but I'm still having all the same errors.  When I set the blade for 30 pixels, it kept lighting up the whole blade (all 60), but only doing the lockup and blaster bolt effects on the first 30 (still no turn on effect, just lights up the first pixel, then the next 59, as if it's trying to do the ignition effect, but falling quite short).  I'm not sure what the bug is. Where in the homebrew pixel circuit should the FET's be?  I hadn't included any in the first place, since the homebrew pixel circuit doesn't call for any.   I have some NPN transistors laying around, would those work?
Your blade acts like it is dropping frames. Any signal integrity problems on the data line can cause strange behavior. What timing settings are you using for your blade ramp? What happens if you set the blade ramp time to be long, like 10 seconds (10000)? Also, did turning down the sound volume have any effect?

The N-Channel MOSFETs go on the negative side of your LED strip. Pins 3, 5, and 6 on the Nano will go LOW when the blade turns off and will go HIGH when the blade turns on. I'm pretty sure one of the FXSOS wiring diagrams shows this. NPN transistors probably won't work for this, but I never tried that. The MOSFETs are most convenient as they require very little current on the gate to drive huge loads.

Go Up