Blog Post

Magic-Wand on Raspi-Proto with Optional Direction Sensing

Magic-Wand on Raspi-Proto with Optional Direction Sensing

4458

MagicWandKitw400

Parts

 

All part numbers are from part manufacturers.

 

Magic Wand

 

  • 1 – Pi Prototyping kit for B or B+
    • 1 - Pi Prototyping board
    • 1 - 13x2 female header (GPIO)
    • 2 - 29x1 female header
  • 1 - PCF8574 chip (PCF8574AN)
  • 1 - 10uf capacitor (UFG1H100MDM)
  • 2 - 82K resistors (82K-RC)
  • 8 - 4mm flt top red diff LEDs (HLMPM201)

 

Accelerometer/Magnetometer (optional for sensing direction)

 

  • 1 - LSM303 breakout board
  • 1 - 4x1 female header

 

Schematic

 

schematic

 

Connections

 

 

  • Solder the PCF8574 chip on the SO-8 footprint.
  • Place your LEDs in a straight vertical line so that they are easily seen.
  • Wire your components to coincide with the schematic.
  • If using direction sensing with LSM303 breakout board
    • Solder the 4x1 female header to the I2C holes marked on the Raspi-Proto board.
    • Insert the LSM303 breakout board into the4x1 female header. Be sure to match the pins appropriately. 

 

Programming

 

If directional sensing is not desired, you must remove the code handling the accelerometer or magnetometer readings and modify remaining code. 

Download program using accelerometer here.

Download program using magnetometer here.

Make sure you have:

  • If sensing direction
    • install the OpenElectrons_LSM303 library from pypi.
    • setup i2c on your Raspberry Pi.
  • Set the string you wish to display equal to str.
    • eg. str = “your string here”
  • Run the program on the RaspberryPi

 

Running Magic-Wand with Accelerometer

 

  • Default program will only light the leds when acceleration is negative or Magic-Wand is moving from left to right.
  • If your letters are too long/short or seem out of place, change the sleep times inside the loop.  

 

Running Magic-Wand with Magnetometer

 

  • The magnetometer reads the magnetic field of the Earth along the x, y, and z axes. The values will differ depending on location.
    • It is a good idea to print the variables and check the values for X to make sure the message will display in correct direction and place.
  • If your letters are too long/short or seem out of place, change the sleep times inside the loop.

 

Image created with magic-wand

Comments (0)

No comments at this moment
Please Login to add your comments

Featured Posts

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the...

Read more

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the...

Read more

Poll

  • What do you use to program your FRC Robot?
    Total: