Shop OBEX P1 Docs P2 Docs Learn Events
Orientation Demo using H48C and HM55B — Parallax Forums

Orientation Demo using H48C and HM55B

Travis_Travis_ Posts: 6
edited 2009-01-09 23:00 in Propeller 1
I'm a newbie to the microcontroller world and have struggled to get my PropStick USB communicating with the H48C Accelerometer and the HM55B Compass. I tried everything I could find on this forum to get it working and ended up using a little bit of everything I could find. Because this was my first project, I made sure to make it as comprehensive as possible. If you are new to the PropStick and are trying to establish communication with either the H48C or the HM55B, this code should help you.

I uploaded my work as 'Orientation Demo using H48C and HM55B' in OBEX (obex.parallax.com/objects/399/). I commented the code thoroughly including PIN diagrams, links to relevant documentation and links to the required software. I included a photo of the breadboard with the circuit and a photo of the Parallax Serial Terminal output.

I also attached the ZIP file with the code and the two photos to this posting.

Hopefully this saves you some time trying to get these sensors working. Enjoy!

Objects used:
  • H48C : "Sensor.H48C.Accelerometer" 'custom SPIN file located in source folder
  • HM55B : "Sensor.HM55B.Compass" 'custom SPIN file located in source folder
  • Debug : "FullDuplexSerial" 'standard from propeller library

Components needed:
  • Breadboard w/ connector wire set
  • 5-9V power supply (9v battery or 4 AA batteries)
  • PropStick USB
  • H48C Accelerometer
  • HM55B Compass
  • 3 LEDs
  • 1 270 Ohm resistor
  • 1 - LM2940 5 volt regulator
  • 1 - 1000uf capacitor

Software/Downloads needed:
Relevant Documentation:
Basic Build Instructions:
[noparse][[/noparse]LIST]
*1. Configure the components based on the PIN diagrams below. Use a breadboard for testing purposes.
*2. Download and install the required software (listed above).
*3. Open the Propeller Tool Software.
*4. From within the Propeller Tool Software, open this file (Orientation Demo using H48C and HM55B.spin).
*5. Connect the PropStick USB to the computer.
*6. Power on the PropStick USB with 5-9v.
*7. From within the Propeller Tool Software, hit F7 to confirm communication with PropStick USB.
*8. From within the Propeller Tool Softwere, hit F10 to compile and load program into the PropStick USB. Make sure this file (Orientation Demo using H48C and HM55B.spin) has the focus when you hit F10, otherwise the file with current focus is loaded onto the PropStick.
*9. Open the Parallax Serial Terminal.
*10. From within the Parallax Serial Terminal, make sure the COM Port is set to the COM port indicated when you hit F7 from the Propeller Tool Softwere and the Baud Rate is 19200 (unless you changed it in this file below).
*11. From within the Parallax Serial Terminal, click 'Enable' (which should be flashing anytime the PropStick USB is connected).
*12. Confirm the screen is output the readings from the sensors.
[noparse][[/noparse]/LIST]

Diagrams Included:
[noparse][[/noparse]LIST]
*Pin Diagram for PropStick USB
*Pin Diagram for HM55B
*Pin Diagram for H48C
*Pin Diagram for 5V Power Supply
[noparse][[/noparse]/LIST]

Post Edited (Travis_) : 1/9/2009 11:53:14 PM GMT
Sign In or Register to comment.