DIY electronics

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Thats just poor engineering. Sigh.

This is also why you should have your ground planes heavily connected to each other, and make your routes as clean as possible. RF loves to hop on top of some ringing and make things go haywire :)
 
Thats just poor engineering. Sigh.

This is also why you should have your ground planes heavily connected to each other, and make your routes as clean as possible. RF loves to hop on top of some ringing and make things go haywire :)

I don't know if this is the case in this instance, but in general, that's a side effect of the fact that it's now possible for us non-engineers to build this kind of thing. I built a GPS transmitter that worked fine on a breadboard, but on my PCB the GPS refused to get a lock. I'd bet that the problem was something engineers would have seen coming from a mile off, but I have no idea what was wrong.

If you want to solve this, keep telling us how things should be, and explain why in plain English. We're reading your posts with great interest.
 
GPS units aren't transmitters. They are receivers, operating at microwave frequencies. Board layout is critical and stripline techniques must be used.

Did your design also include a transmitter to transmit received GPS data?

A rule of thumb is one bypass/decoupling cap per power pin, placed as closely to the power pin as is possible. IIRC, in the telemetrum case they had forgotten a capacitor at the input of the voltage regulator.
 
Last edited:
It's a really good idea to listen to "rules of thumb" from those who have done a lot of board designing and production. If you get into some good habits while you're designing the circuit and laying out the board, you can save yourself a lot of pain. Capitalize on the willingness of folks to pass along pointers that they learned through through the pain of boards that didn't quite work. In my experience, every little area of "black art" you inherit from someone else can save you weeks (and at least one board turn) during development. If sometimes these folks sound like they are lecturing you, what you're really hearing is a flashback to all of the hours that they spent cursing at a board. Stuff like that can turn very nice people into grouches. (Been there.)

Beyond what's been stated, here are a few of my own rules of thumb:

1. Some tools are indispensable, most of which are not too expensive
  • Saleae Logic 8 for I2C, SPI, and UART signals ($149 highly recommended)
  • Large handsfree gooseneck magnifier
  • Multimeter with μA current sensing
  • SparkFun ultra-sharp angled tweezers (priceless)
  • Temp-regulated solder station
  • Temp-regulated hot air station (for reworking things)
2. Include test points (in the form of through hole pads) for all of your important signals (I2C, SPI, UART). 0.05" pins take very little space (you don't need 0.10")
3. Consider buying reels of parts when they are cheap (for instance 10,000 resistors will cost about $13)
4. Corollary to #2: don't scrimp on resistors and capacitors in your designs when manufacturers recommend them, such as noise suppression, and don't rely on "weak internal pullups/pulldowns" in microcontrollers (pet peeve)
5. Connectors for things like displays and batteries cost money, but they are worth it
6. RF can be very weird, especially to people without analog experience. Definitely use other people's advice, as well as online calculators for trace widths. Study reference designs from RF chip vendors.
7. Use dedicated ground and power planes. I know this is hard for 2-layer budget folks, but consider using at least a 4-layer if you can.
8. Don't be afraid to use packages without leads, like QFNs. Some cool parts ONLY come in them. Use footprints on the board that stick out slightly from the outline for testing.
9. A $40 toaster oven and a willingness to buy stencils for each design ($99) will let you make just about anything.

Just my two cents worth.
 
Last edited:
If sometimes these folks sound like they are lecturing you, what you're really hearing is a flashback to all of the hours that they spent cursing at a board. Stuff like that can turn very nice people into grouches. (Been there.)
That'd be me - or a "prototype" a client has sent to me to clean up and wonder how it worked at all...

[*]Saleae Logic 8 for I2C, SPI, and UART signals ($149 highly recommended)
I prefer my Saleae over our scope's logic analyser TBH. Its pretty awesome. $150 tool beating out $5000 tools (obviously, the scope does a lot more) - hurrah to the hobbyist!

2. Include test points (in the form of through hole pads) for all of your important signals (I2C, SPI, UART). 0.05" pins take very little space (you don't need 0.10")
I put test points on the bottom of the board in the form of a 0.8mm hexagon (so machine vision won't confuse it with a fiducial). Mine are just pads with no paste, through holes take up space on both sides of the board. A milled or 3d printed clamshell with pogpins can be used for a test/programming jig with these. For units you use on your desk you can solder 28AWG wires to them very easily to break out the signals. Every digital data line and everything that isnt just a LED gets a test point. Opamps get multiple through their system incase something doesnt match up with simulations.

4. Corollary to #2: don't scrimp on resistors and capacitors in your designs when manufacturers recommend them, such as noise suppression, and don't rely on "weak internal pullups/pulldowns" in microcontrollers (pet peeve)
Here here.. "but my microcontroller can do it" - sure, but not very well. Same with expecting a high impedance state on startup. On the capacitor note - don't skimp on the voltage or temperature rating either. A 10uf/10v cap at 9v is almost useless, a 2uf 50v cap will do more. Use at least double the highest voltage you expect to see.

8. Don't be afraid to use packages without leads, like QFNs. Some cool parts ONLY come in them. Use footprints on the board that stick out slightly from the outline for testing.
If you're hand placing, consider putting a 0.2mm L in each corner of the chip (or at least two of them) as a line in your mask - assuming the chip doesn't have pins in the corners. This will allow you to align the part to those marks - don't use silkscreen, it can be out by as much as a mm.

9. A $40 toaster oven and a willingness to buy stencils for each design ($99) will let you make just about anything.
Avoid the Pui Hui/SMT Max $400-600 cheap "reflow ovens" they are a fire hazard and a total waste of money. Just get a good toaster oven that has reflectors/shields over the elements. $99 for stencils? sheez - https://smtstencil.co.uk or find someone who has a laser engraver and some photocopier transparencies. A $800 laser engraver will do decent stencils. Local laser engraving companies can also make stencils - laser cutting companies CANNOT - they cut steel with 1-2mm beam widths on multi-kw lasers.
 
GPS units aren't transmitters. They are receivers, operating at microwave frequencies. Board layout is critical and stripline techniques must be used.

Did your design also include a transmitter to transmit received GPS data?

Yes. I know that GPS receivers are receivers. I've got other versions of this device working just fine (and in fact have flown them a few times) - this was supposed to be a more elegant one. But my board design messed up the ability of the GPS unit to receive properly.

I don't want to hijack the thread here, so enough said. It's a dormant project for now anyway.
 
Yes. I know that GPS receivers are receivers. I've got other versions of this device working just fine (and in fact have flown them a few times) - this was supposed to be a more elegant one. But my board design messed up the ability of the GPS unit to receive properly.

I don't want to hijack the thread here, so enough said. It's a dormant project for now anyway.


I don't think you've hijacked it anymore than we have :) What was the problem with your unit?
 
I dont think that talking about a receiver you made in a thread titled DIY Electronics is going off topic...

For your GPS, check your power is clean, you have the correct impedance on the antenna trace, all your grounds are correct - if you're using an active antenna there should be some passives on the antenna track. The biggest thing i see in RF circuits killing sensitivity is poor power quality.
 
Well, okay, if you're that eager. I had GPS serial output going into an XBee to be transmitted to another XBee on the ground. My flying/working version has a "hockey puck" GPS receiver that attaches to a DB9 connector on my board to get power and send the data. That works exactly as I'd hoped it would, and I've gotten good data through two flights. I wanted a smaller version with a GPS receiver right on the board. I used an GPS I got from Sparkfun that worked just fine on my breadboard of the circuit, but never got a GPS lock on the PC board version. It was getting power - the light was on, and it was sending data through the serial connector - just the data that you get when a GPS is trying but not getting valid position data. Sparkfun eventually stopped carrying that GPS because of the number of similar problems people were having when putting it into their designs - again, for me it worked great on a breadboard but not on the PC board.

It's very possible that my power supply was the problem. I'm quite confident the voltage and current were okay, but I wouldn't bet that it was "clean", as you say. I don't remember for sure, but I don't think I had a ground plane at all in that design (though later RF boards I made did have ground planes). And you're already over my head with that impedance and "passives" talk (which is why I said the problem is probably something engineers would see from a mile off).
 
Which GPS chip was it?

Passives are resistors, capacitors, inductors, diodes and the like. They are "passive" parts of the circuit, vs active - such as an IC that does something.

For RF, tracks need to be a certain width, in this case, the impedance of the microstrip (rf track) should be as close to 50ohms as possible. It's not something you can just measure with a multimeter, so getting it right with calculations before laying down the PCB is important. Clearance from plane to track, and track to the opposite side of the board, as well as the dielectric of the PCB all matter. There are trace width calculators online though if your PCB design software won't do it for you. Impedance is also important in high speed digital design, as it can stop some noise and ringing in the circuit caused by reflections or the signal not travelling at an optimal speed.

You can think of the antenna track on the PCB like a little bit of coax. For example, at 6ghz an open wire used for transferring a signal from a tx/rx and antenna might yield 10db loss/metre, low end thin coax 2db/m and high end hardline 0.2db/m. At gps frequencies (1575mhz) things are not so critical, but you're still dealing with microwaves - and an extremely weak signal. So if things are not quite-right you can lose a lot of that very weak signal very easily :)
 
Here's a terrible image of another useful tool - the SMD doofus. It's used to hold a small SMD part down while soldering. A hot air pencil will blow the small parts all over the place - that's where this device comes in.

In my case it's made from a bit of 3/32 TIG welding rod, sharpened on the end. YMMV...

I use a 1500 watt toaster oven for most SMD soldering, the doofus and air pencil for rework as well as solder wick with a Weller ESD safe iron for removing solder bridges. A set of optivisors is indispensable.

This hot air pencil is fairly inexpensive and works quite well. I've only used the hot air pencil, not the iron. https://www.ebay.com/itm/120571221985

These tweezers are great: https://www.digikey.com/scripts/dksearch/dksus.dll?vendor=0&keywords=EROP3CSA-ND

smd_doofus1.jpg
 
You might try to build a radio-controlled deployment device: there's quite a bit more "headroom" there as far as coming in at less than the price of a commercial device. Some of what you've already done would transfer over (power, FET).
 
I'm not sure that an ATTINY is going to be able to hold enough code for the LPS331. Take a look at the new Freescale MPL3115A2, it does all of the altitude calculations internally and it also has some triggers you can set, so it's going to use a minimum of code to get it working. It's real cheap too, but its calibrated range is only about 18000' ASL; that's probably enough unless you're going for your L3. You may end up using an ATMEGA328P, which has 32 MB instead of 8 MB, but you can get it as a 32-pin SMT quad pack so if you're worried about space it's not going to take up much more than an ATTINY84 in a DIP-8.

Self-checks are good. Having BP ignite on the pad is bad...
 
Avnet has MPL3115A2's now, they're $2.42 in single quantities. I haven't had the chance to play with one yet since I've been tied up with my own project (see www.eggtimerrocketry.com ) but it looks very promising. I've had a pending sample order from Freescale for several months, the data sheet for this thing has been out for over a year. I can see this sensor being the basis for a really inexpensive peak-display altimeter, or possibly a simple multiple-deployment controller. Compared to the other common integrated sensors ( Bosch BMP085/180, Meas-Spec MS5607/5611) it looks like a bargain.

You're not going to get enough volume out of a little pizo buzzer to make it useful as a locator, your best bet would be to get a Mallory Sonalert and run it off a 9v or 12v battery.
 
Think less in terms of volume, and more in terms of a sound your ear doesn't process as white noise, and ignore

The Pratt Micro Beacon isn't very loud, but its warble is distinct from background noise, so it's discernible from an amazing distance. I got yet another example of that at LDRS, when we found one on the ground in the 3+ foot tall potato crop - we heard it from over 100 feet away, circled in on it, and found it
 
Well, I was still in DIY mode. Yes, the Pratt Micro Beacon is a good alternative, and they're pretty cheap too.
 
It's tough to hand-place a .5mm pitch SMT device, especially a LGA because you can't see the leads. The MPL3115A2 is 1.27mm pitch with pads on only two sides, so it's going to be a lot easier to deal with.

You'd still have to do the floating point pressure to altitude calculations with the LSP331, and that's going to take a lot of space on an ATTINY. With the MPL3115A2, you just send it a "start" command, wait a little bit, and read the altitude directly from the registers. You could also theoretically use the INT outputs to fire your deployments, after you set the minimum/maximum registers' altitude. A little extra logic to prevent unwanted firing would be in order, of course.
 
Geez you guys! I try to read through this post, and, well...I don't have a clue what you guys are talking about.

Betchya can't rebuild a Quadrajet though. :p


If you had to Google what that is, then you know how I feel. :lol:
 
I had a Rocket 350 with a Quadrajet.....but I still think that the Zenith-Stromberg SU was a bigger challenge....

(I am an IT systems integrator, but this stuff....phewwww...way beyond me)

G.D.
 
Maybe not. Get 3 each 820 ohm and 1.5K resistors, create three voltage dividers with the 820 ohm at +5 and the 1.5K's to ground, and connect one divider tap each to VCC, SDA, and SCL on the I2C sensor. Make sure that you have the ATTINY's internal pullups turned off first. This will run the chip and the I2C bus at approx 3.2v which should be fine.
 
Geez you guys! I try to read through this post, and, well...I don't have a clue what you guys are talking about.

Betchya can't rebuild a Quadrajet though. :p


If you had to Google what that is, then you know how I feel. :lol:

Who can't rebuild a Quadrajunk? Lol...

Well, maybe times have past on for that, but it used to be almost a right of passage...
 
Never did a Quadrajet, but I did have a Fiat 850 with a Weber carb, and a 1962 Corvair with two of whatever crappy carbs they used. Getting them in sync was nearly impossible... they went with FI in 1966 with the Monza Spyder but by that time Ralph Nader had killed it off.
 
All of the pressure sensors will show some drift if you take a lot of readings over a short period. I spent a lot of time and several prototype boards with different sensors before coming to the conclusion that it probably doesn't matter which sensor you use in rocketry because the aero noise is going to negate the tiny differences in "accuracy" that distinguish one sensor from another. In the end, I flew different sensors in the same rocket, and the results were all within one metre, with is about the absolute accuracy that any of them claim. I use the Bosch BMP-series in the Eggtimer, it's the least expensive monolithic sensor that's rated to 30,000'. I tried the Measurement Specialties MS56xx-series, but they're a lot more money and there's only one source for them in the US.

As far as your sensor, I can't really say for sure. What is the time difference between the samples? If it's only a few ms, I would probably write it off as noise and do more testing... take it to a higher elevation and see what you get. If the readings aren't reasonable, i.e. the absolute altitude readings look way off, then you may have damaged the sensor. The fact that it still appears to work is probably a good sign, however.
 
Never did a Quadrajet, but I did have a Fiat 850 with a Weber carb, and a 1962 Corvair with two of whatever crappy carbs they used. Getting them in sync was nearly impossible... they went with FI in 1966 with the Monza Spyder but by that time Ralph Nader had killed it off.

Granted this is OT, but the stock 110 HP Corvair was outfit with dual single barrel Rochester carbs, and the beefier 140 HP had 4 single barrel carbs... yes, it had a heck of a throttle linkage setup! My dad collected rebuilt several minty models... never owned any of the 180 HP turbo models however... standard block motor with hardened crank, cams, pistons.

Back on topic, your sensor readings don't look especially alarming... if you converted from elevation back to millibars or absolute pressure you'd see that it's fairly stable and your noise would be out a few decimal places.
 
Looks very nice!

1M is about what you can expect, so your sensor is fine. 512 samples takes awhile, you may want to reduce that because the pressure is going to be changing while you are sampling and that induces noise; if it takes over 5ms to read the sensor then it's probably too long. The LPS331 data sheet doesn't directly specify the conversion time for the various resolutions, so you're going to have to play with it. Are you using the internal clock on the LPS331 to drive the sampling rate or are you polling it in one-shot mode?


Here is the final product waiting to be flight tested:

View attachment 100212

It weighs 15g with the battery.

I found a couple mistakes in my programming. I wasn't pausing after the request for a measurement or checking the status register to make sure the measurement was ready. I believe I was pulling values before the internal noise correction finished its 512 samples. I also soldered everything to the board with filter capacitors thinking that maybe the reference voltage for the ADC wasn't stable. I lowered the pull-up resistors to 4.7k from 10k. I still had long wires connecting it to an Arduino to read out the values to the PC in real time, so I'm sure that introduced some interference in testing. However, with the unit stable on my desk I was getting altitude values in feet with a standard deviation of around 4ft.

Looking forward to launching the thing to compare its max altitude reading with what I expect from the rocket.

Once I verify it functions in flight, I'll work on logging the flight pattern to the EEPROM.
 
Ah, dealing with decimal values on 8bit architectures. AVR-GCC implements both float (single) and double as 32-bit IEEE 754
floating-point numbers, long double is the same deal. 32 bit floating points are the only supported types by AVRGCC (which arduino uses).

IIRC, IAR support 64bit double precision floating point numbers on AVRs, however you're looking at $3-5k for the compiler depending on where you buy it, and what edition you get.

If you don't want the hideous rounding errors and slow speeds of dealing with 32/64bit numbers, go ARM Cortex M0 or M3 ;) Way way more performance, same or less cost.
 
Don't use floating point. Use integer math or fixed point. Google it.
 
Sometimes you HAVE to, i.e. converting a 32-bit ulong hPa pressure value from the sensor's registers into altitude in feet. One floating point calculation isn't going to be a significant source of "error", it's when you use a lot of them and chain them that you run into problems, but it's mainly with cycles not accuracy. My advice to pck1e is to use the smallest data type that you can whenever possible, it will save both memory and cycles. If you have to use floating point, save it for the very last calculation if possible and don't mix floating point with integers.

8-bit MCUs like PICs and Atmels work great with applications like most of ours, because the sensors generally deal with bytes anyway. If you had a 32-bit MCU you'd still have to do all of the bit shifting etc. to get the byte-level data into longs and you'd still have to wait for the sensors and the serial memory (3-5 ms per write for EEPROMS!), so I don't see a significant reason to go looking for a "faster" processor. There are tons of FREE tools available for 8-bit MCUs so from a DIY point of view it's a natural choice.

Don't use floating point. Use integer math or fixed point. Google it.
 
Sometimes you HAVE to, i.e. converting a 32-bit ulong hPa pressure value from the sensor's registers into altitude in feet.

I managed to do a conversion from an ADC reading to altitude (in meters) with integers on a PIC16F628 so you don't HAVE to.
 
Back
Top