Started By
Message

The joys of micro-electronics...

Posted on 5/13/23 at 4:04 pm
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/13/23 at 4:04 pm
With summer approaching the kid is working on a bunch of merit badges. Three that are on his list are, Space Exploration, programming, and electronics.

One of the requirements of Space Exploration is to "Build, launch, and recover a model rocket.* Make a second launch to accomplish a specific objective."

So dad being the thinker that he is, I figured we could combine a few of the requirements for multiple badges. So for our "specific objective" I proposed that we build and program an Arduino based altimeter using a BMP-280 barometric pressure and altitude sensor. It would write data to a micro SD card which we could download after flight.

So we got the prototype working and the code mostly where we liked it. And after building and soldering it to a protoboard we plugged it in to a lipo battery from his model plane....

POP!!!! We fried one of the resistors on the main board.

Oh well, Back to the drawing board.
This post was edited on 5/13/23 at 4:04 pm
Posted by UltimaParadox
Huntsville
Member since Nov 2008
40816 posts
Posted on 5/13/23 at 8:32 pm to
Doh, power to ground short somewhere? Assuming it could be repaired easily
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/13/23 at 10:33 pm to
It fried one of the resistors. It likely could be repaired, but the boards are so cheap, it's not worth the effort.

Plus my eyes aren't that good anymore.
This post was edited on 5/13/23 at 10:34 pm
Posted by Zappas Stache
Utility Muffin Research Kitchen
Member since Apr 2009
38622 posts
Posted on 5/14/23 at 2:41 am to
So Dad is getting his badges?
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/15/23 at 8:27 am to
quote:

So Dad is getting his badges?


No, but dad's helping keep him focused on scouts (and other activities) and off youtube. Plus it's just good Dad/Son time. But hey, don't see the bigger picture and just post snarky replies on the internet.

And amazon got the new board got here yesterday and we got things working. As suspected, there was a short to ground that fried the voltage regulator. A few mins with a the multimeter figure it out. Got everything resoldered late last night and got the code uploaded. Since the new payload capable rocket won't be here for a few days we attached the payload package to his drone this AM before school. Here's a graph of out 1 min test flight...



Here's a photo of the board.



As you can see, he butchered the soldering. But it was his first time doing it and the space to work in is TINY. It only has to survive a couple of launches. I'm not sure I would have done any better. Dad has a steadier hand, but worse vision. Honestly, the value here is in the process, not the final result.

I'm now a little worried that it's going to be a little on the large side and we'll have to rework the physical layout to fit in the payload bay. It's 76mm long by 0.09375 mm wide. Worse case I think we'll have to grind do the excess proto-board and change to one of his smaller RC plane batteries. But we'll see....

This post was edited on 5/15/23 at 8:38 am
Posted by Korkstand
Member since Nov 2003
28684 posts
Posted on 5/15/23 at 8:36 am to
I spent a minute trying to figure out how you flew the drone damn near a mile high then I realized you're in Utah...
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/15/23 at 8:40 am to
quote:

I spent a minute trying to figure out how you flew the drone damn near a mile high then I realized you're in Utah...


Yeah, it's actually reading a little low. Our elevation is about 4,500'. I'm not sure if it's a calibration issue or what? I could go in the code and try to tweak it, but not sure its worth the trouble as were just looking flight height above the ground, not about MSL...
This post was edited on 5/15/23 at 8:42 am
Posted by Korkstand
Member since Nov 2003
28684 posts
Posted on 5/15/23 at 8:52 am to
quote:

Yeah, it's actually reading a little low. Our elevation is about 4,500'. I'm not sure if it's a calibration issue or what? I could go in the code and try to tweak it, but not sure its worth the trouble as were just looking flight height above the ground, not about MSL...
Yeah air pressure changes all the time so a barometer won't be so useful for absolute altitude but it'll probably be reasonably accurate for relative altitude for a flight. You can just manually "calibrate" the data after the fact by subtracting the initial value, or do it in the code. A GPS module would give a more accurate absolute altitude, but I'm not sure if it will update frequently enough for your purposes or whether the power consumption will be too high.
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/15/23 at 9:53 am to
quote:

Yeah air pressure changes all the time so a barometer won't be so useful for absolute altitude but it'll probably be reasonably accurate for relative altitude for a flight. You can just manually "calibrate" the data after the fact by subtracting the initial value, or do it in the code. A GPS module would give a more accurate absolute altitude, but I'm not sure if it will update frequently enough for your purposes or whether the power consumption will be too high.



I think you're right as the bar for the requirements he's trying to pass off. Honestly, they're pretty low. They are:

Space Exploration
3. Build, launch, and recover a model rocket.* Make a second launch to accomplish a specific objective.

I'd say we have that one covered.



Programming
5. Projects. Do the following:
(a) With your counselor's approval, choose a sample program. Modify the code or add a function or subroutine to it. Debug and demonstrate the modified program to your counselor.
(d) Explain how the programs you wrote for requirements 5a, 5b, and 5c process inputs, how they make decisions based on those inputs, and how they provide outputs based on the decision making.


Most of the code used is a combination of the Arduino example sketches for the BMP-280 and SD card write. So I think he has that one covered as well. After we got a basic sketch working I added a few refinements to make importing in to excel easier (rearranged the order of the columns in the write output). But that was more to make satisfying the requirement of Space Exploration 3b easier than satisfying requirements in the programing badge...

For electronics, he just has/had to demonstrate how to solder and de-solder components. He did that putting the board together. Most of the kits for that one are very simple, so I think we have that one covered too. It will be up to his counselor to make the final decision...

This post was edited on 5/15/23 at 11:13 am
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/15/23 at 11:15 am to
quote:

A GPS module would give a more accurate absolute altitude, but I'm not sure if it will update frequently enough for your purposes or whether the power consumption will be too high.


Thinking more about this a little more, you could use a GPS sensor to take a base altitude and use that to correct the Altitude and barometric pressure sensor...
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 5/17/23 at 7:52 am to
So as I suspected/feared, the previously built module was too big to fit into the rocket as built. The tube to fit things in IS 4" long, but part of that space is taken up by the nose cone and the interface with the body tube. So we had to re-engineer things. That's when everything went haywire...

First, I hate de-soldering, and hate is putting it mildly. This is especially true when working at such small scales and in tight quarters. However, I only had one SD card reader and the one I used was recycled from a previous project. Well, in the process of taking things apart, I managed (and this one is all on me) to rip a couple of the solder pads off the card reader. No big deal, I'll just order a few new ones and go from there. We rebuilt the module off a proto board with the individual components connected by jumper wires. This was actually a more interesting process trying to attach/solder jumpers to the pins we needed at angles where all the pins we still be accessibly. That was done while we waited on the SD card reader module.

Thanks to the kind delivery folks as Amazon, we got some smaller SD card readers. During testing and disassembly I managed to destroy or incapacitate all of the BMP-280 pressure sensors (I had a few that still worked, but they were incompatible with how we now had to assemble the project. The had solder over the pinout holes that I couldn't get pins into) It was waiting on those where things went sideways with the coding. Long story short, the original sketch was using the IC2 protocol to read the board. The built in example sketches in Arduino IDE use SPI. Since our prototype was wired for IC2, the board and the module weren't communicating. AND to further complicate things, the first thing the sketch does is look for the SD card reader and if it doesn't find one it goes no further. Since the card readers weren't working we were basically stuck at this point....

When we went to start testing things again, I could not get the code to recognize the SD card reader(s). In an effort to save space, I had gone with a smaller unit that had no onboard voltage regulator. I tried multiple units and was suppling the required the 3.3v as specified by the pinout, but I still could not get the board to recognize the card reader. In the amazon reviews, there were mixed reviews about the voltage needed. Some said 3.3v others said they "needed" 5v. We're powering the module on a 3.7v lipo, which is the bare minimum for the pro-mini based upon the datasheet. At that input voltage, the vcc pin only outputs 3.3v. So I thought I might have a voltage problem. Solution: Re-order the original SD card reader board with the voltage regulator.

Well those arrived last night. Still nothing. I was stumped. These card readers will only work up to 32Gb cards, and I only had 1 "working" 16gb card. Or so I thought. After trying for about an hour to make things work, I popped the SD card in the computer to see if ANYTHING was getting written to it, and you guessed it, it was corrupted. Off to wal-mart of get a SD card. (Side note: I found $200 cash in the wal-mart parking lot that I turned into customer service. Do a good turn daily....)

When I got back home, we put in the new 32gb card. Nothing on the prototype, but we were able to make both card readers work on a nano that I use to mock things up on a bread board. AND I was able to make them work using both 3.3v and 5v inputs. That told me that we had a working card, and working card reader board and that the problem was elsewhere.

Remember earlier in the story where I told ya'll I had bad eyesight close up? Well here's the part where it comes into play. I had my strongest pair of readers on and was examining the Pro-mini. While doing so, I noticed that a couple of the pins where the SD card reader connects (MOSI and MISO) had minimal to no solder on them. Could it really be that simple?

The kid has two tests today and a huge WWII project in social studies so I took the board to the basement and (re)soldered the two pins. I head back upstairs and reconnect everything. Fire up the serial monitor and there's the data. I'll be dipped. Conclusion? I'm an idiot.

The kid came into the office to see what the commotion was about and gave me a high five. We crammed everything into the payload compartment and fired it up. The data transfer lights on the Arduino are flashing. Data's transferring. We take it out to the back yard and play catch with it for a few mins. Bring it back in and download the data. Check. All systems nominal.

Now he's got to assemble his new rocket and take it for a test rip. From the beginning he told me, "Dad, we shouldn't build anything until the rocket gets here." Well, in hindsight, looks like the kid was right all along.

He also told me he wanted to use his new drone to film his rocket launches for a "cool" perspective. Next merit badge on deck, Moviemaking...
This post was edited on 5/17/23 at 7:55 am
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 6/12/23 at 12:40 pm to
We finally got a day to fly our rockets yesterday. Good news. We were able to successfully log data from one of our flights. Bad news. Using our more powerful engines, the initial G load overwhelmed the sensors. We pegged the accelerometer at 4.7 G's and didn't get any meaningful data out off the SD card after that. While writing the code, I opted for the 1 data file approach thinking that I could plot the data and look at the peaks and valleys and determine where our flights were. (This was to save me having to open the payload bay and reset the microprocessor every flight.) But, we had 1 successful flight and in realty, that was all we needed. Here's the data plot from that flight....



For those that are interested, our max altitude was 337' using a B4-4 rocket engine.
Posted by Korkstand
Member since Nov 2003
28684 posts
Posted on 6/12/23 at 2:51 pm to
That's pretty awesome!
Posted by UltimaParadox
Huntsville
Member since Nov 2008
40816 posts
Posted on 6/13/23 at 9:00 am to
quote:

Remember earlier in the story where I told ya'll I had bad eyesight close up? Well here's the part where it comes into play. I had my strongest pair of readers on and was examining the Pro-mini. While doing so, I noticed that a couple of the pins where the SD card reader connects (MOSI and MISO) had minimal to no solder on them. Could it really be that simple?


To be fair I have never had a design that wasnt at least a little complex where I did not cross at least one TX/RX line. I started designing everything with 0 ohm resistors in line just so I could fix these by hand in the future.

Congrats on getting it work, awesome data
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 6/16/23 at 4:37 pm to
I enjoyed this project so much, I designed and ordered a custom PCB for it. As soon as it arrives from China we'll assemble it.

Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 7/5/23 at 9:44 am to
The boards came in last week. We got the soldered up and flew them over the weekend.



Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 8/14/23 at 11:10 am to
An update on the next build I'm working on.

Of all the things we've done this summer, one of the things the kid has had the most fun with is the model rocketry. We've been going out to the local park once or twice a month on Saturday or Sunday AM before church and flying old and new rockets. As his interest has progressed, so have the flight capability of the rockets. That means multistage rockets and ones with much higher flight capabilities.

A couple of Sunday's ago, we sent his original payload carrying rocket super high on a C6-5 rocket motor. It was so high, it was out of sight for these my old eyes. We eventually found it, across the street, almost 1/4 mile away. We have a really large launch area, but a couple of things happened on the launch that exacerbated the incident. Mainly the payload bay separated from the main rocket body. This allowed the relatively small payload bay to be carried a long distance on a relatively large parachute. This let it drift a LONG way before touchdown. We also learned the downside of painting the rocket body camo green when trying to find it in 40 acres of soccer and baseball fields. I should add the kid is somewhat emotionally attached to this particular rocket, and dad is attached to the electronics package.

A reevaluation of the incident in my head got me thinking. We've never lost a rocket, and I hope we never do. We've had several come back in pieces, but we've always recovered them. I'd hate to break that streak. When we were looking for the rocket body and payload we both kept saying that if we didn't find it, we'd never know how high it really went. The kid also said many times, "We need a GPS tracker." So, if we 1): We already have an electronics payload, and 2) Our microcontrollers have extra pins that were not using, 3) They make GPS modules for these things and 4) there is a way for micro-electronics to communicate with each other wirelessly, then we should be able to build/add a GPS function to our payload. After doing some research, sure enough, there are several breakout boards that allow one to do that are within our size requirements with (optimum) ranges of up to 1 km. If that's the case, it should be possible to interface a GPS module that broadcasts it's location wirelessly from an electronic package embedded in a rocket's payload bay to a ground station at the launch location. My initial thought here is to use a NodeMCU esp8266 broadcasting it's own SSID which would allow us to visualize the data on a laptop or tablet.

The concept here is this. A small microprocessor connected to a Barometric pressure sensor, a GPS unit and an HC-12 433 mhz wireless board. If there's room I'd love to log the data via a microSD card, but if the boards are communicating with each other there should be a way to download it to the base station or to the microcontroller itself. There couple of issues with those two approaches. 1) Keeping a continuous connection with the base station at a frequency fine enough to get useful flight data. 2) The possibility of losing any data stored in the onboard flash memory of the microcontroller. Most of these devices have limited onboard memory to begin with. All of this would fit in the rockets payload bay. Before and after launch it would broadcast it's GPS location 1x a second (more frequently that that it trying to record telemetry data.)

SideNote: I'm really high on this board right now. The seeeduino Xiao. It's smaller than and has significantly more memory that a Arduino nano or pro-mini.



As I mentioned above, the signal from the payload bay would broadcast to a NodeMCU esp8266 in turn broadcasting to it own SSID to a table or laptop onsite. It would have a high gain 433 MHz antenna and a signal amplifier. If I can figure out the software side of things, it should display the GPS location of the payload bay on google maps or other mapping program/app.

As you can tell, this is going to be quite an ambitious project from both a hardware and software point of view. However, I know it can be done. The good thing is, as rockets get bigger to fly higher, their ability to carry payloads also increases. I think I'm pushing they physical space limitations of the rockets we have carry a payload with all of the doo-dad's we're adding too it. Likely what I'll do is build things first, then we'll build a rocket to carry what we build. After we get a working prototype, I'll have custom printed PCB's made. I think it's going to be a fun project. I'll keep the group posted.....

TLDR: We're building a wireless GPS tracker for our rockets.
This post was edited on 8/14/23 at 11:27 am
Posted by UltimaParadox
Huntsville
Member since Nov 2008
40816 posts
Posted on 8/14/23 at 9:55 pm to
quote:

1) Keeping a continuous connection with the base station at a frequency fine enough to get useful flight data.


Might be tricky with using standard omnidirectional antennas, but dont know the planned height of your flight plan

quote:

2) The possibility of losing any data stored in the onboard flash memory of the microcontroller. Most of these devices have limited onboard memory to begin with. All of this would fit in the rockets payload bay. Before and after launch it would broadcast it's GPS location 1x a second (more frequently that that it trying to record telemetry data.)


Not enough room to add a microSD card slot? Most modern micros can let you talk to them via few wires over SPI.

quote:

If I can figure out the software side of things, it should display the GPS location of the payload bay on google maps or other mapping program/app.


This should be pretty straight forward. I would suggest just making sure your network is up and running before launching and just sending a continuous broadcast of UDP packets from the rocket as it flies. you might miss a few if the connection breaks, but you wont be wasting time on retries with TCP.

Plotting on google maps kind of sucks without internet depending on where you are. Other source like OpenStreetMaps can be used
Posted by Lonnie Utah
Utah!
Member since Jul 2012
23834 posts
Posted on 8/15/23 at 8:36 am to
quote:

Might be tricky with using standard omnidirectional antennas, but dont know the planned height of your flight plan


At this point, I don't see us going over 1,500'-2,000 feet. Although there are two outstanding high altitude flight locations within 1.5-2 hours from us. One is certified for launches up to 10K feet and the other (the Bonneville Salt flats) is certified to flights up to 30K feet. The local rocket club launches out there on a fairly regular basis. We might go out there one of their launch weekends. I'm sure that some of the folks there already have these issues sorted.

quote:

Not enough room to add a microSD card slot? Most modern micros can let you talk to them via few wires over SPI.


Our last electronics build had a SD card reader, and I still have a bunch of them left that I could add to a PCB. That's likely the route I would go.
This post was edited on 8/15/23 at 8:38 am
Posted by Tree_Fall
Member since Mar 2021
461 posts
Posted on 8/19/23 at 12:03 pm to
When I was a kid, I learned discrete component soldering constructing EICO kits and building ever-smaller 1 transitor radios in plastic boxes. You might see if your son might enjoy a project with minimal use of boards.

Rocketry in same era could be pretty dangerous.
first pageprev pagePage 1 of 2Next pagelast page

Back to top
logoFollow TigerDroppings for LSU Football News
Follow us on Twitter, Facebook and Instagram to get the latest updates on LSU Football and Recruiting.

FacebookTwitterInstagram