This is the ad XL. 335 accelerometer got this on eBay for about two dollars: twenty five cents, including shipping. This is an awesome, little mini board, and so we connected this up to the Arduino. We have our dupont style connectors here and on the arduino we’re, bringing the x y and z analog values into a 5 a 4 and a 3 respectively we’re getting 3.3 volt VCC input we’re, also bridging that, over to the a ref, the analog reference pin on The Arduino, because this accelerometer outputs its analog values using 3.3 volts, and so we want to make sure that the Arduino references them at 3.3 instead of 5 volts and that’s. Why we use the a ref pin. I wired the Arduino using the instructions in this instructable and I will link this in the video details in the description. The only difference is in this instructable. The author says that you can use a 5 volt VCC input on the a DXL 335, because that chip has a regulator, and I could not find the regulator on mine and the datasheet does not say that it can accept a 5 volt input. In fact, the datasheet tells us that it will accept between a 1.8 and a 3.6 volt input, so that is why I used the 3.3 volt out from the Arduino and simply bridged that over to the analog reference, so I wired up the Arduino. I ran my code and so let’s take a look at the code itself, so here’s our Arduino code, very, very simple.
Here, we’re defining the X, pin Y pin and Z, pin again that’s a 5 a 4 and a 3 and then we’re setting the serial output with a 9600 baud connection and we’re simply looping and reading those analog values. So, here, I’m printing to the serial port and I’m reading from the analog X, pin and then you’ll notice, here: I’m subtracting 507, I’m reading from Y and subtracting 512, so what’s 507. 512. 615. When I first did this, I set the a DXL 335 flat on a breadboard on the table to try to find it’s at rest values there. There are probably many better ways to do this. This was my sort of quick way to do it. To get some code up and running, and these were the at rest – values that consistently I found so here. We here here, we’re outputting, this data to serial notice that I’m printing a tab character in between each of these values and that’s, so that at some point I could read this in to excel or to some other application to do. Some logging and some analysis of the data so to that end I didn’t want to just use the built in arduino serial monitor. I wanted to output this directly to the terminal, which would give me some more options. So I looked that up and here on the Arduino playground. They have some information on doing this. You can use the stty command line function on mac and linux, to tell your computer for this serial port and this isn’t, the one that I’m using.
We want to communicate at this bod rate and then you can do things like cat the input from that serial port directly to standard out now. So what does that mean? Well let’s, open up our terminal here. First, like I said, we’re going to run this stty command to tell it that on my Mac, dev slash Cu, USB modem 1411, that is my serial input for the Arduino and we’re, going to communicate at 9600. Baud so we’ll run that command and then – and this is what’s really cool – I can simply cat the input from that serial port directly to the terminal. So when I hit enter you’re going to start to see the numbers flow, this is my accelerometer data I’m, holding it as close to zero. As I can now watch what happens if I tap the accelerometer, you see that spike in the numbers.
adxl335 arduino Video
adxl335 arduino news
Posted on Wednesday July 06, 2016Prize Entry: Open Source FFT Spectrum Analyzer | Hackaday Hackaday … Continue Reading »
Posted on Friday June 24, 2016Taming Robot Arm Jump With Accelerometers Hackaday … Continue Reading »
Posted on Sunday August 16, 201516 | August | 2015 Hackaday … Continue Reading »
adxl335 arduino Social