Ask a littleBits engineer

Hi Oshe,

I believe the Scratch project you are referring to was user-submitted so the person who submitted the project might be best served to answer any questions you might have. You should post a question on that project page and see if you get a response.

-Sean

Hi Sean
My daughter is interested in using little bits as part of her science project. She is trying to determine the optimum parabola to shoot a basketball from the free throw line and never miss. We were wondering whether we could use the animated hand created by little bits and adapt it for this project. The thought is that by wearing the glove with the correct circuit and program, she could try to track the trajectory of the basketball shooter’s free throw. She is working on the range of parabolic equations she needs to test, but she needs some guidance on how to use the animatronic hand and program to actually track the trajectory of each shot. Is this something that an engineer at little bits would be interested in working on with her and mentoring her?

Hi Mendez,

This sounds like it would be a cool project though determining the trajectory of basketball shot would require a very precise array of sensors and a great deal of processing power.

If we were to look at the problem in two-dimensions (not accounting for missing left or right) this glove would need to know the initial velocity in the x and z dimensions as the ball leaves her hand. For this type of an application accelerometers would generally be used to accomplish this. We unfortunately do not have accelerometers as part of our module library (yet, hopefully in the future though!) but lets works through this problem because it is a fun one!

For a simple path of motion such as a catapult, two accelerometers would probably be sufficient to calculate the parabola. This would be a much easier result to calculate because the catapult takes the same path every time, just at different speeds and accelerations.

For a human shooting a ball it is much more complex. Since the starting position is never the same it can’t be assumed what the initial state of the measurement is in terms of orientation, so at least one additional sensor would be required to determine this, perhaps a gyroscopic sensor. Once we are able to calculate all of this, we still need to determine the moment the ball leaves the shooter’s hand. Since there are so many moving parts to a basketball shot all happening in a very short amount of time (finger joints, wrist, elbow, shoulder, back, knees) this can vary greatly. You would likely require some sort of pressure feedback to determine as closely as possible where the ball left the hand. To compound this variability, you would need to also calculate the changes in velocity that will result from the different exit points in the hand and would therefore require some more sensors to calculate those differences in velocity based on those.

To maybe make a more simplified project, perhaps the glove could indicate whether a shot reached the ends of the middle and index fingers, which could indicate a good shot. You might be able to put a pressure sensor on each fingertip, read the max value of each pressure sensor and determine if it was shot with the correct technique and force based on the numbers read from the two pressure sensors. You might be able to extrapolate from this the parabola if the shot goes in, which I think would be pretty cool!

-Sean

Hey Sean,

Coming at you from Ailsa (Mendez):

Hi Sean
Great ideas.

Would you be willing to Skype with my daughter and I about this?

She is planning on a few constant variables.
The distance from the shooter to the basket would be the same every time- since they are at the foul line.
The height of the basket ball hoop is constant
What changes is the height of the shooter and the force with which the ball leaves the shooter’s hand.
Using first geometry and algebra, she could find a range of parabolas that would always give a basket, given a certain range of height for the shooter.
Then a pressure sensor and/or light could help determine whether the shooter used too much or too little force to get the ball to go into the basket following a predicted parabolic curve, determined by the height of the shooter.

Lastly, is there a way to display the curves on a laptop, using little bits’ animatronic hand and ardunio programming?

BTW - I run an after school STEM club for middle school girls and the little bits circuits was their favorite project!! They got to meet Ayah via Skype, as she spoke to the club, and then they got to play with the little bits.

My daughter was inspired to do this project because one of the women speakers this year spoke to them about using math to solve problems (eg. how an ice skater could be a better spinner- all about angles) and I saw that little bits had partnered with ardunio on the “rock, paper, scissors” hand and we thought she could link the 2 to make her and her friends better free throw shooters.

Regards
Ailsa Mendez

Hi Sean
Do you think little bits will have an accelerometer bit within the next few months? If not, then it seems we should think of using the pressure sensor. Can I purchase the glove only, or is part of a kit? Will I need to purchase the ardunino bit as we’ll in order to program the parabola on the computer to track the arc of each shot?

Thanks
Mendez

Hi Sean
For the basketball project, can we connect a wireless transmitter to the pressure sensor on the glove, such that it would send a signal to a wireless receiver placed near the basketball rim, to help calculate the arc of the shot?

Thanks
Mendez

Hi Sean,

I’m really excited about my first steps with the littleBits Arduino controlling my SynthKit. But with synthesizers, you can never have enough control voltage I/Os, so I’d like to use the additional I/Os A2, A3, A4 and D10, D11, D12 that are available via thru-holes on the littleBits Arduino. To make things compatible, I’d like these additional I/Os to be available via littleBits connectors. As I am not that experienced with bare bones electronics (that’s why I turned to littleBits), and as I don’t want to blow anything up, I’d like to ask you for some help & advice.

Which of the thru-holes on the littleBits Arduino could provide the VCC and GND for the additional I/Os?

What parts do I have to use in order to electrically protect these additional I/Os as good as the on-board D0, D1, D5, D9, A0, A1 littleBits connectors?

Thanks much in advance,
regards,
-w

1 Like

Hi Alisa Mendez!

The project you’re working on sounds awesome and ambitious. The details for building a wireless glove are here: http://littlebits.cc/projects/animatronic-hand , but its not available for purchase. The glove basically just detects still finger positions and so wouldn’t help much measuring the force of a basketball through.

Getting to all your questions one by one:

I can’t say when an accelerometer bit will be released, and unfortunately it is really necessary to begin predicting the ballistics of the ball.

You can definitely use the Arduino bit to display curves on a computer, either doing the calculation on the Arduino or computer. It will be easiest to start with a programming environment called Processing [ https://www.processing.org/ ], or possibly Scratch [ http://littlebits.cc/projects/littlebits-meets-scratch ].

Here is a good example project to start displaying data from the Arduino using Processing: http://littlebits.cc/projects/lissajous-figures

Another approach would be to ‘reverse’ your project… You could have a Processing sketch display the ideal parabola between the ball and the basket, changing the height of the shooter and the other variables you mentioned in the program.

You could also use pressure sensors and the Arduino to record data during a throw, give that data to Processing, and then mark whether the throw was a success. By repeating, saving, and averaging the pressure sensor data you could build up a subjective profile for each shooter which could help predict future successful shots without needing to know absolute numbers like force, the weight of the basketball, the spin of the basketball, the velocity of the wind, etc. A surprising number of technologies [ e.g. robots, rockets, email filters ] are more ‘machine learning’ than pre-calculated physics because all the little details, like aerodynamics, that can make big differences.

Thinking of sensor bits you could put near the rim/hoop, I’d suggest pressure, motion, or a light sensor. You can definitely put either a wireless receiver or transmitter there too. Each wireless transmitter has three inputs which work like radio stations, with the wireless receivers ‘tuning in’ to those three stations. Any wireless receivers near the transmitters will pick up the three signals, just like two people listening to same radio station on two boomboxes.

Its been a long reply, but I didn’t want to leave your questions unanswered.

Best,

Ed

Not having trouble, per se, but wanted to know just how the PWM output is smoothed to an analog voltage. I’m guessing that it is a standard resistor / capacitor setup, but what are the values?

Hi Sean:

Just unpacked the bundle. Perhaps I’m missing the obvious, but how do I access the GPIO? With a standard Arduino board, these are all on a labeled header, and a jumper cable to a breadboard allows me to interface with a sensor such as an IR distance sensor.

How can I connect to the outside (other than the other Little Bits parts included in the bag?)

Ted

Hi Ted,

We have broken out some of the GPIO in different ways. Three of the GPIO are input bitsnaps to the system and three of them are outputs. Additionally there are six more GPIO that can be soldered to labeled a2, a3, a4 and d10, d11, d12. Finally, on the unpopulated ISP header there are three more GPIOs for the MISO, MOSI, and SCLK lines which are tied to PB1, PB2, and PB3.

Hi GP,
The filter we have on the PWM output is a three-pole Sallen-key filter. You can find the schematic and board design files on our Github at https://github.com/littlebitselectronics/eagle-files/tree/master/WIRE/LB_BIT_w6_ARDUINO

I am trying to create the DIY Etch A Sketch found here:

I have the littlebits connected like the picture, and I seem to have successfully uploaded the Arduino program. When I launch the processing file, I get a purple box but my dimmers don’t make anything happen. I know the dimmers work because I can take off the Arduino module and put on a bargraph and the lights light up appropriately as I turn the dimmer. Not sure what else to try…

Thanks!

Thank you! That is really helpful.

You’re Rory from ITP, right?

It sure is! I hope you’re doing well and enjoying your Arduino bit.

Hi Sean,
I was wondering if it would be possible to get a copy of the sketch used for the initial load of the Arduino module?

I’ve been playing around with it and love the module, and would like to have it for reference.

Thanks,
David

Hi David,

I will look into loading the initial demo program onto our site tomorrow so that people can download it.

-Sean

Hi Sean,

Thanks! I’m loving the Aurdino module, I can’t wait to see the original code. my attempt to produce something similar did not work.

Thanks again,
David

Hi David,

This should be the code that shipped with your Arduino module. Let me know if you have any questions. I’ll look into getting the actual source file posted to our Arduino page.

/*
littleBitsTester
Sean Schumer
12 MAY 2014

This program shows basic functionality of the w6-arduino bit.
*/

#include <Wire.h>

int aVal = 0;
int output = 9;    // output module connected to digital pin 9
char fadeState = 1; // direction of the voltage movement on pin 9
int fadeValue = 0;
int blinkTimer = 0;
char blinkState = 0;

void setup()  {
  
  Serial.begin(9600); // This sets up communication to a serial monitor on your computer!
  
  pinMode(9, OUTPUT);  // make the pin an OUTPUT
  pinMode(5, OUTPUT);  // make the pin an OUTPUT
  pinMode(1, OUTPUT);  // make the pin an OUTPUT
  pinMode(A0, INPUT);  // make the pin an INPUT
  pinMode(A1, INPUT);  // make the pin an INPUT
  pinMode(0,INPUT);    // make the pin an INPUT

  Wire.begin(1);        // start i2c
  Serial.begin(9600);  // 9600bps


} 

void loop()  { 

  Wire.beginTransmission(2); // begin transmission to 0x10                          
                              
  Wire.write("GGG");    
  Wire.write("bbb");                                    
                               
  Wire.endTransmission();      // stop transmission

  aVal = analogRead(A1)/32; //Read the voltage at pin a1...
    
  // fade in from min to max in increments of 5 points:
  
  if (fadeState == 1) // increase voltage until 5
  {
    fadeValue += 5;
    if (fadeValue == 255) fadeState = 0;
  }
  else // decrease voltage until 0
  {
    fadeValue -= 5;
    if (fadeValue == 0) fadeState = 1;
  }
    analogWrite(output, fadeValue);         
    
    delay(35 - aVal); //Make the output ramp faster when aVal is higher.
    
    
    if (digitalRead(0)) //If the digital button is pressed.
    {
      blinkTimer += (35 - aVal); //Then blink on/off once per second
      if (blinkTimer > 500)
      {
          blinkTimer = 0;
          digitalWrite(1,blinkState);
          blinkState = (blinkState+1)%2;
      }   
    }
    else //If not don't blink on/off
    {
      digitalWrite(1,0);
    }

  aVal = analogRead(A0)/4; //Read the voltage at pin a0...
  analogWrite(5, aVal); //Now reproduce the voltage at pin d5
}

Good morning! I would like to use a longer USB cable with the Arduino bit. Is it possible to use a generic USB cable? Is a USB MicroB cable the right one? I remember seeing some cables identified as compatible with the Arduino, so I am wondering if there is an issue.

Thanks for your help!

David