Shop OBEX P1 Docs P2 Docs Learn Events
accelerometer and gyroscope — Parallax Forums

accelerometer and gyroscope

trannhtrannh Posts: 24
edited 2010-04-18 01:59 in Learn with BlocklyProp
Hi,

I am a biomedical engineering student and I am doing a project on using an accelerometer and a gyroscope to measure acceleration of the foot (x/y axis) and rotational velocity of the foot. I was wondering if anybody could give me an idea on how I can make these sensors output the necessary data. I'm having a hard time finding a way to incorporate an accelerometer and gyroscope onto a shoe. How can I allow the sensors to output digitally onto a computer? I am using the accelerometer and gyroscope modules right from Parallax. Any help would be greatly appreciated. I just need something to help me get going. Thank you.
«1

Comments

  • bill190bill190 Posts: 769
    edited 2010-04-05 22:27
    Perhaps a couple of Velcro straps around the shoe and another around the back of the shoe ankle to hold on just the sensors. (Side of shoe?)

    Then run wires from the sensors up to a belt which would hold a microcontroller and a transmitter to transmit the information to another microcontroller and then to the PC?

    Communications...
    http://www.parallax.com/Store/Accessories/CommunicationRF/tabid/161/CategoryID/36/List/0/Level/a/Default.aspx?SortField=ProductName,ProductName
  • achilles03achilles03 Posts: 247
    edited 2010-04-06 15:15
    You probably want a relatively fast sample rate (say 50Hz or more) if you really want to get some good data (impacts, etc). The best way to do this would probably be to hook the sensors up to an ADC, read them with the stamp, and write them to an EEPROM (or flash card if you want to go for hours of data). With a 64k eeprom, you can get at least 5 minutes of data at 50Hz.

    Then, when you're done sampling, debug the eeprom data to the stamp software, which you can copy directly into EXCEL, Matlab, etc...

    Hope that helps,
    Dave

    P.S. If you can, low-pass filter your sensors prior to the ADC input... accelerometers and MEMS gyros can be a little noisy. Also put a cap across the sensor's power supply and ground, as well as at the ADC reference voltage and ground. It'll help you get smoother, less noisy data.
  • trannhtrannh Posts: 24
    edited 2010-04-06 19:04
    Achilles03: Thanks for the help. I'm kind of hazy on my signal processing material. For the ADC, would using a microcontroller work, since most have one? Also, I'm confused about reading them with the stamp and writing them to an EEPROM. Also, how do you debug the eeprom data? As for the LPF, that's a good idea since I know that the sensors will generate a lot of noise. How do I use that though prior to the ADC input?


    bill190: That's a good idea. I had a similar idea. Would the Velcro straps be strong enough to hold the system together? I plan on putting the sensors on the side of the shoe since that would allow for the best data collection. Also, how would the straps connect to the sensors?
  • achilles03achilles03 Posts: 247
    edited 2010-04-06 19:19
    Hm, sounds like you haven't used an ADC or eeprom before. I'd recommend buying some from here or digikey and hooking it up and tinkering until you've figured it out. That's basically how most people here learned. It's really not hard if you use the documentation on this site.

    Some microcontrollers have on-board ADCs, but the stamp doesn't, so you need to add it if you use a stamp. I'd recommend at least a 10-bit ADC depending on your sensor sensitivity. If you get one with 4 channels, you'll only need 1 chip.

    As far as your program goes, basically it would go something like this:

    Wait for start event (like a button push)
    LOOP:
    read ADC value for accelerometer X-dir
    read ADC value for accelerometer Y-dir
    read ADC value for gyro
    write values to EEPROM (<4 bytes if you're using a 10-bit ADC)
    if address is >65530 then end
    increment address
    pause X milliseconds
    goto LOOP
    end

    To debug, upload a new program that'll read the data off the EEPROM 4 bytes at a time and debug it to the computer screen.

    Hope that helps,
    Dave
  • bill190bill190 Posts: 769
    edited 2010-04-07 00:29
    As to the sensors on the sides of the shoes, how they are mounted would depend on how firmly attached to the shoe you needed them to be.

    Just using velcro would have a bit of "wobble" to it I would imagine.

    More firmly attached would be to screw or glue the sensors to the shoe, but then you would need different shoes for each person.

    If it is just for one person, then maybe get a pair of shoes for just this and glue/screw/bolt or whatever - the sensors onto the shoes.

    There is a learning curve to this "fastening" business! Probably the best thing to do would be to take the shoes and sensors to a small local hardware store. Then look for the old guy there. Show him what you want to do, then I would bet he would have some ideas.
  • SRLMSRLM Posts: 5,045
    edited 2010-04-07 15:37
    The sensors themselves are fairly light, so it doesn't take much to attach them. Then you just run wires from the sensors to the uC. You can always put the uC on an ankle bracelet or belt pouch.

    Also note that the accelerometers and gyroscope sold by parallax do not require an external ADC. The modules have all the analog circuitry incorporated on the board itself, so you just need to use serial communication to get the data. As always, look on the product page for sample code. All the Parallax products come with sample code for the BS2 that demonstrates how the sensor can be used.

    You may also want to consider a faster BS2 such as the BS2px, or consider the Propeller as a microcontroller. I don't think the stock BS2 would have enough memory or speed to give you useful data in a project such as this. Also, you may want to consider streaming the data (either wirelessly or through a cable) to your computer, and log it there. The advantage is that you can see the data in real time, you don't have to recover it, and you can have a computer program parse the data on the fly. Plus, it gives you immediate feedback on if it's working or not. Of course, it may not be suitable for your application/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-07 20:16
    I plan on attaching the circuit board to the back of the foot, just under the ankle. I feel like that would be the best place to get data for acceleration as well as rotational velocity. Also, does anybody think that a gyroscope is unnecessary? Does the accelerometer allow me to get rotational velocity of the foot during walking?

    Also, can the board hold all the necessary components: the two sensors, the microcontroller, and the transmitter (if used), as well as the 9V battery? Should I use multiple boards or would that be too cumbersome or big for proper placement on the heel?

    I feel like directly connecting the board to the computer using a cable would be best for my project. Also, what exactly is the order of "construction"? I would like to keep everything on one board that can be mounted on the back of the foot. So the sensors would have to be sodered to the board, along with the microcontroller?

    Does anybody think using the following microcontroller would work:
    https://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/CategoryID/9/List/0/SortField/0/Level/a/ProductID/9/Default.aspx
    (does it already have an ADC?)

    I want to thank everybody for helping me out and giving me their input. Thank you.
  • SRLMSRLM Posts: 5,045
    edited 2010-04-07 20:35
    If you're using parallax sensors, then you won't need an ADC regardless of what microcontroller you use. The sensors have the ADC built in.

    The BS2sx might work, but it would depend on how fast you want to sample. If you just want slow motion then 10Hz (my estimate with the sx) would be okay. Otherwise, I'd go with the BS2px. It can send serial data faster, which is a big boost in your throughput. Of course, if you're comfortable with programming then the Propeller would work as well, although the initial learning curve IMHO is steeper.

    As for the design, unless you are making your own custom PCB (board) you may want to consider separating the sensors and the other things (microcontroller and power supply, namely). The more mass that you attach to the sensors, the more likely it is that it will cause bad measurements as the foot accelerates.

    Accelerometers can be used for either rotation or linear acceleration, but not both at the same time. If you want both datasets then you need a gyroscope. Note also that if you want full three dimensional motion than you need three axes of acceleration data and three axes of gyro data. Theres lots more information on this subject floating around on the internet that you can find.

    To go any further, we need to know more about your project, including the type of motion, it's speed, and the application.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-07 20:51
    So how would I make the connections then? Should I use the BASIC Stamp 2 carrier board? So I would connect the microcontroller to the board, along with the sensors, and the battery can connect to it as well. Can that board connect to a computer?

    For my project I want the accelerometer to give me data along 2 axes, to see acceleration upward and forward during walking. I want the gyroscope to measure the rotational velocity of the ankle as you lift your foot up during walking. I was told that using sampling at 50 Hz or more would be sufficient for this. I only want to record data for 5-10 ft of walking or about 5 seconds of recording. What do you recommend I get in regards to the board, microcontroller, or any connections needed? Also, where do I get the program needed to read the data from the sensors?
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2010-04-07 23:29
    Hi Trannh,

    There will be example code for both sensors at the bottom of their downloads pages. You will need to adapt the sample code to your application.

    For more in-depth programming and·datalogging applications for the·Memsic 2-axis Accelerometer with a BASIC Stamp, see Smart Sensors and Applications - the text and sample code are free downloads. For beginner BASIC Stamp programming, see What's a Microcontroller - it's also included as a PDF in the BASIC Stamp Editor Software.

    -Steph
  • SRLMSRLM Posts: 5,045
    edited 2010-04-07 23:48
    All the connections that you will need are documented in the various datasheets of the sensors that you use. You can always put longer wires in there to move the sensor further from the board, although there is a limit to how long. A couple of feet should probably be okay.

    The microcontroller will always need some sort of connection to the computer, if only to program it. I suggest that you start reading What's A Microcontroller, pdf available from the Parallax website. It will give you an introduction to PBASIC programming. You can use the sample code that is included with each of the sensors to give you a start, but you will have to program the application yourself. It isn't a particularly difficult program as far as these things go.

    To get the data from the microcontroller to the PC you have two options: wireless or wired. The wired option is easier, and may or may not be possible. I don't know, but what I would do is buy some USB extension cables that would go the entire distance that you expect to get the motion. It would probably be better if the cables were powered and shielded, but plain vanilla might work. You could also put the subject on a treadmill and then you wouldn't need an extension cable. Alternatively, you could use wireless. This is a bit more involved, but I would use the XBee modules and adapter boards from Parallax (one 3.3v to 5v board and 1 USB board). You'll have to reconfigure them to have a higher baud rate, since 9600 is just too slow. The reconfiguration is simple by using the free X-CTU software.

    As far as the board you'll probably want to go with something that is soldered, since that is more mechanically robust than a solderless breadboard (like the BOE). The carrier board family would work.

    Where to go from here? Amass knowledge about your materials: read all the datasheets, read "What's a Microcontroller", learn some basic electric circuits (what WAM provides is enough), and do some test programs and connections to make sure you know everything.

    On second thought, let's compute your data rate. Suppose that each axis is two bytes (1 word) of data, then you have 6 bytes of data for each cycle. Let's double the data magnitude for side effects and delays and whatnot, so that's 12 bytes per cycle. At your desired 50Hz, that 600 bytes of data per second. If you use a 9600 baud, then you can get 9600/8 bytes per second or 1200 bytes per second. Therefore, fully half the time will be spend just transmitting the data, which is far to slow to allow you to acquire it all.

    I'd go with the Propeller, since you won't have any trouble with low speed. If you really don't think that you're up to the programming, then a BS2px would be your best alternative. It can transmit at 19200, which would give you 25% time in transmission.


    And an hour and a dozen interruptions later I finish... Sorry for the randomness.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-08 00:25
    I believe that the BS2px would be best for me because of not only cost, but because of my lack of knowledge in programming. If I do go with the BS2px, what would be the best sampling rate? Also, what do you mean with the longer wires with the sensors and board? Doesn't the sensors go on the BS2 carrier board along with the microcontroller, which would then be mounted on the shoe?

    Also, where can I get the USB extension cables at?

    Lastly, all the connections have been made on the carrier board (the sensors as well as the microcontroller), and I have found the USB cables of the right length, how do I start programming and testing? I know that PBasic is used to program, but do I need to buy the software or does it come with something?
  • trannhtrannh Posts: 24
    edited 2010-04-08 00:55
    Would this extension cable work? http://www.circuitcity.com/applications/SearchTools/item-details.asp?EdpNo=4311583&CatId=444

    Also, for the BS2px, I'm using the accelerometer on 2 axes and only 1 for the gyroscope. Does that affect how much time is spent transmitting?

    Would you recommend using the BS2 carrier board or the HW Board?

    Post Edited (trannh) : 4/8/2010 2:36:11 AM GMT
  • SRLMSRLM Posts: 5,045
    edited 2010-04-08 21:03
    The BS2px could probably get (my estimation) 20Hz. I don't have any numbers to back that up, but just a WAG. You'd have to try it out to tell for sure, but I do think 20Hz would be achievable.

    As for the longer wires, I simple mean that components don't have to be located physically close to one another. In electric circuit theory, a wire is considered to have no resistance so you can move things indefinately far from one another with no effect. Of course the real world doesn't operate like that, but you can probably get a couple of feet. What this means is that you can mount your sensors at the end of a wire bundle (5 or 6 wires, probably) and have it located further away from the microcontroller board. It won't change anything as far as the code or sensing is concerned, because to the uC it's just like the sensors were right next door. All that I'm saying with this is that a whole board on the shoe might be a little clunky, so you can just put the sensors there and run wires to the board on the belt or something. I doubt that you could just put the board on the desk and run 15 feet of wire: that's probably too far for reliable operation.

    PBASIC is free. The environment (program) is available for download from Parallax. I suggest that you take a look at the WAM tutorial, it gives a complete introduction to getting started with the BS2. Note though that you'll need to get a USB to serial adapter from Parallax, unless your computer has a serial port.

    Yes, that extension cable would probably work.

    As for the data transmitted, the more sensors/axes that you have the more data that you transmit. If you add more sensors, you will clearly have more data to get to the destination (the computer), so it will spend more time transmitting and hence slow down how often it can collect data. Note also that you may be able to optimize your data transmission by packing together the bits of the value. My estimate was based on two bytes per DOF, but IIRC the sensors provide 10 bit resolution. This means that you can really get all three samples in 4 bytes of data if you shove them together. This is a little bit more complicated (not much), and isn't human readable, but it does reduce the amount of data transmitted by 1/3.

    The HW board is just a board with a BS2 permanently mounted to it. It also has a solderless breadboard, which wouldn't be mechanically strong for this sort of project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-08 23:35
    That is a good idea. But I'm not sure about a couple things. If I do that, what will the sensors be connected to? Do I soder the sensors on a smaller board? The attachment of the actual sensors to the shoe is a separate story. What I'm worried about is how the sensors will be connected on a board that will then be attached to the back of the shoe. In summary, I will have the two sensors attached to a smaller board? (which will actually attach to the shoe), then use a wire bundle to connect the sensors to the microcontroller/carrier board that is attached to the belt, which uses a USB to serial adapter, and attaches to the USB extension cable I showed you, which will connect to the USB port of the PC. Am I correct?

    Could I be able to have the whole board, with uC, sensors, and battery attached (compactly) to the back of the shoe and have the wires(wouldn't be more than 12 ft of wire) run directly to the computer? Would that be too far away where it would affect data collection?

    Thank you so much for taking time out of your day to help me. I appreciate everybody's help and don't hesitate to give add your input.

    Post Edited (trannh) : 4/8/2010 11:43:30 PM GMT
  • bill190bill190 Posts: 769
    edited 2010-04-09 04:15
    I'll tell you what, when·I walk, I walk with my feet pointing outwards. In other words, both feet are not "parallel". So when I look·down at my feet, they look like a V with the toes pointing outwards.

    Now I'm no expert in "footology", but I would think that some people walk with their feet pointing straight forward? And others different ways?

    So·if I was doing this kind of testing, I would want to be able to "adjust" each sensor so as to be able to record this if possible. Or be able to adjust each sensor to take these differences into account.

    And initially I would want to·do a bit of testing, then look at the data. Perhaps there would be a problem with the direction or placement of the sensors and this might need to be changed? Maybe adjusted a little this way or that way? Or maybe even placed in a different spot on the shoe for some reason?

    Might be best to temporarily place the sensors on the shoes with rubber bands, elastic straps, or whatever works for now, then later make it all one unit?

    (Actually when engineers change a design in something, it is called an Engineering Change Order. I just searched google.com for those words and found 38,000,000! So not uncommon to run into problems after something is designed.)
    ·
  • SRLMSRLM Posts: 5,045
    edited 2010-04-09 06:48
    You could use a cable like this to attach the sensors with: www.parallax.com/StoreSearchResults/tabid/768/txtSearch/servo/List/0/SortField/4/ProductID/610/Default.aspx

    It's your choice where you mount things, based on how you plan on doing your experiment. You don't need to mount the sensors on a mini board, but it might be a good idea just to make sure that they align correctly mechanically. Electrically it doesn't make a difference, although you may be able to reduce two wires from the number in the bundle if you go with a mini board. I like the idea of putting just the sensors on the shoe since that is the least intrusive to the natural movement of the foot, but that may not be an issue for you. You'll have to figure this part out. If you mount the whole board on there, you won't be able to get any smaller than the board and the battery although you might be able to mount the battery somewhere else. It's your choice where you place things.

    Otherwise, you've go the general flow of data correct: sensor -> microcontroller -> serial_to_USB -> computer.

    Note that the serial_to_USB step is transparent, and you don't have to do any special sort of code for that part.

    Like I said, I can't be absolutely sure that a 12 foot USB cable would work, since I've never tried it and it seems a bit far. However, I think with a proper powered cable it can. That's the best that I can offer.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-11 02:57
    bill190: That's a good idea. The only thing is that I'm only using 1 accelerometer and 1 gyroscope and I'm not sure if those sensors have the capability to do such a task. Also, my time is very limited for this project. My take on this is that if you walk differently than somebody else and that way of walking would change the acceleration/velocity values. As for the placement of the sensors, the rubber bands work. As for a stronger method of holding the sensors, what would you propose?


    SRLM: For the wire bundle, I would need something longer than 14 inches right? Since it would go from about the ankles to the hip. Also, I'm not sure about connecting that bundle to my sensors. It seems like a better idea to mount the sensors to a mini board or something like that because I feel like if I mount the sensors, carrier board w/ the uC to the back of the shoe, and have the wire connect to the PC, the wires may pull on the board, which would shift the sensors. That's why I want to know more about how to connect the wire bundle to the sensors and microcontroller. I'm just not sure how the 8-pin accelerometer would connect to the 3 pin extension cable you showed me, as well as how it connects to the microcontroller. Also, is there any stores (best buy, circuit city, radio shack) that would sell such a mini board or any cables or components that I may need so that I don't have to order online and have to wait?
  • SRLMSRLM Posts: 5,045
    edited 2010-04-11 04:20
    The cable was an example, not necessarily a final solution. You can get most of these sort of supplies (protoboard, wire, etc.) from Radioshack or some other electrical type store. We have Fry's here on the west coast, they have that sort of thing. You can use a breadboard like this www.radioshack.com/product/index.jsp?productId=2104052 to attach the sensors to, then run the wires up to the microcontroller board. You can use regular wire to connect the sensor daughter board to the motherboard, and it doesn't really matter if it's single or more conductor cable. You can just use more strands if it is single conductor. Also, don't go for heavy wire. Something around 24 or 26 gauge should work just fine.

    You may want to find an electrical engineering student to offer some help on building the board. Any EE worth his salt should be able to do it no sweat. Otherwise, you'll have to learn how to solder and get a general understanding of how to make a circuit. It's not that difficult, but it would take time and money. Oh, and before I forget: make sure you have access to a soldering iron, either one at your school or to buy one. Wire strippers are also nice, but not essential.

    To go any further, you really need to do some reading. Learn how circuits are built, figure out how it relates to the devices that you are going to use (read the datasheets!), and if possible try it out on a solderless breadboard first. We are dancing around the dilemma that you don't know much about circuits, which is fine, but it will take some learning or a friend on your part to finish the project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-12 20:38
    I have a soldering iron and have some experience circuits, but never something like this. All my boards were powered by a power supplied and I couldn't soder on the board either. One of the problems I have with soldering such sensors is the following: Once I solder the sensors to the mini breadboard, how do I connect the wires to the the correct pins of the sensor. Because the board that I've worked with, the rows were connected. So if I placed a resistor (not soldered, it was inserted), I could insert a wire in the pinhole right next to it and they would be connected. With the mini board and the carrier board I have, I'm not sure where the holes are connected. Also, if the accelerometer connect to the uC through 4 pins, then that means that 4 wires should go up to the uC, am I correct? Otherwise, the breadboard you recommended seems perfect. It's small enough not to get in the way and the wires running up to the carrier board on the belt will be long enough that they won't pull on the sensors. So I just have to solder the sensors to the mini board, run the wires to the uC, power the carrier board with a 9V battery, connect the system to a PC and start programming with PBASIC, which I can get online. But you say that What's a Microcontroller is a good source for beginners and can help me build this circuit as well as programming, right?
  • SRLMSRLM Posts: 5,045
    edited 2010-04-13 21:40
    1) There's nothing stopping you from making your own connections on the board. Just run a piece of wire (or a scrap of some sort) between the two pins that you want to connect, and solder it in. If you search, there's a thread in this forum about that exact topic.
    2) The most reliable method to tell which holes are connected is to use an Ohm meter. 0 ohms = connected
    3) You should have a wire for each signal, and two wires for power (+ and -).
    4) Yes, do read WAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-14 00:38
    Another question I have is if it's ok to put some type of tape on the back the back of mini boards or carrier boards. I have a possible idea for mounting the sensors to the shoes. I have a garage door opener that has a holder that could attach to the shoe. It's similar to a pager back, where you can slip it on. My plan is to stick the back of the mini board to that holder and then slip it on the back of the shoe. How could I make that possible? I also want to do something similar for the carrier board that will be attached to a belt. If I could stick something to the back of the board, I could use Velcro so just stick the carrier board to the belt. How can I do this?
  • SRLMSRLM Posts: 5,045
    edited 2010-04-14 03:15
    You can put things on the back of the board, as long as there isn't any metal there (more technically, any conducting metal shouldn't make a short). You can use things like velcro, hot glue, plastics, string, tape, etc. all that you want. You could even drill some holes in the board and in your mounting box, and use screws to hold it in. If you do that, make sure that a) you don't drill through any of the traces (conductors) on the board, and b) you don't connect the bolts in any way to something electrical.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-14 14:36
    I have another concern regarding connections. Once I buy the mini board, and I soder the sensors to them, how to I connect one of the sensor's pin to a wire that will run up to the uC. I know that I can connect any 2 holes with a wire, but if the sensor fits in 8 holes, and I want to connect, let's say pin 4, to the uC, where to I solder the wire on the mini board? Do I soder it to the same hole through which the sensor's pin went through? Would I soder 2 things to the same hole (the sensor's pin and the wire)? I am also using the BS 2 carrier board. Next to the slot for the uC, there are pins, sticking out. What are those for?

    If I plan on soldering the parts at my house, do I need to ground something when soldering the sensors to the mini board and the wires to the carrier board? Because I remember something about damaging the components if not grounded. How do I do that if I was to solder at home or even a lab?

    I just bought 22 gauge hookup wires to connect the mini board to the carrier board. Is this ok?

    Post Edited (trannh) : 4/14/2010 5:58:50 PM GMT
  • SRLMSRLM Posts: 5,045
    edited 2010-04-15 01:43
    I suggest that you find somebody at your school who's proficient in soldering, and bring all your stuff to him to go over all your questions. Most of the answers are simple to show, difficult to write. Plus he can point out any mistakes that you may have.

    1)See my answer #1 two posts ago. You put the pin and the wire through adjacent holes and make some sort of electrical connection between them. Generally you don't put two things through the same hole.
    2)The pins on the board are labeled. A note here: I'd use the super carrier board, but if you go with the regular carrier board you'll have to be careful about how much current you draw. Take a look at the datasheet (available online) for the BS2 module you're using and see how much current it's onboard regular can source (in units of mA). The add up the three current drains that you have (the BS2, the accelerometer and the gyro) and make sure that the sum total doesn't surpass the regular capacity. If it does then you'll have to add a regulator or upgrade to the super carrier board.
    3)You don't need to do any grounding when soldering. Just make sure that there isn't any power connected to the circuit. Don't touch anything when you're charged with static electricity.
    4)22 is fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-15 02:19
    I don't quite understand. I was looking at the datasheet for the sensors. How much does each drain?

    Gyroscope:
    Power requirements: 3.4 VDC to 6.5 VDC (5 VDC recommended) @ 5.25mA

    Accelerometer:
    Power requirements: 2.5 – 5.5 VDC;
    26 µA standby, 0.5 – 3 mA active

    uC:
    Current Draw @ 5 VDC: 55mA Run, 450 μA Sleep
    Source/Sink Current per I/O: 30 mA / 30 mA
    Source/Sink Current per unit: 60 mA / 60 mA per 8 I/O pins

    The datasheet for the BS2 px uC says that all the I/O pins should not exceed 75 mA. From the data I provided, I am over? If I am, where do I get an external regulator and how to I connect it?
  • SRLMSRLM Posts: 5,045
    edited 2010-04-15 13:55
    Gyroscope - 5.25 mA
    Accelerometer - 3 mA
    microcontroller - 55 mA

    total comsumption - 63.25 mA

    From that, you'll probably want to add in again some extra mA just to have a margin of safety.

    You still don't have the amount of current that can be provided. Look for something tied to "onboard regulator" or something like that. The amount of current that can be sourced per IO pin is different. That's important if you're powering an LED or speaker from the IO pin, but you're not doing that. Everything is powered from the 5V rail in your case.

    Anyway, my guess is that you'll be fine by using the onboard regulators (*I'm not absolutely sure though). The regulator is certainly enough to power the BS2 itself, and an additional 8.25 mA isn't that much.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-15 14:16
    So if the total consumption is 63.25 mA, then I should be able to run everything right? You said that I don't have the amount of current that can be provided. What does that mean? Does this only relate to if I'm using LEDs or speakers?
  • SRLMSRLM Posts: 5,045
    edited 2010-04-15 15:25
    Hmmm. I guess there isn't any documentation from Parallax on the onboard regulator, at least not any that I could find. From the schematic of the BS2px, the regulator is a LT1121. A google search turned up it's datasheet (cds.linear.com/docs/Datasheet/1121ff.pdf) and it lists the output current capacity at 150 mA. You should be fine using the onboard regulator as long as you're only using the BS2px, the accelerometer, and the gyro.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • trannhtrannh Posts: 24
    edited 2010-04-15 16:53
    Yes, I'm only using the BS2px, the accelerometer and the gyro. Thank you so much for all the help. I'm sure I'll have more questions, especially with the programming. I read some of the WAM document and I'm really confused with some of the programming. So I'm not sure how everything will turn out once I've soldered and assembled all the parts and begin to connect to the PC for programming.
Sign In or Register to comment.