element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Cypress Kits
  • Products
  • Dev Tools
  • Cypress Kits
  • More
  • Cancel
Cypress Kits
Forum PSoC 4 Pioneer Kit Community Project#056 – Accelerometer Level
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Cypress Kits to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 25 subscribers
  • Views 861 views
  • Users 0 members are here
Related

PSoC 4 Pioneer Kit Community Project#056 – Accelerometer Level

cy.wbz
cy.wbz over 12 years ago

Hello!

 

Today’s example builds on our earlier accelerometer example. Here we are using a three axis accelerometer as a digital level. The level reads the X, Y, and Z acceleration to determine the orientation.

Hardware used:

  • CY8CKIT-042 Pioneer Kit
  • 3-Axis Accelerometer

 

image

 

Forum Post Attachments:

 

At the bottom of this post we are including the following items:

  • Example Project Zip File
  • Zip File of Images
    • Project Schematic
    • Component Configurations

 

Components Used:

 

The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

  • PWM
  • UART
  • I2C
  • CyClock
  • CyPin

 

The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.

 

Firmware Description:

 

The main.c firmware is included in the example project. Please review the commented sections for more details.

 

In this example we are implementing a level using a three axis I2C accelerometer. The firmware reads X, Y, and Z acceleration, filters the values, and calculates orientation relative to horizontal and 45 degrees. The project then sets the color of the RGB LEDs based on how close the orientation is to ideal. The project also prints out a raw acceleration value to the UART which can be used to display on a hyperterminal software or the Bridge Control Panel.

 

In this example we use the interrupt output of the accelerometer to prompt communication. It also detects when the configuration of the sensor is lost, and reconfigures it. This can happen when the device is power cycled during operation.

 


image

 

Hardware Connections:

 

For this example plug the Sparkfun three axis accelerometer breakout board into the J3 header, pins 1-6. You may need to solder wires or a header to the accelerometer. In our example we connected the accelerometer to a six pin cable. This allowed us to move the accelerometer around while holding the pioneer kit in our other hand. Please be careful of the orientation of the ribbon cable, if you reverse the polarity on the accelerometer you may cause damage to the device.

 

Test Your Project:

 

Connect your hardware and program the kit. Take the accelerometer and set it on a flat surface. Notice the LED begin to change color and then glow a bright green when on a level surface.

 


image

 

I hope this example can help you in your design.

 

Best,

Matt

Attachments:
KIT042_Accelerometer_Level.cyprj.Archive01.zip
8551.Project Images.zip
  • Sign in to reply
  • Cancel
Parents
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Another good project. Shows one of the many applications which use accelerometers. other applications can be:

     

    • eCompass applications

    • Static orientation detection (Portrait / Landscape, Up / Down, Left / Right, Back /

    Front position identification)

    • Notebook, eReader and Laptop Tumble and Freefall Detection

    • Real-time orientation detection (virtual reality and gaming 3D user position feedback)

    • Real-time activity analysis (pedometer step counting, freefall drop detection for HDD, dead-reckoning GPS backup)

    • Motion detection for portable product power saving (Auto-SLEEP and Auto-WAKE for cell phone, PDA, GPS, gaming)

    • Shock and vibration monitoring (mechatronic compensation, shipping and warranty usage logging)

    • User interface (menu scrolling by orientation change, tap detection for button replacement).

    Regards,

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • jesusantoniocar
    jesusantoniocar over 12 years ago

    Hello Matt.

    Another good project. Shows one of the many applications which use accelerometers. other applications can be:

     

    • eCompass applications

    • Static orientation detection (Portrait / Landscape, Up / Down, Left / Right, Back /

    Front position identification)

    • Notebook, eReader and Laptop Tumble and Freefall Detection

    • Real-time orientation detection (virtual reality and gaming 3D user position feedback)

    • Real-time activity analysis (pedometer step counting, freefall drop detection for HDD, dead-reckoning GPS backup)

    • Motion detection for portable product power saving (Auto-SLEEP and Auto-WAKE for cell phone, PDA, GPS, gaming)

    • Shock and vibration monitoring (mechatronic compensation, shipping and warranty usage logging)

    • User interface (menu scrolling by orientation change, tap detection for button replacement).

    Regards,

     

    Jesus Antonio.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube