Go Down

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

Canobi

I came across this intersting variant of the WT588D-16p while sourcing more stable and direct suppies for my boards:



The details page link was broken so dont know mem size but I did send a query about it and now waiting for the reply.

I've not seen a match from any other vendor so it must be manufacturers own take on it.

I like the pin labelling, would make them easy to work with for the absolute novice and would be handy for prototyping purposes. However, not sure why it deserves an $11 price tag though.

billpealer

Hello everyone, ive been following the adventures of Jakesoft and the inexpensive lightsaber for a year now, and have also been attempting to construct my own based on this forum.
I am currently still trying to get the code sorted out but its working to some degree. I am an artist by trade and its been quite a challenge to teach myself how to code, even with the supposed simplicity of the arduino language.
Looks rad. let me know how you make out pwm color mixing with MOSFET and the drivers.  that  jammed me up.

JakeSoft

Hello everyone, ive been following the adventures of Jakesoft and the inexpensive lightsaber for a year now, and have also been attempting to construct my own based on this forum. I am generally just a lurker and dont usually participate in the conversation, but this forum is very educational for me, and I wanted to thank everybody for their input.
...
Welcome and thanks for sharing! Intentional or not, your design looks like a unique blend of my design and that of Protonerd. Keep us posted on your progress. It looks like you are well on your way.

JakeSoft

I came across this intersting variant of the WT588D-16p while sourcing more stable and direct suppies for my boards:



The details page link was broken so dont know mem size but I did send a query about it and now waiting for the reply.

I've not seen a match from any other vendor so it must be manufacturers own take on it.

I like the pin labelling, would make them easy to work with for the absolute novice and would be handy for prototyping purposes. However, not sure why it deserves an $11 price tag though.
Hey, that is nice. Probably the price tag is because it's a custom PCB or something and only they sell it that way.

I actually e-mailed Waytronic (the China-based OEM of the WT588D chips) about a year ago to ask some questions and much to my surprise they actually responded. Throughout our discourse, they made it known that they are willing to sell direct. I didn't pursue that avenue, as I can find them dirt cheap on Ebay already, but if you had a sizable order I wonder if they would be willing to ship some modules without the pins. I also don't know what kind of payment they except or any of those logistical details.

Protonerd

Just wondering: anyone ever used the Timer(s) of the Atmega for his/her saber project? It occurred to me the other day while wondering how I could reduce the number of variables used in my code (I'm living on the edge, one false move and the code collapses...) that these uCs have Timers, maybe they could be used to track events and/or enable for instance new swing/clash triggers only if a certain time has passed since the last such event.

stinky1

Ohh bam found this,  somewhere in Step 15 I believe it shows the commands
for switch triggering PWM color changes.  Please note,  its the last step,  so understanding
what is before it would help your comprehension!!!


Beginner Arduino Primer

I have already picked out the colors I want from playing around with this site:

RGB Color Codes Chart


Nice DFPlayer Mini MP3-TF-16P tutorial

Arduino - Test DFPlayer Mini MP3 Module

Note he also he has a remote  phone control colors primer too.

billpealer

Battery replacement in V1 Predates TIE Chassis concept.

https://youtu.be/eZC2iCyDKdg

JakeSoft

Battery replacement in V1 Predates TIE Chassis concept.

https://youtu.be/eZC2iCyDKdg
Selling it, Bill? Looks like a how-to for an end user.

grey3Dx

#623
Feb 03, 2016, 05:14 am Last Edit: Feb 03, 2016, 05:29 am by grey3Dx
Im having issues with controlling the playback of sounds on the WT588D. Is there a code solution that would allow a sound to play and keep playing as long as a button was HIGH but stopped that sound as soon as the button went LOW? (or vise versa). I guess what i really need to know is how to trigger a sound from outside the main loop.

currently my AUX button (the one for the 'lockup') constantly restarts the sound over and over.
im running  the WT in one-line serial mode. Do i need to have the WTs BUSY pin wired to make that work?

here is the code im using for the button.

const int WT588D_SDA = 9; //Module pin "P03" or pin # 10
const int AUX_BUTTON = 1;
const int BLADE_LED_AUX = 5; // led for flashes


int aux = 0;         // variable for reading the pushbutton status

void setup() {
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(BLADE_LED_AUX, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(AUX_BUTTON, INPUT_PULLUP);
  pinMode(WT588D_SDA, OUTPUT);
  digitalWrite(WT588D_SDA, HIGH);
}

void loop() {
  // read the state of the pushbutton value:
  aux = digitalRead(AUX_BUTTON);

  // check if the pushbutton is pressed.
  // if it is, the state of the button is LOW:
  if (aux == LOW) {
    // turn LED on:
    digitalWrite(BLADE_LED_AUX, HIGH);
    WT588D_SendAudio (0x07);
    Serial.println("LED_ON");
  } else {
    // turn LED off:
    digitalWrite(BLADE_LED_AUX, LOW);
    Serial.println ("LED_OFF");
  }
}


void WT588D_SendAudio(byte addr){
 
    digitalWrite(WT588D_SDA, LOW);
    delay(5);
    for(int i = 0; i < 8; i++)  {
        digitalWrite(WT588D_SDA, HIGH);
        if bitRead(addr,i)   {
            delayMicroseconds(600);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(200);
        }
        else {
            delayMicroseconds(200);
            digitalWrite(WT588D_SDA, LOW);
            delayMicroseconds(600);
       }
    }
    digitalWrite(WT588D_SDA, HIGH);
    delay(10);
   
   
}

Anybody have suggestions?

billpealer

Selling it, Bill? Looks like a how-to for an end user.
nope.  not selling it. syntax error. I  sold it. if you love it, let it go. After I made my first TCSS with a Hasbro sound board, i discovered this thread days later. So i sold that saber.  It was on ebay for 17 hours before being picked up.  Now the goal was to sell the first couple..  to break even on the main 2 that i keep for myself.  The real difficulty was to get the V1 to a point were it was durable, reliable, and sexy enough for sale. took a couple tear downs, re-soldering, re epoxying.  But i got it.  A major hurdle was figuring out how to take it apart and put it back together with out twisting the wires to oblivion. it finally occurred to me,. start with the blade holder, and work down.  perfect.  I did the same for my vintage BMX's.  Refurb a couple..  sell em.  pay for the good ones. Hobbyists often say things like "it's an expensive hobby, you get what you pay for."  Or "It's a Hobby, no one ever said it would be cheap." I say,..  you gotta invest to make money. Do it right and you'll never have to pay a cent for a hobby again.  or pay waaaaaay less than most.  Helps to be a bit of a MacGyver. My next set will be a semi matching sith / jedi dueling pair.  then no more selling. Just my Brass super saber.  anyone have a chunk of brass tube with an ID of 1.5"?

My next obsession will most likely be a light sensing optic with relay, to toggle tween my grid tied solar panels and my battery back up.  Right now it is on a 220v Jacuzzi timer, and if it was light based instead of time based, it would be more efficient.

billpealer

Im having issues with controlling the playback of sounds on the WT588D. Is there a code solution that would allow a sound to play and keep playing as long as a button was HIGH but stopped that sound as soon as the button went LOW? (or vise versa). I guess what i really need to know is how to trigger a sound from outside the main loop.

currently my AUX button (the one for the 'lockup') constantly restarts the sound over and over.
im running  the WT in one-line serial mode. Do i need to have the WTs BUSY pin wired to make that work?

Anybody have suggestions?
i would change the code to use a bool (love that Jake). and push the button for Send_Sound_Command followed b a loop command,..

second button push for turn off.

The only reason i rec that, is because i know how to do it, and know that it would work.  not because it is better.

DJWing79

Hey Jakesoft, have you ever tried using buckpucks with an arduino for your lightsaber? I am thinking about going to the 7.4V battery so I can power the DFPlayer and didn't want to fry my leds

JakeSoft

#627
Feb 04, 2016, 02:53 am Last Edit: Feb 04, 2016, 02:53 am by JakeSoft
Hey Jakesoft, have you ever tried using buckpucks with an arduino for your lightsaber? I am thinking about going to the 7.4V battery so I can power the DFPlayer and didn't want to fry my leds
Nope, never tried it. I always thought they were too expensive for what they are, but I'd think you are more likely to fry your LEDs using direct drive with a FET the way I do it than you would with a buck-puck that will limit current on it's own.

DJWing79

I have a 700 ma buckpuck that I am going to test this weekend. it has a pin for control, which I believe goes to the arduino pin so it's a regulator and fet....I think....

Protonerd

I have a 700 ma buckpuck that I am going to test this weekend. it has a pin for control, which I believe goes to the arduino pin so it's a regulator and fet....I think....
The higher-end Plecter Lab boards also have a current regulator for the main LED drive, but it's all integrated on their quite small boards, so I guess current regulation can be done with a smaller form factor than a buckpack, but alas I do not know how this feature on them boards work...
I'm now going into the direction of using a single 3.7V supply and try to supply the Arduino board with a DC-DC pushing up the voltage from 3.7V to 5V.

As to the DFPlayer, I still did not give up to make it work from 3.7V battery, but I need a couple of days more to try it out. But in the meantime, please do try the buckpuck, it's one more piece of HW this community evaluates and that enriches the work of us all!

Go Up