Accelerometers

Does any one know of any future plans for VEX to make an accelerometer? I think we could use one of these in many ways. Also, does any one have any experience with the accelerometer found here:http://www.parallax.com/Store/Sensors/AccelerationTilt/tabid/172/CategoryID/47/List/0/Level/a/ProductID/97/Default.aspx?SortField=ProductName%2cProductName And if this has 5 male pins how could you mod it so it could work with the VEX microcontroller?

The Parallax (Hitachi H48C) requires the SPI or I2C interface and would be difficult to interface to the Vex Controller directly. Even thought the Microchip the PIC18F8750 is capable of using the on-chip SPI and I2C peripherals, they are reserved for inter-processor communication between the Master and Slave PICs that make up the Vex Controller. The Microchip PIC18 C Peripheral library does provide functions that emulate the I2C and SPI hardware, but they require PIC18 C to access the functions so that you can communicate with the Hitachi H48C.Another problem is the 3.3 Volt power supply which is needed to power the accelerometer.

There are other accelerometers from Freescale the MMA6260Q X-Y axis accelerometer and the MMA1260D Z axis accelerometer modules, and Analog devices ADXL330 Small, Low Power, 3-Axis ±3g iMEMS® Accelerometer that can be connected to the Vex Controller’s analog input ports directly, although they also need a 3.3 Volt power supply.

So basically this one does not work?. And the one you suggested from Freescale needs some voltage power. Does any one know any accelerometers that need no extra wiring or anything and can just be plugged right into the VEX microcontroller, plug and play do they call it?

Freescale offers a SARD XYZ accelerometer board that can be connected to the Vex Controllers serial port (USART) powered by a standard 9 Volt battery.
Here are some links that provide information relating to the SARD board:

http://www.jandspromotions.com/philips2005/Winners/Abstracts/AR1660_abstract.pdf

Vex is always expanding their collection of parts, I would expect them to release more advanced inputs and outputs over time, but probably not untill the establish themselves seperately from FIRST. that’s my guess.

Here is a photo one of my Vex applications that uses the Freescale SARD Board (XYZ accelerometer):

https://vexforum.com/gallery/showimage.php?i=1102&catid=member&imageuser=392

Don’t get me wrong that looks cool but that also looks like a lot of wires and very advanced. I am at the most basic level. I was looking around for a “simple” accelerometer and I found the lego one. This has an RJ12 cable coming out of it. Couldn’t you just plug this into the serial, Rx1 or Rx2 ports, the ports and the cable look the same?

The SARD can communicate with a Freescale EVB Board (Zigbee Wireless UART) that has a DB9 Serial RS-232 connector, which can be connected to the Vex Controller. It does get a bit expensive purchasing two boards for XYZ accelerometer. I made my own DIY XYZ accelerometer (Virtual SARD) that connects directly to a micro-controller’s analog inputs (ADC).

I made my own DIY XYZ accelerometer (Virtual SARD) that connects directly to a micro-controller’s analog inputs (ADC).

Do you have pictures of this??!!

Do you have pictures of this??!!

Yes, and I also have the schematics for the Virtual SARD and the 3.4V/5 Volt power supply that you can use to make your own boards. Freescale has a new combined XYZ accelerometer IC that makes it easier to use but I have not tried it out yet.

I also designed and built a DIY Sensor Controller that can interface up to 16 analog sensors including XYZ accelerometers, temperature sensors, pressure sensors, humidity sensors, TI Light Sensors, photocells, Hall Effect Sensors (magnetic), e-field sensors and many more.

The information is in my Driver Alert Contest entry that I entered for Circuit Cellar and won the Distinctive Excellence award. You can view it using the link provided below:

http://www.jandspromotions.com/philips2005/Winners/AR1660.htm

Good job on your award and that is a nice accelerometer project. I decided that there seems to be no accelerometer out there that can be directly plugged into the microcontroller. If you want to use an accelerometer you need a lot of extra parts, and you have to know what your doing, both of which I dont have.

And back to my old question, does any one think that the lego accelerometer could work with the microcontroller, by being plugged into the rx1 or rx 2 port?

You have identified a valid Vex need for more advanced Plug and Play Sensors that other vendors such as Parallax and Lego RCX provide. In answer to your original question, I looked into the Lego RCX Accelerometer and found that it communicates with the RCX via the synchronous I2C serial interface, which is not the same as the asynchronous USART Tx/Rx interface used on the Vex Controller. If you are using Easy C 2.x it is possible to bit-bang the I2C interface used on the Lego RCX or even the SPI interface used on the Parallax Accelerometer, although I don’t have a copy of Easy C 2.x to try it out.

Another alternative for the Vex Controller is to use the PIC18 C and MPLAB, which is a bit more difficult, but the advantage is that the PIC18 C Peripheral Libraries provide a software version (bit-bang) of both the I2C and SPI interfaces. It realy is too bad that the Vex Controller does not bring out the I2C and SPI hardware peripheral interface pins from the Master PIC18F8750 micro-controller.

If you have a Parallax STAMP BS2 or BSX and your sensor update rates are relatively slow, you could just use it as a co-processor and connect the Parallax XYZ accelerometer to the STAMP and then tie the STAMP’s serial port Rx to the Vex’s serial port Tx and the STAMP Tx into the Vex Rx using the STAMP’s Shiftin and Shiftout and Serin and Serout instructions to format the data for the Vex Controller. The STAMP can also be found used on ebay to save money. In fact if you purchase the STAMP BSP, it also provides the I2C interface that would allow you to connect the Lego RCX Accelerometer.

The final alternative that I can suggest is to make your own one or two or three axis accelerometer using the Freescale or Analog Devices SMT chips and provide the necessary +3.3 Volt or +5 Volt power supply. This is not as difficult as it sounds, if you have some soldering experience, you may want to look into the SchmartBoard SMT board adapters (www.SchmartBoard.com) and kits, which are being used in High School and Colleges for electronics classes. They even provide a +3.3 volt kit. You can see some of my SchmartBoard SMT based projects including a Sensor Controller that I plan to use with Vex Robots.

http://www.schmartdeveloper.org/tiki-browse_gallery.php?galleryId=5

Yeah I wish VEX had some way of being able to hook up parts made by other companies to the microcontroller. And although you had good ideas, it is to complex for me. I guess I am not using an accelerometer in the near future. You could use one in so many ways though. What i was going to use one for is to make like a mechanical labrynthspel. Where the little nobs are, you could have motors. And then you could put the accelerometer on a 25x5 plate. And you could tilt this to try to navigate the marble through the maze.

Labrynthspel:http://www.ts.mah.se/utbild/tdtby/Examensarbeten-2002-DB99/Image2.jpg

That would be really interesting.

Interesting in a good way? Although it might seem stupid, I think it would work well and be pretty fun. Obviously it wouldn’t be made of wood, except for maybe the top, maze surface. It couldn’t be that hard to make either. The hardest part would be programming the accelerometer.

I think your wooden animatronic labrynthspel application is very unique and a great idea! I am sure IFI will develop and sell advanced sensors such as accelerometers, temperature sensors and pressure sensors that are a “must” for robotics and new applications such as yours so don’t give up on accelerometer based applications. Old arcade games that had a tilt sensor could be updated with this technology using the Vex Controller, motors and servos to bring them back or restore antique versions.

As for programming the accelerometer, it can be done “graphically” using Easy C 2.x and treated as any other analog sensor such as the Vex Line Following Sensor. I am sure that it will not be too complicated to program. It is only hard right now since accelerometers designed to work with Vex are not yet available.

My Driver Alert System measures the tilt of the driver’s head to make sure he/she is not falling asleep at the wheel or is not paying attention to the road (looking at the scenery instead). Do you happen to have Easy C 2.x and the Vex Programming Kit?

Yeah I have both of these. And although I have done some programming I am still pretty bad and have done nothing complex. Would you use the analog input block to program it? That doesn’t seem to hard, just say what portm and sign it to a variable?. But what would the variable be, would it be an int.?

Yes, although I don’t have Easy C 2.x, I know that the Vex Controller analog block uses the ADC peripheral that can be utilized to digitize the voltages read from the X, Y and Z channels of the analog version of the accelerometer. This is much easier to do than using the Parallax or Lego RCX version since all you need is a 3.3 Volt power supply and a prototype analog xyz accelerometer, instead of dealing with the more complicated I2C and SPI interfaces that are not currently supported by Vex. At most you would need to connect the following wires to the Vex Controller and power supply: +3 Volts (Vcc), Ground (Vss), X Channel, Y Channel and Z Channel.

So it sounds like if you are good are programming and you just plug certain cables into certain ports then you would be able to use an accelerometer? Do you know the cable and port lay out for any accelerometers to work with the VEX microcontroller?

It will vary from product to product, but if you start with this accelerometer, then the hookup is pretty straight forward.

Use two Vex extender cables, one labeled “X” and one “Y”. Wire the board up to the cables as follows:

[LIST]
*]VDD goes to one red wire (doesn’t matter which; insulate the unused red wire)
*]GND goes to both black wires
*]X goes to the white wire of the X cable
*]Y goes to the white wire of the Y cable
*]Z is unconnected
*]ST is unconnected
[/LIST]

Read the analog ports you’ve plugged the X and Y cables into. You should get a value around 512 when at rest. If I’ve done my math right, that number will change by about 64 per G (+/-).

Sparkfun has several other boards available on this page. They come in varying sensitivities, and 2 or 3 axis models. Watch out, though: some of them cannot be powered safely by the Vex analog ports. Only hookup sensors that can run on 5V, or add a suitable voltage regulator to drop the voltage to a safe level for the sensor you’ve chosen.

Note: I haven’t actually tried this out myself (yet), so there are no warranties expressed or implied…

Cheers,

  • Dean