element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
NanoRama
  • Challenges & Projects
  • Project14
  • NanoRama
  • More
  • Cancel
NanoRama
Blog Nano Rocket #1 : Hand Thrown with TTL Serial Communications
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join NanoRama to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dubbie
  • Date Created: 10 Apr 2020 12:12 PM Date Created
  • Views 2408 views
  • Likes 11 likes
  • Comments 17 comments
  • nano sense
  • nanno sense
  • rocket
  • arduino nano 33 ble sense
  • nano 33 ble sense
  • nanorama
  • nanoramach
Related
Recommended

Nano Rocket #1 : Hand Thrown with TTL Serial Communications

dubbie
dubbie
10 Apr 2020
image

NanoRama

Enter Your Project for a chance to win a Nano Grand Prize bundle for the most innovative use of Arduino plus a $400 shopping cart!

Submit an EntrySubmit an Entry  Back to homepage image
Project14 Home
Monthly Themes
Monthly Theme Poll

 

The original plan for my Nanorama project with the Nano 33 BLE Sense generously donated by Element14 was to fix the Nano Sense to the tip of a water powered rocket, fire it off into 'space' and capture all the data when the rocket returned to earth. Regretfully, due to the current circumstances I am not able to fire a water powered rocket as I am restricted to my bacl grarden and it might not come back to me. So, instead, I have modified the design to make it a hand powered rocket, which I will thrown in my back garden. In a previous Blog I outlined the process of using TinkerCAD to design and 3D print the case (Using TinkerCAD to Make a Case for a NanoRama Project  ). I did have a problem with the CR2032 battery holder with the wires being inconveniently placed and I thought I would have to sand off some of the lid, but on a closer inspection I realised that I could drill a hole into the battery holder and re-position the wires more suitably - so that is what I did, which can be seen in the video below. Now I do not have to make any adjustments to the lid of the case.

 

The circuit for the Nano Rocket is simplicity itself, due to the accelerometer sensor being already integrated into the Nano 33 BLE Sense PCB, consisting of just the battery, the Nano sense and the connections to the TTL to USB serial convertor, see circuit diagram below:

 

image

 

I soldered the battery holder directly to the Nano Sense rather than using any form of connectors; first to avoid any intermittent power connections when the rocket was launched or landed and secondly, to minimise the issue of storing wires inside the case. There is an ON/OFF switch on the battery holder (which I have accidentally omitted from the circuit diagram) The connections to the FTDI USB to TTL convertor PCB are made using Dupont plugs with only short wires, again to minimise wire storage inside the case. I have now realised that I should have used Dupont sockets rather than plugs as the pins are free to move about inside the case and could easily cause temporary electrical connections to other parts of the PCB during flight. Hopefully, this will not be a problem.

 

For the software I adapted the example programme provided for the Nano 33 BLE Sense for accessing the accelerometer data. The programme has a simple user interface. The onboard LED is flashed for one second once the accelerometer is setup and ready to go. There is then a 10 second delay for the user to get ready to throw and then a further flash on the LED of one second on is provided. At this point the data is read from the accelerometer as fast as possible and saved into a global array, after which the on board LED is flashed for 0.5 seconds on to signify the end of data sampling. The example programme states that a sampling frequency of 119 Hertz is achieved so I saved 1200 data values in a 1200 x 3 floating point array. This should result in a 10 second period of data sampling but the reality is an approximately 13 second data sampling period so it is likely that my programme has reduced the sampling frequency to something nearer to 100 Hz.

 

void loop()

{

float x, y, z;
int datacount;

dataxyz[0][0] = 0.0;

 

delay(1000);
digitalWrite(ledPin, HIGH);         // will turn the LED on
delay(1000);
digitalWrite(ledPin, LOW);         // will turn the LED on
delay(10000);                            // 10 second delay at the beginning to get ready
digitalWrite(ledPin, HIGH);         // will turn the LED on
delay(1000);
digitalWrite(ledPin, LOW);     

datacount = 0;
Serial.println("Transferring to Serial1 ");
while (datacount < 1200)
  {
     if (IMU.accelerationAvailable())
       {
         IMU.readAcceleration(x, y, z);
         dataxyz[datacount][0] = x;
         dataxyz[datacount][1] = y;
         dataxyz[datacount][2] = z;
         datacount++;
       } /* if */   
  } /* while */
 
digitalWrite(ledPin, HIGH);         // Indicate data collected
delay(500);
digitalWrite(ledPin, LOW);

 

After the data has been sampled and stored in the global data array the programme enters a while loop waiting for a command to be received on the serial communication link provided on the Nano Sense. Fortunately the Nano 33 BLE Sense has two hardwired serial communication links, one for the USB communications and one which is also brought out to pins TXI and RXO on the Nanno Sense. This loop is able to handle any corrupted serial input data caused by making the physical connections between the Nano Sense and the USB to TTL convertor as this has to be performed with power still connected to the Nano Sense, otherwise the captured data would be lost. I have put in two menu selections although only one is actually implemented. This is just to create the outline if any further option selections are wanted. The first option is implemented as a function called listdataxyz()on the menu which lists the collected data out to the second serial port (Serial1) at 9600 Baud.

 

while (1)
  {
    Serial1.println("Nano Rocket " );
    Serial1.println("Dubbie Dubbie : Just for Fun " );
    Serial1.println(" 8th Apr'20 ");
    Serial1.println();
    delay(500);

    Serial1.println("Select Operation  ");
    Serial1.println("Show Dataxyz : 1 ");
    Serial1.println("Not Imp Yet  : 2 ");   
    Serial1.println();
    int value = ' ';
    while (Serial1.available() < 1)
      {
        delay(10);
      } /* while */
    value = Serial1.read();

    switch (value)
      {
        case '1' : listdataxyz();
                   break;
        case '2' : Serial1.println("Not Yet Implemented ");
                   break;
        default  : Serial1.println("Unknown Command ");             
      } /* switch */
    delay(1000);
     
  } /* while */
} /* loop */

 

void listdataxyz(void)

{
int dataindex;

dataindex = 1;
for (dataindex = 0; dataindex < 1200; dataindex++)
  {
     Serial1.print(dataindex); // index value
     Serial1.print('\t');
     Serial1.print(dataxyz[dataindex][0]); // x
     Serial1.print('\t');
     Serial1.print(dataxyz[dataindex][1]); // y
     Serial1.print('\t');
     Serial1.println(dataxyz[dataindex][2]); // z
  } /* for */
} /* listdataxyz */

 

Once the USB to TTL serial convertor has been re-connected to the Nano Sense and the download data option selected PuTTY was used to display the data. This data can then be cut-and-pasted into a spreadsheet. I used Google Sheet online which enables the four columns of numeric values to be listed into four separate columns, a good feature. At this point the system can be tested, as illustrated in the video below:

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Then the USB to TTL convertor is physically connected again and the data can be displayed on PuTTY.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Below is the data captured from my first throw. I'm not entirely sure what it shows so I will have to spend some time thinking about the data and repeating and refining the experimental process. However, my initial thoughts are that the first section where the data is fairly constant is when the rocket was flat on the step as I was getting it started. The next 'jumble' (that's a technical term) is when I was putting the lid on the case and then the lull and 'hump' (more technical terms) are when I drew back my arm and launched the rocket into space. After the hump should be when the rocket hit the ground but the de-acceleration spikes do not seem large enough, plus, ,I'm not sure what the pulsing in the bottom red trace is caused by. The data is for a period of about 13 seconds.

 

image

 

I will have to think about how to process and display the data from the accelerometer (x,y,z) to try and come up with a single measure of acceleration as the rocket is launched, flying and hitting the ground. Anybody any ideas?

 

I am pleased with the progress so far, apart from not being able to understand the data. I will now work on two improvements; first to try and understand the data and second to try and implement a BLE wireless communication link to avoid all the messing about with the TTL communication link.

 

Dubbie

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 5 years ago +4
    Hi Dubbie, I liked your experiment. If I understand the physics of your experiment your rocket should be under 1 G as it sits on the table. The acceleration that you give to it as you throw it should show…
  • abrain
    abrain over 5 years ago +3
    Nice one Dubbie! One thing that might be interesting on the accelerometer data is to start off with looking at the magnitude of it all - something like the following in Excel: =SQRT(POW(A1,2)+POW(B1,2…
  • dubbie
    dubbie over 5 years ago in reply to abrain +3
    Abrain, I did think about finding the absolute magnitude but I wasn't sure it would mean anything, for example if the rocket was spinning,, but I will have to go and give it a try. I'll al so have to go…
Parents
  • abrain
    abrain over 5 years ago

    Nice one Dubbie!

     

    One thing that might be interesting on the accelerometer data is to start off with looking at the magnitude of it all - something like the following in Excel:

    =SQRT(POW(A1,2)+POW(B1,2)+POW(C1,2))

     

    This is assuming that your x,y,z accelerations are in columns A, B and C and you want the "answer" in column D, and it's starting from row 1.

     

    The minor problem with this is that it will give you the absolute magnitude - you should see a good initial spike as you launch, then another as it comes back to hit the ground with a bump!

     

    I'm a little surprised at the start of the data - it looked to me that you had the device nice and flat on a table when you started, so I'd have expected 2 of the lines to be about 0g, and one at around 1g, but one of the channels seems to be at -0.5g, which is interesting - that must all come from it being at a slight angle on your bench.

     

    100Hz sampling looks perfectly good enough, it looks like you've captured it bouncing as it hit the ground - a good throw too!

     

    A

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 5 years ago in reply to abrain

    Abrain,

     

    I did think about finding the absolute magnitude but I wasn't sure it would mean anything, for example if the rocket was spinning,, but I will have to go and give it a try.

     

    I'll al so have to go and look up the initial steady state values on a flat surface to see if they are the values they should be.

     

    Thanks for the suggestions.

     

    Dubbie

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • dubbie
    dubbie over 5 years ago in reply to abrain

    Abrain,

     

    I did think about finding the absolute magnitude but I wasn't sure it would mean anything, for example if the rocket was spinning,, but I will have to go and give it a try.

     

    I'll al so have to go and look up the initial steady state values on a flat surface to see if they are the values they should be.

     

    Thanks for the suggestions.

     

    Dubbie

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube