SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Flatland2D
#21038
I am having trouble obtaining a stable output from this accelerometer. Looking at the signal on the scope shows a noise of 1.25Vpp. This is all very high frequency noise, up in the MHz.

I plan on using an active low pass filter to get rid of this. I am really only concerned with signals of a few Hz or less. This should solve most of the noise problems by itself. I was wondering though how other people have worked with this sensor? Its raw output is almost unusable, and because of aliasing, you can't average out the noise in software either.

The setup is on a breadboard with a PIC18F877A. The X,Y and Z outputs are going to AN0, 1, and 4 (I plan on using AN2 and 3 for Vref later, right now I'm reading 0 -> Vdd (5V)). The accelerometer is attached to about 8" of wire so it can be freely rotated without moving the breadboard. Plugging the accelerometer directly into the breadboard (no long wires) doesn't seem to make a difference.

I am using mikroC as my compiler. I have an infinite loop that reads each axis, converts the values to strings, and outputs them to an LCD. There is a 100ms delay in between cycles.

Any suggestions to help tame the output of this sensor? I have heard people say the Analog Devices accelerometers are more stable. I'm wondering if I should have gone with one of those.
User avatar
By leon_heller
#21041
You are asking for trouble with 8" of wire between the accelerometer and the MCU! They should be on the same PCB, with careful attention paid to grounding. You are unlikely to be able to get it to work properly on a solderless breadboard even if it is plugged directly into it.

Leon
By Philba
#21051
I know nothing about the specific accelerometer but a simple low pass filter with a super low cutoff should help a lot.

I agree with leon's points but there are things you can do such as shielding the cable, bypass caps and so on. I've had similar chips in SBBs and, while noisier than I would like, it was enough to get a prototype working to the point where I had confidence the circuit was good enough to commit to FR4.

Of course, there is no substitute for a decent PCB with proper layout and ground plane.
By Flatland2D
#21089
I added a low pass filter today with a 3dB of a few Hz. It seemed to help a fair amount, but there is still a good deal of noise. After hooking up the LPF, removing the 8" wires had a greater impact on performance than before. Maybe averaging will smooth it out some more. Any idea if a simple RC filter will work here? I'd like to save some board space.

I also tested out a gyro today (IDG300) and it is pretty rock solid without any external filtering. They do have a built in LPF already though.

If you haven't guessed it, I'm working on creating an IMU. This will be going into a UAV. This is a group project for a senior design course.
By Philba
#21092
The SBB is probably giving you problems. That reminds me, I've had luck grounding adjacent unused rails. Ungrounded rails will capacitively couple. what's the noise down to now?
User avatar
By leon_heller
#21094
Flatland2D wrote:I added a low pass filter today with a 3dB of a few Hz. It seemed to help a fair amount, but there is still a good deal of noise. After hooking up the LPF, removing the 8" wires had a greater impact on performance than before. Maybe averaging will smooth it out some more. Any idea if a simple RC filter will work here? I'd like to save some board space.

I also tested out a gyro today (IDG300) and it is pretty rock solid without any external filtering. They do have a built in LPF already though.

If you haven't guessed it, I'm working on creating an IMU. This will be going into a UAV. This is a group project for a senior design course.
Just put it on a PCB, as I've suggested. SBBs are a waste of time for that sort of application.

Leon
By Flatland2D
#21122
leon_heller wrote: Just put it on a PCB, as I've suggested. SBBs are a waste of time for that sort of application.
Will do. I've already entered the design into PSPICE and will be converting it over to Orcad Layout to make a demo board for testing our stability system (gyros, accelerometers, filters, microcontroller, servo controller, LCD). We will hopefully have the board made next week. Our school just got a new circuit board maker. I'm not sure the name of it, but it cuts out the traces like a CNC router.