<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hades.mech.northwestern.edu//api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alex+Park</id>
	<title>Mech - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://hades.mech.northwestern.edu//api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alex+Park"/>
	<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php/Special:Contributions/Alex_Park"/>
	<updated>2026-04-26T11:04:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.9</generator>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12846</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12846"/>
		<updated>2009-03-20T06:09:39Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|thumb|right|Rotating display circuit (click for high-resolution version)]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|thumb|right|Control panel circuit (click for high-resolution version)]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== How to use the POV Display (a brief user&amp;#039;s manual) ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Basic Operation&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
In its most basic mode of operation, the display is quite simple to use: &lt;br /&gt;
*Plug the power cord into the wall.&lt;br /&gt;
*Turn on the battery pack on the rotating display platform.&lt;br /&gt;
*Unfold the control panel, and flip the power switch. &lt;br /&gt;
The display should spin up and the text &amp;quot;ME333 - Mechatronics&amp;quot; should be displayed. Try out the control panel knobs!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Connecting to a Computer&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s also possible to draw your own images for the display in real time using the PC software. Note that the program will on run on &amp;#039;&amp;#039;Windows&amp;#039;&amp;#039; machines. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installing the software:&lt;br /&gt;
*Download [[POV-PC.zip]] and save it in its own directory somewhere on your computer.&lt;br /&gt;
*Unzip POV-PC.zip with WinZip or some other unzipping tool.&lt;br /&gt;
*This will extract 3 files. The important one is POVController.exe. Running this will start the control program. You can run POVController.exe by navigating to the folder it&amp;#039;s in with Windows Explorer and double-clicking on the icon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Starting up POVController.exe:&lt;br /&gt;
*Plug the USB cable into the computer before running POVController.exe&lt;br /&gt;
*Find out the COM port number of the POV device: in Windows Device Manager, look under &amp;quot;Ports (COM &amp;amp; LPT)&amp;quot; and you should see &amp;quot;USB Serial Port (COM#),&amp;quot; where # represents the appropriate COM port number.&lt;br /&gt;
*Run POVController.exe and provide it with the COM port number when prompted and press enter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using POVController.exe:&lt;br /&gt;
*After starting up POVController.exe as described above, the graphical user interface will appear.&lt;br /&gt;
*Click &amp;quot;Clear&amp;quot; to clear the POV display and start with a blank image.&lt;br /&gt;
*You can draw on the grid with your mouse to make images appear on the display.&lt;br /&gt;
*Selecting the &amp;quot;Erase&amp;quot; check box allows you to use the mouse to erase individual pixels.&lt;br /&gt;
*Typing in the applet will make text appear in the GUI. &lt;br /&gt;
*If the drawing or text doesn&amp;#039;t show up you on the POV display, click the refresh button once. Avoid pressing the refresh button many times consecutively; refreshing takes several seconds and multiple clicks will cause the program to briefly become unresponsive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Troubleshooting&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;quot;I don&amp;#039;t see any lights!&amp;quot;&amp;#039;&amp;#039; - Did you turn on the battery pack on the display? &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;quot;When I type none of my letters appear in the interface!&amp;quot;&amp;#039;&amp;#039; - Try pressing backspace several times.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;quot;None of the controls work!&amp;quot;&amp;#039;&amp;#039; - Try turning off the motor, letting the display spin down, and then pushing the reset buttons on both PICs. Sometimes the communication between the two PICs gets misaligned and the PICs have to be reset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
The use of PICs in this project allows for a great number of possibilities for improvement to the display. For instance, different sensors could be mounted to the display platform or added to the controller PIC to make the display more interactive; proximity sensors, microphones, or even touch screens could be added to create more modes of operation. Additionally, using RGB LEDS could allow for a more colorful user experience with the POV display.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12833</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12833"/>
		<updated>2009-03-20T06:01:43Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Additional Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|thumb|right|Rotating display circuit (click for high-resolution version)]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|thumb|right|Control panel circuit (click for high-resolution version)]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== How to use the POV Display (a brief user&amp;#039;s manual) ===&lt;br /&gt;
In its most basic mode of operation, the display is quite simple to use: &lt;br /&gt;
*Plug the power cord into the wall.&lt;br /&gt;
*Turn on the battery pack on the rotating display platform.&lt;br /&gt;
*Unfold the control panel, and flip the power switch. &lt;br /&gt;
The display should spin up and the text &amp;quot;ME333 - Mechatronics&amp;quot; should be displayed. Try out the control panel knobs!&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s also possible to draw your own images for the display in real time using the PC software. Note that the program will on run on &amp;#039;&amp;#039;&amp;#039;Windows&amp;#039;&amp;#039;&amp;#039; machines. &lt;br /&gt;
Here&amp;#039;s how to install the program:&lt;br /&gt;
*Download [[POV-PC.zip]] and save it in its own directory somewhere on your computer.&lt;br /&gt;
*Unzip POV-PC.zip with WinZip or some other unzipping tool.&lt;br /&gt;
*This will extract 3 files. The important one is POVController.exe. Running this will start the control program. You can run POVController.exe by navigating to the folder it&amp;#039;s in with Windows Explorer and double-clicking on the icon.&lt;br /&gt;
&lt;br /&gt;
Starting up POVController.exe:&lt;br /&gt;
*Plug the USB cable into the computer before running POVController.exe&lt;br /&gt;
*Find out the COM port number of the POV device: in Windows Device Manager, look under &amp;quot;Ports (COM &amp;amp; LPT)&amp;quot; and you should see &amp;quot;USB Serial Port (COM#),&amp;quot; where # represents the appropriate COM port number.&lt;br /&gt;
*Run POVController.exe and provide it with the COM port number when prompted and press enter.&lt;br /&gt;
&lt;br /&gt;
Using POVController.exe:&lt;br /&gt;
*After starting up POVController.exe as described above, the graphical user interface will appear.&lt;br /&gt;
*Click &amp;quot;Clear&amp;quot; to clear the POV display and start with a blank image.&lt;br /&gt;
*You can draw on the grid with your mouse to make images appear on the display.&lt;br /&gt;
*Selecting the &amp;quot;Erase&amp;quot; check box allows you to use the mouse to erase individual pixels.&lt;br /&gt;
*Typing in the applet will make text appear in the GUI. &lt;br /&gt;
*If the drawing or text doesn&amp;#039;t show up you on the POV display, click the refresh button once. Avoid pressing the refresh button many times consecutively; refreshing takes several seconds and multiple clicks will cause the program to briefly become unresponsive.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Troubleshooting&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t see any lights!&amp;#039;&amp;#039;&amp;#039; - Did you turn on the battery pack on the display? &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When I type none of my letters appear in the interface!&amp;#039;&amp;#039;&amp;#039; - Try pressing backspace several times.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;None of the controls work!&amp;#039;&amp;#039;&amp;#039; - Try turning off the motor, letting the display spin down, and then pushing the reset buttons on both PICs. Sometimes the communication between the two PICs gets misaligned and the PICs have to be reset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
The use of PICs in this project allows for a great number of possibilities for improvement to the display. For instance, different sensors could be mounted to the display platform or added to the controller PIC to make the display more interactive; proximity sensors, microphones, or even touch screens could be added to create more modes of operation. Additionally, using RGB LEDS could allow for a more colorful user experience with the POV display.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12787</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12787"/>
		<updated>2009-03-20T05:35:56Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|thumb|right|Rotating display circuit (click for high-resolution version)]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|thumb|right|Control panel circuit (click for high-resolution version)]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== How to use the POV Display (a small user&amp;#039;s manual) ===&lt;br /&gt;
In its most basic mode of operation, the display is simple to use: &lt;br /&gt;
*Plug the power cord into the wall.&lt;br /&gt;
*Turn the battery pack on the rotating display on.&lt;br /&gt;
*Unfold the control panel, and flip the power switch. &lt;br /&gt;
The display should spin up and the text &amp;quot;ME333 - Mechatronics&amp;quot; should be displayed. Try out the control panel knobs!&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s also possible to draw your own images for the display in real time using the PC software. Note that this program will on run on &amp;#039;&amp;#039;&amp;#039;Windows&amp;#039;&amp;#039;&amp;#039; machines. Here&amp;#039;s how to install the program:&lt;br /&gt;
*Download [[POV-PC.zip]] and save it in its own directory somewhere on your computer.&lt;br /&gt;
*Unzip POV-PC.zip with WinZip or some other unzipping tool.&lt;br /&gt;
*This will extract 3 files. The important one is POVController.exe. Running this will start the control program.&lt;br /&gt;
You can run POVController.exe by navigating to the folder it&amp;#039;s in with Windows Explorer and double-clicking on the icon. If you want you can create a shortcut to POVController.exe and drag it onto the desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
Before you run the program you&amp;#039;ll need to plug the USB cable into the computer. This creates a serial port on the computer which the program uses to talk to the POV. Serial ports are named things like &amp;quot;COM5&amp;quot; or &amp;quot;COM7&amp;quot;. You need to find out the number of the com port. One way to to this is with the device manager. Open up the device manager and look under &amp;quot;Ports (COM &amp;amp; LPT)&amp;quot;. You should see something like &amp;quot;USB Serial Port (COM5)&amp;quot;, probably with a different number than 5. Remember the number; the program will prompt you for it when it starts up.&lt;br /&gt;
&lt;br /&gt;
So start up POVController.exe and give it the COM port number (i.e. if your USB cable is port COM5 just enter &amp;quot;5&amp;quot; when prompted). The graphical interface will appear. You can draw on the grid with your mouse and your image will appear on the display. You&amp;#039;ll probably want to clear the display first. You can also type text. If your drawing doesn&amp;#039;t show up you can try hitting the refresh button. Don&amp;#039;t press the refresh button a bunch of times; refreshing takes a few seconds and if you click it say five times it will try to refresh five times and won&amp;#039;t respond for fifteen seconds or so.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Troubleshooting&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t see any lights!&amp;#039;&amp;#039;&amp;#039; - Did you turn on the battery pack on the display? &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When I type none of my letters appear in the interface!&amp;#039;&amp;#039;&amp;#039; - Try pressing backspace a bunch of times.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;None of the controls work!&amp;#039;&amp;#039;&amp;#039; - Try turning off the motor, letting the display spin down, and then pushing the reset buttons on both PICs. Sometimes the communication between the two PICs gets misaligned and the PICs have to be reset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12781</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12781"/>
		<updated>2009-03-20T05:34:07Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|thumb|right|Rotating display circuit (click for high-resolution version)]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|thumb|right|Control panel circuit (click for high-resolution version)]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== How to use the POV Display (a small user&amp;#039;s manual) ===&lt;br /&gt;
In its most basic mode of operation, the display is simple to use: &lt;br /&gt;
*Plug the power cord into the wall.&lt;br /&gt;
*Turn the battery pack on the rotating display on.&lt;br /&gt;
*Unfold the control panel, and flip the power switch. &lt;br /&gt;
The display should spin up and the text &amp;quot;ME333 - Mechatronics&amp;quot; should be displayed. Try out the control panel knobs!&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s also possible to draw your own images for the display in real time using the PC software. Note that this program will on run on &amp;#039;&amp;#039;&amp;#039;Windows&amp;#039;&amp;#039;&amp;#039; machines. Here&amp;#039;s how to install the program:&lt;br /&gt;
*Download [[POV-PC.zip]] and save it in its own directory somewhere on your computer.&lt;br /&gt;
*Unzip POV-PC.zip with WinZip or some other unzipping tool.&lt;br /&gt;
*This will extract 3 files. The important one is POVController.exe. Running this will start the control program.&lt;br /&gt;
You can run POVController.exe by navigating to the folder it&amp;#039;s in with Windows Explorer and double-clicking on the icon. If you want you can create a shortcut to POVController.exe and drag it onto the desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
Before you run the program you&amp;#039;ll need to plug the USB cable into the computer. This creates a serial port on the computer which the program uses to talk to the POV. Serial ports are named things like &amp;quot;COM5&amp;quot; or &amp;quot;COM7&amp;quot;. You need to find out the number of the com port. One way to to this is with the device manager. Open up the device manager and look under &amp;quot;Ports (COM &amp;amp; LPT)&amp;quot;. You should see something like &amp;quot;USB Serial Port (COM5)&amp;quot;, probably with a different number than 5. Remember the number; the program will prompt you for it when it starts up.&lt;br /&gt;
&lt;br /&gt;
So start up POVController.exe and give it the COM port number (i.e. if your USB cable is port COM5 just enter &amp;quot;5&amp;quot; when prompted). The graphical interface will appear. You can draw on the grid with your mouse and your image will appear on the display. You&amp;#039;ll probably want to clear the display first. You can also type text. If your drawing doesn&amp;#039;t show up you can try hitting the refresh button. Don&amp;#039;t press the refresh button a bunch of times; refreshing takes a few seconds and if you click it say five times it will try to refresh five times and won&amp;#039;t respond for fifteen seconds or so.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Troubleshooting&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t see any lights!&amp;#039;&amp;#039;&amp;#039; - Did you turn on the battery pack on the display? &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When I type none of my letters appear in the interface!&amp;#039;&amp;#039;&amp;#039; - Try pressing backspace a bunch of times.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;None of the controls work!&amp;#039;&amp;#039;&amp;#039; - Try turning off the motor, letting the display spin down, and then pushing the reset buttons on both PICs. Sometimes the communication between the two PICs gets misaligned and the PICs have to be reset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12779</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12779"/>
		<updated>2009-03-20T05:33:50Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|thumb|right|Rotating display circuit (click for high-resolution version)]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|thumb|right|Control panel circuit (click for high-resolution version)]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== How to use the POV Display (a small user&amp;#039;s manual) ===&lt;br /&gt;
In its most basic mode of operation, the display is simple to use: &lt;br /&gt;
*Plug the power cord into the wall.&lt;br /&gt;
*Turn the battery pack on the rotating display on.&lt;br /&gt;
*Unfold the control panel, and flip the power switch. &lt;br /&gt;
The display should spin up and the text &amp;quot;ME333 - Mechatronics&amp;quot; should be displayed. Try out the control panel knobs!&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s also possible to draw your own images for the display in real time using the PC software. Note that this program will on run on &amp;#039;&amp;#039;&amp;#039;Windows&amp;#039;&amp;#039;&amp;#039; machines. Here&amp;#039;s how to install the program:&lt;br /&gt;
*Download [[POV-PC.zip]] and save it in its own directory somewhere on your computer.&lt;br /&gt;
*Unzip POV-PC.zip with WinZip or some other unzipping tool.&lt;br /&gt;
*This will extract 3 files. The important one is POVController.exe. Running this will start the control program.&lt;br /&gt;
You can run POVController.exe by navigating to the folder it&amp;#039;s in with Windows Explorer and double-clicking on the icon. If you want you can create a shortcut to POVController.exe and drag it onto the desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
Before you run the program you&amp;#039;ll need to plug the USB cable into the computer. This creates a serial port on the computer which the program uses to talk to the POV. Serial ports are named things like &amp;quot;COM5&amp;quot; or &amp;quot;COM7&amp;quot;. You need to find out the number of the com port. One way to to this is with the device manager. Open up the device manager and look under &amp;quot;Ports (COM &amp;amp; LPT)&amp;quot;. You should see something like &amp;quot;USB Serial Port (COM5)&amp;quot;, probably with a different number than 5. Remember the number; the program will prompt you for it when it starts up.&lt;br /&gt;
&lt;br /&gt;
So start up POVController.exe and give it the COM port number (i.e. if your USB cable is port COM5 just enter &amp;quot;5&amp;quot; when prompted). The graphical interface will appear. You can draw on the grid with your mouse and your image will appear on the display. You&amp;#039;ll probably want to clear the display first. You can also type text. If your drawing doesn&amp;#039;t show up you can try hitting the refresh button. Don&amp;#039;t press the refresh button a bunch of times; refreshing takes a few seconds and if you click it say five times it will try to refresh five times and won&amp;#039;t respond for fifteen seconds or so.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Troubleshooting&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t see any lights!&amp;#039;&amp;#039;&amp;#039; - Did you turn on the battery pack on the display? &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When I type none of my letters appear in the interface!&amp;#039;&amp;#039;&amp;#039; - Try pressing backspace a bunch of times.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;None of the controls work!&amp;#039;&amp;#039;&amp;#039; - Try turning off the motor, letting the display spin down, and then pushing the reset buttons on both PICs. Sometimes the communication between the two PICs gets misaligned and the PICs have to be reset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12777</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12777"/>
		<updated>2009-03-20T05:33:05Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|thumb|right|Rotating display circuit (click for high-resolution version)]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|thumb|right|Control panel circuit (click for high-resolution version)]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== How to use the POV Display (a small user&amp;#039;s manual) ===&lt;br /&gt;
In its most basic mode of operation, the display is simple to use: &lt;br /&gt;
*Plug the power cord into the wall.&lt;br /&gt;
*Turn the battery pack on the rotating display on.&lt;br /&gt;
*Unfold the control panel, and flip the power switch. &lt;br /&gt;
The display should spin up and the text &amp;quot;ME333 - Mechatronics&amp;quot; should be displayed. Try out the control panel knobs!&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s also possible to draw your own images for the display in real time using the PC software. Note that this program will on run on &amp;#039;&amp;#039;&amp;#039;Windows&amp;#039;&amp;#039;&amp;#039; machines. Here&amp;#039;s how to install the program:&lt;br /&gt;
*Download [[POV-PC.zip]] and save it in its own directory somewhere on your computer.&lt;br /&gt;
*Unzip POV-PC.zip with WinZip or some other unzipping tool.&lt;br /&gt;
*This will extract 3 files. The important one is POVController.exe. Running this will start the control program.&lt;br /&gt;
You can run POVController.exe by navigating to the folder it&amp;#039;s in with Windows Explorer and double-clicking on the icon. If you want you can create a shortcut to POVController.exe and drag it onto the desktop for easy access.&lt;br /&gt;
&lt;br /&gt;
Before you run the program you&amp;#039;ll need to plug the USB cable into the computer. This creates a serial port on the computer which the program uses to talk to the POV. Serial ports are named things like &amp;quot;COM5&amp;quot; or &amp;quot;COM7&amp;quot;. You need to find out the number of the com port. One way to to this is with the device manager. Open up the device manager and look under &amp;quot;Ports (COM &amp;amp; LPT)&amp;quot;. You should see something like &amp;quot;USB Serial Port (COM5)&amp;quot;, probably with a different number than 5. Remember the number; the program will prompt you for it when it starts up.&lt;br /&gt;
&lt;br /&gt;
So start up POVController.exe and give it the COM port number (i.e. if your USB cable is port COM5 just enter &amp;quot;5&amp;quot; when prompted). The graphical interface will appear. You can draw on the grid with your mouse and your image will appear on the display. You&amp;#039;ll probably want to clear the display first. You can also type text. If your drawing doesn&amp;#039;t show up you can try hitting the refresh button. Don&amp;#039;t press the refresh button a bunch of times; refreshing takes a few seconds and if you click it say five times it will try to refresh five times and won&amp;#039;t respond for fifteen seconds or so.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Troubleshooting&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;I don&amp;#039;t see any lights!&amp;#039;&amp;#039;&amp;#039; - Did you turn on the battery pack on the display? &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;When I type none of my letters appear in the interface!&amp;#039;&amp;#039;&amp;#039; - Try pressing backspace a bunch of times.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;None of the controls work!&amp;#039;&amp;#039;&amp;#039; - Try turning off the motor, letting the display spin down, and then pushing the reset buttons on both PICs. Sometimes the communication between the two PICs gets misaligned and the PICs have to be reset.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12225</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12225"/>
		<updated>2009-03-19T23:16:05Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, the user can just plug in the POV display into a wall socket, turn on the display PIC&amp;#039;s power, and turn on the motor to display an image. This allows for a quick and easy demonstration without a computer. We have stored eleven different responses on the display PIC&amp;#039;s ROM. Using a knob and a button on the control panel, the user can set which canned response is displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows users to draw pictures or type letters which will be transmitted in real time from the controller PIC to the display PIC through the wireless XBee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12224</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12224"/>
		<updated>2009-03-19T23:10:53Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
=== Base ===&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12223</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12223"/>
		<updated>2009-03-19T23:10:36Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12222</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12222"/>
		<updated>2009-03-19T23:09:05Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first [[Persistence-of-Vision Display#Modes of Operation|mode of operation]], the control panel receives user input through three 1000-Ohm potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the second mode of operation takes effect and the controller PIC is also responsible for accepting commands from the PC and relaying them to the display PIC through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12217</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12217"/>
		<updated>2009-03-19T23:04:17Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics were wired separately from the rest of the electronics. A toggle switch was wired in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allowed for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12215</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12215"/>
		<updated>2009-03-19T23:03:06Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12214</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12214"/>
		<updated>2009-03-19T23:02:48Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12213</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12213"/>
		<updated>2009-03-19T23:02:24Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* (1) Push-button&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25-Ohm Potentiometer&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12210</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12210"/>
		<updated>2009-03-19T23:00:52Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12209</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12209"/>
		<updated>2009-03-19T23:00:40Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12206</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12206"/>
		<updated>2009-03-19T23:00:00Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&amp;lt;Br&amp;gt;&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12204</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12204"/>
		<updated>2009-03-19T22:59:29Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&lt;br /&gt;
=== Rotating Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Motor Control Electronics ===&lt;br /&gt;
The motor and its electronics are wired separately from the rest of the electronics. A toggle switch is mounted in series with a variable resistor (a 25-Ohm potentiometer) between the motor and a 24V power supply. This allows for the toggle switch to be used as a simple on/off power switch, and the potentiometer to be used to tune the voltage across the motor, effectively varying its speed.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable.&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12185</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12185"/>
		<updated>2009-03-19T22:48:31Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
[[image:Picture of Control Panel|right|thumb|250px|Picture of Control Panel]]&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Br&amp;gt;.&amp;lt;Br&amp;gt;.&lt;br /&gt;
=== Display Platform ===&lt;br /&gt;
[[image:Picture of Display Platform|right|thumb|250px|Picture of Display Platform]]&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display PIC Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands from the controller PIC via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
=== Controller PIC Electronics  ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
When using the first mode of operation, the control panel receives user input through three potentiometers and a push button. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000-Ohm potentiometers&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=zx5eXrf9oQI[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
http://www.youtube.com/watch?v=urz729AbkG4[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12158</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12158"/>
		<updated>2009-03-19T22:30:12Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
=== Display Platform ===&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; x 5&amp;quot; x 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display Platform Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000Ohm potentiometers&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12151</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12151"/>
		<updated>2009-03-19T22:26:56Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Display Platform ===&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Parts List ===&lt;br /&gt;
* (1) [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon Motor]]&lt;br /&gt;
* (1) Toggle Switch&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* (1) Radial ball bearing&lt;br /&gt;
* Expanded PVC sheet&lt;br /&gt;
* Wood (approx. 6&amp;quot; X 5&amp;quot; X 0.5&amp;quot;)&lt;br /&gt;
* Sheet metal screws&lt;br /&gt;
* Various nuts and bolts&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display Platform Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000Ohm potentiometers&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12143</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12143"/>
		<updated>2009-03-19T22:22:11Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Display Platform ===&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display Platform Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parts list ===&lt;br /&gt;
* (2) PIC18F4520 microcontrollers&lt;br /&gt;
* (1) XBee Radio pair and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* (2) Darlington Pair Arrays (DS2003)&lt;br /&gt;
* (1) Hall switch&lt;br /&gt;
* (14) Bright white LEDs&lt;br /&gt;
* (3) 1000Ohm potentiometers&lt;br /&gt;
* (1) 25Ohm Potentiometer&lt;br /&gt;
* Push-button&lt;br /&gt;
* Solder Board&lt;br /&gt;
* Stranded wire&lt;br /&gt;
* 10-wire stranded ribbon cable&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=zx5eXrf9oQI]&lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=urz729AbkG4]&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12135</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12135"/>
		<updated>2009-03-19T22:11:30Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Electrical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Display Platform ===&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
=== Display Platform Electronics ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display platform has 14 LEDs which were controlled through Ports C and D of a PIC. Because bright LEDs were used, the amount of current need could not be supplied directly from the output ports of the PIC. As such, the LEDs were wired through two Darlington arrays (DS2003). These ICs consist of 7 [[Diodes and Transistors#Darlington Pair|Darlington pairs]] with a common emitter. The outputs of the PIC were connected to the bases of the transistors; when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor|Hall switch]] to synchronize its display with its rotation, as described above. The implemented circuit, as shown schematically at the right, causes pin B0 of the PIC to go low whenever the hall switch is near the magnet mounted on the base box; when the PIC detects this falling edge on pin B0 it knows its relative position. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== List of Electronic Components ===&lt;br /&gt;
* 2 PIC18F4520 microcontrollers&lt;br /&gt;
* 2 XBee Radios and their [[XBee Interface Board|interface boards]]&lt;br /&gt;
* 1 Hall switch&lt;br /&gt;
* 14 Bright white LEDs&lt;br /&gt;
* 1 6W Maxon Motor&lt;br /&gt;
* Solder Board&lt;br /&gt;
* 3 1000Ohm potentiometers&lt;br /&gt;
* 1 25Ohm Potentiometer&lt;br /&gt;
* 1 Toggle Switch&lt;br /&gt;
* 1 Push-button&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12094</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12094"/>
		<updated>2009-03-19T21:40:51Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes. Specifics on the implementation of these components are described below in the Electronic Design section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Display Platform ===&lt;br /&gt;
Because the display platform rotates rapidly during operation, all of the components were mounted rigidly onto two sheets of expanded PVC. These two sheets were screwed together at the center of the platform, such that a double layer of material was created at the slot for the motor coupler. At one end of the platform, the panel of 14 vertically mounted LEDs was mounted. The electronics of the platform (consisting of a solder board and a PIC board separated by standoffs) were mounted behind the LED panel. A 6V battery pack (4AA&amp;#039;s) was mounted at the opposite end of the platform with Velcro. This non-permanent positioning of the battery pack was chosen so that the batteries could be easily replaced and such that the batteries could act as an adjustable counterbalance for the entire platform.&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12080</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12080"/>
		<updated>2009-03-19T21:23:48Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input: 1) Motor power switch, 2) Motor speed knob, 3) Selection knob for stored responses, 4) Selection button for stored response, 5) Message position knob, and 6) Scroll speed knob. These components were mounted on a piece of expanded PVC through appropriately sized holes.&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12079</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12079"/>
		<updated>2009-03-19T21:20:48Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
Several knobs, buttons, and switches were placed on a control panel to allow for user input:&lt;br /&gt;
&lt;br /&gt;
1) Motor power switch &lt;br /&gt;
2) Motor speed knob&lt;br /&gt;
3) Selection knob for stored responses&lt;br /&gt;
4) Selection button for stored response&lt;br /&gt;
5) Message position knob&lt;br /&gt;
6) Scroll speed knob&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12064</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12064"/>
		<updated>2009-03-19T21:10:44Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Mechanical Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|right|thumb|250px|CAD representation of POV Display]]&lt;br /&gt;
=== Base ===&lt;br /&gt;
The base box was fabricated using black expanded PVC. There are three rectangular faces (the back, top, and bottom), two trapezoidal sides and a door that is hinged at the base such that it opens outwards. The control panel was mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
A wooden base was mounted to the bottom of this PVC box both to increase the box&amp;#039;s integrity and to add to stability of the system with additional mass. A slot was cut near the back of the wooden panel to hold motor in place. &lt;br /&gt;
&lt;br /&gt;
The motor output shaft was connected to the POV display platform through an aluminum coupler. This coupler extended out the top of the box through a [[Bearings|radial ball bearing]], which served to reduce lateral motion of the display platform and to support some of the weight of the platform. The end of the coupler was machined to fit snugly  in to a slot-shaped hole in the display platform. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12031</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12031"/>
		<updated>2009-03-19T20:42:24Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|thumb|right|250px|Schematic of POV Display]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12030</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12030"/>
		<updated>2009-03-19T20:40:46Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12029</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12029"/>
		<updated>2009-03-19T20:40:32Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science and Engineering, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12028</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12028"/>
		<updated>2009-03-19T20:40:20Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn (Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12027</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12027"/>
		<updated>2009-03-19T20:40:04Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12026</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12026"/>
		<updated>2009-03-19T20:39:42Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Theory of Persistence of Vision ===&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12024</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12024"/>
		<updated>2009-03-19T20:37:01Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
=== Team Members ===&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12023</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=12023"/>
		<updated>2009-03-19T20:36:27Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
In order to avoid the complication of wiring a spinning object, all of the major components of the POV display were placed on a platform mounted on the output shaft of a [[Actuators Available in the Mechatronics Lab#6W Maxon motor with 6:1 gearhead and 100 line encoder|6W Maxon motor]]. The components of this rotating platform include a [[PIC Microcontroller]], a panel of 14 bright white LEDs, a [[Hall Effect Sensor|Hall switch]], an [[XBee radio communication between PICs|XBee radio]], and a battery pack to power the assembly. The strip of LEDs was mounted vertically (or parallel to the axis of rotation) at one end of the platform. To minimize wobbling of the assembly while spinning, the components were positioned such that the center of gravity of the panel passed through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
Wireless communication between two PICs via [[XBee radio communication between PICs|XBees]] was used to enable live updating of the display based on user input: one PIC (the &amp;quot;display&amp;quot; PIC) was used to control the POV display and receive wireless information from a second PIC. This second &amp;quot;controller&amp;quot; PIC was used to receive user input and transmit it to the display PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Modes of Operation ===&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation, corresponding to two different input methods. &lt;br /&gt;
&lt;br /&gt;
In the first mode of operation, the controller PIC transmits previously stored data to the PIC on the rotor panel. By varying the resistance of a [[Potentiometers|potentiometer]] on the control panel, the user can choose between eleven &amp;quot;canned&amp;quot; messages.&lt;br /&gt;
&lt;br /&gt;
In the second mode of operation, the controller PIC is connected to a computer via [[PIC RS232#FTDIChip TTL-232R USB to RS232 Cable|USB]]. Using a Java program written by Gregory McGlynn, the user can draw pictures or type letters in real time on the computer screen and on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Position Sensing ===&lt;br /&gt;
&lt;br /&gt;
To allow for accurate portrayal of the desired image, a [[Hall Effect Sensor|Hall switch]] was utilized to implement position sensing. The Hall switch was mounted near the end of the rotor display platform and a magnet was attached on the top of the base box. The magnet was positioned directly under the path of the hall sensor such that each rotation of the platform triggered an electrical pulse. The display PIC was programmed to reset the image cycle each time a pulse was sensed from the Hall sensor. This allowed reproduction of a stationary image.&lt;br /&gt;
&lt;br /&gt;
Using this implementation of the Hall switch, the display POV was programmed to calculate the rotational velocity of the POV after each rotation by timing the interval between pulses from the Hall switch. This allows for correction of pixel column spacing, such that the column width is consistent even at different speeds. As such, the display may function properly without any information from the motor about its speed.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11977</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11977"/>
		<updated>2009-03-19T19:16:13Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Theory of Persistence of Vision */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called persistence of vision (POV). When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We mounted a platform atop the output shaft of a motor. In order to avoid the complication of wiring a spinning object, all of the major components of the POV display are built on this platform, including a PIC microcontroller, a strip of LEDs, and a battery pack to power the assembly. The strip of LEDs will be mounted vertically at an extended end of the platform. In order to stabilize the spinning motion, the components are positioned so that the center of gravity of the panel passes through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We made use of wireless communication between two PICs to implement live updating of the display based on user input. One PIC will be used to control the POV display and receive wireless information from a second PIC. The second PIC will receive user input store user input and transmit the data wirelessly to the POV’s PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation. In mode 1, the PIC on the control panel transmits data that we had previously stored in it to the PIC on the rotor panel. By varying the resistance of a potentiometer on the control panel, we allow the user to choose between ten pre-stored messages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In mode 2 of operation, the PIC on the control panel is connected to a computer via a USB port. Using a Java program that we wrote, we allow the user to draw pictures or type letters which will get updated real time on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to ensure accurate portrayal of the desired image, we used a hall sensor to implement position sensing. We wired in a hall sensor towards the end of the rotor display panel and attached a magnet on the top of the base box. The magnet was positioned on the orbiting path of the hall sensor so that it registers a signal everytime it spins a round. We have programmed the display to reset the image cycle everytime the hall sensor was triggered so that the image stays at the same location.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11976</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11976"/>
		<updated>2009-03-19T19:14:37Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called the persistence of vision (POV).  When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago. &lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We mounted a platform atop the output shaft of a motor. In order to avoid the complication of wiring a spinning object, all of the major components of the POV display are built on this platform, including a PIC microcontroller, a strip of LEDs, and a battery pack to power the assembly. The strip of LEDs will be mounted vertically at an extended end of the platform. In order to stabilize the spinning motion, the components are positioned so that the center of gravity of the panel passes through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We made use of wireless communication between two PICs to implement live updating of the display based on user input. One PIC will be used to control the POV display and receive wireless information from a second PIC. The second PIC will receive user input store user input and transmit the data wirelessly to the POV’s PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation. In mode 1, the PIC on the control panel transmits data that we had previously stored in it to the PIC on the rotor panel. By varying the resistance of a potentiometer on the control panel, we allow the user to choose between ten pre-stored messages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In mode 2 of operation, the PIC on the control panel is connected to a computer via a USB port. Using a Java program that we wrote, we allow the user to draw pictures or type letters which will get updated real time on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to ensure accurate portrayal of the desired image, we used a hall sensor to implement position sensing. We wired in a hall sensor towards the end of the rotor display panel and attached a magnet on the top of the base box. The magnet was positioned on the orbiting path of the hall sensor so that it registers a signal everytime it spins a round. We have programmed the display to reset the image cycle everytime the hall sensor was triggered so that the image stays at the same location.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11975</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11975"/>
		<updated>2009-03-19T19:14:07Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called the persistence of vision (POV).  When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago. &lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We mounted a platform atop the output shaft of a motor. In order to avoid the complication of wiring a spinning object, all of the major components of the POV display are built on this platform, including a PIC microcontroller, a strip of LEDs, and a battery pack to power the assembly. The strip of LEDs will be mounted vertically at an extended end of the platform. In order to stabilize the spinning motion, the components are positioned so that the center of gravity of the panel passes through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We made use of wireless communication between two PICs to implement live updating of the display based on user input. One PIC will be used to control the POV display and receive wireless information from a second PIC. The second PIC will receive user input store user input and transmit the data wirelessly to the POV’s PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation. In mode 1, the PIC on the control panel transmits data that we had previously stored in it to the PIC on the rotor panel. By varying the resistance of a potentiometer on the control panel, we allow the user to choose between ten pre-stored messages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In mode 2 of operation, the PIC on the control panel is connected to a computer via a USB port. Using a Java program that we wrote, we allow the user to draw pictures or type letters which will get updated real time on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to ensure accurate portrayal of the desired image, we used a hall sensor to implement position sensing. We wired in a hall sensor towards the end of the rotor display panel and attached a magnet on the top of the base box. The magnet was positioned on the orbiting path of the hall sensor so that it registers a signal everytime it spins a round. We have programmed the display to reset the image cycle everytime the hall sensor was triggered so that the image stays at the same location.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11974</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11974"/>
		<updated>2009-03-19T19:13:43Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called the persistence of vision (POV).  When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago. &lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We mounted a platform atop the output shaft of a motor. In order to avoid the complication of wiring a spinning object, all of the major components of the POV display are built on this platform, including a PIC microcontroller, a strip of LEDs, and a battery pack to power the assembly. The strip of LEDs will be mounted vertically at an extended end of the platform. In order to stabilize the spinning motion, the components are positioned so that the center of gravity of the panel passes through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We made use of wireless communication between two PICs to implement live updating of the display based on user input. One PIC will be used to control the POV display and receive wireless information from a second PIC. The second PIC will receive user input store user input and transmit the data wirelessly to the POV’s PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation. In mode 1, the PIC on the control panel transmits data that we had previously stored in it to the PIC on the rotor panel. By varying the resistance of a potentiometer on the control panel, we allow the user to choose between ten pre-stored messages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In mode 2 of operation, the PIC on the control panel is connected to a computer via a USB port. Using a Java program that we wrote, we allow the user to draw pictures or type letters which will get updated real time on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to ensure accurate portrayal of the desired image, we used a hall sensor to implement position sensing. We wired in a hall sensor towards the end of the rotor display panel and attached a magnet on the top of the base box. The magnet was positioned on the orbiting path of the hall sensor so that it registers a signal everytime it spins a round. We have programmed the display to reset the image cycle everytime the hall sensor was triggered so that the image stays at the same location.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11972</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11972"/>
		<updated>2009-03-19T19:12:39Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team Members ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
A fully customizable display using the concept of Persistence of Vision was created as a final project for ME333 in 2009. User-specified images (and even moving images) were displayed by rotating a column of LEDs at speeds faster than 300rpm. Each individual LED was modeled as a row of pixels. Conversely, the rotational position of the panel of LEDs represented the pixel columns of the display; the time interval and rotational speed determined the width of the pixel columns.&lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called the persistence of vision (POV).  When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago. &lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We mounted a platform atop the output shaft of a motor. In order to avoid the complication of wiring a spinning object, all of the major components of the POV display are built on this platform, including a PIC microcontroller, a strip of LEDs, and a battery pack to power the assembly. The strip of LEDs will be mounted vertically at an extended end of the platform. In order to stabilize the spinning motion, the components are positioned so that the center of gravity of the panel passes through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We made use of wireless communication between two PICs to implement live updating of the display based on user input. One PIC will be used to control the POV display and receive wireless information from a second PIC. The second PIC will receive user input store user input and transmit the data wirelessly to the POV’s PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation. In mode 1, the PIC on the control panel transmits data that we had previously stored in it to the PIC on the rotor panel. By varying the resistance of a potentiometer on the control panel, we allow the user to choose between ten pre-stored messages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In mode 2 of operation, the PIC on the control panel is connected to a computer via a USB port. Using a Java program that we wrote, we allow the user to draw pictures or type letters which will get updated real time on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to ensure accurate portrayal of the desired image, we used a hall sensor to implement position sensing. We wired in a hall sensor towards the end of the rotor display panel and attached a magnet on the top of the base box. The magnet was positioned on the orbiting path of the hall sensor so that it registers a signal everytime it spins a round. We have programmed the display to reset the image cycle everytime the hall sensor was triggered so that the image stays at the same location.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face of the door.&lt;br /&gt;
&lt;br /&gt;
An addition wooden base is mounted to the base to increase rigidity of base-to-wall connections and also to weight down the whole setup and make it more stable. A slot is cut towards the back to stick in the motor. &lt;br /&gt;
&lt;br /&gt;
A aluminum coupler is attached to the motor shaft which comes out of the top of the box through a radial bearing. The radial bearing can reduce the degree of freedom of the spinning shaft so it only spins in the vertical axis. It may also be used to support the weight of the rotating display panel of that the whole weight does not rest on the motor shaft. The end of the coupler is milled to a strip that locks in to a complementary hole in the rotating display panel. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
There are switches that we need to put on the control panel. &lt;br /&gt;
1) Turns motor on/off&lt;br /&gt;
2) Control motor speed&lt;br /&gt;
3) Choose stored response&lt;br /&gt;
4) Invoke stored response&lt;br /&gt;
5) Scroll the message&lt;br /&gt;
6) Set scroll speed for message&lt;br /&gt;
&lt;br /&gt;
The first control was a simple toggle switch wired between the two motor leads. The second control is a potentiometer wired between the motor, by turning the potentiometer to increase resistance, we can lower the motor speed.&lt;br /&gt;
&lt;br /&gt;
The third control is implemented by a potentiometer with ten different markings, each corresponding to a stored message. We set the control panel PIC code to recognize ten different intervals of resistance controlled by the potentiometer. After the resistance is set on control 3, pressing button 4 will ask the PIC to grab this resistance value and display the right stored response. &lt;br /&gt;
&lt;br /&gt;
Control 5 and 6 are both implemented by potentiometers. Control 5 allows users to scroll the message manually and control 6 allows the user to set the speed at which the message scrolls around. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11767</id>
		<title>Persistence-of-Vision Display</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=Persistence-of-Vision_Display&amp;diff=11767"/>
		<updated>2009-03-19T06:25:08Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Team Members ==&lt;br /&gt;
[[image:POV|right]]&lt;br /&gt;
* Gregory McGlynn(Computer Science, Class of 2011) [left]&lt;br /&gt;
* Kwang Xiong Sim (Mechanical Engineering, Class of 2010) [center]&lt;br /&gt;
* Alexander Park (Material Science, Class of 2009) [right]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
The purpose of this project was to create a display using the concept of Persistence of Vision. Essentially, we created a rotating platform that spins a column of LEDs. By controlling the frequency of blinking on each LED, and synchronizing it with the rate of rotation of the platform, we can tune the moving column of LEDs to display a desired image. &lt;br /&gt;
&lt;br /&gt;
== Theory of Persistence of Vision ==&lt;br /&gt;
Although arguably much more complex, human vision functions in a manner similar to modern motion pictures; our eyes retain images for a fraction of a second, not unlike a frame in a movie. This is called the persistence of vision (POV).  When images change fast enough, what we see is a subtle blend of what we see now and a fraction of a second ago. &lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
[[image:POVschematic|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We mounted a platform atop the output shaft of a motor. In order to avoid the complication of wiring a spinning object, all of the major components of the POV display are built on this platform, including a PIC microcontroller, a strip of LEDs, and a battery pack to power the assembly. The strip of LEDs will be mounted vertically at an extended end of the platform. In order to stabilize the spinning motion, the components are positioned so that the center of gravity of the panel passes through the axis of rotation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We made use of wireless communication between two PICs to implement live updating of the display based on user input. One PIC will be used to control the POV display and receive wireless information from a second PIC. The second PIC will receive user input store user input and transmit the data wirelessly to the POV’s PIC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The POV display has two modes of operation. In mode 1, the PIC on the control panel transmits data that we had previously stored in it to the PIC on the rotor panel. By varying the resistance of a potentiometer on the control panel, we allow the user to choose between ten pre-stored messages. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In mode 2 of operation, the PIC on the control panel is connected to a computer via a USB port. Using a Java program that we wrote, we allow the user to draw pictures or type letters which will get updated real time on the POV display. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to ensure accurate portrayal of the desired image, we used a hall sensor to implement position sensing. We wired in a hall sensor towards the end of the rotor display panel and attached a magnet on the top of the base box. The magnet was positioned on the orbiting path of the hall sensor so that it registers a signal everytime it spins a round. We have programmed the display to reset the image cycle everytime the hall sensor was triggered so that the image stays at the same location.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mechanical Design ==&lt;br /&gt;
[[image:POV_CADdrawing|center]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Base Box ===&lt;br /&gt;
As seen in the above drawing, the base box is built out of rigid expanded PVC. There are 3 rectangle faces, 2 trapezium faces and a door that is hinged at the base so that it opens outwards. The control panel is mounted on the inner face  &lt;br /&gt;
&lt;br /&gt;
=== Control Panel ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Panel ===&lt;br /&gt;
&lt;br /&gt;
== Electrical Design ==&lt;br /&gt;
&lt;br /&gt;
=== Primary Components ===&lt;br /&gt;
&lt;br /&gt;
=== Rotating Display Circuit ===&lt;br /&gt;
[[Image:POVschematicsmall.jpg|400px|right|Display circuit]]&lt;br /&gt;
The rotating display has 14 LEDs which are controlled by a PIC. The LEDs are bright and require a good deal of current, which cannot be supplied directly from the output ports of the PIC. Therefore the LEDs are controlled through two Darlington arrays (DS2003). These ICs consist of 7 Darlington pair transistors with a common emitter. The outputs of the PIC are connected to the bases of the transistors. Thus when the PIC drives one of the bases high, current can flow through the transistor and the corresponding LED lights up. We did not find it necessary to use any resistors in this design.&lt;br /&gt;
&lt;br /&gt;
The display uses a [[Hall Effect Sensor]] to synchronize its display with its rotation. The circuit as shown causes pin B0 on the PIC to go low whenever the hall sensor is near a magnet. A magnet is mounted at a fixed location under the display so that when the PIC detects this falling edge on pin B0 it knows that it is positioned above the magnet. By timing the interval between two of these events the PIC calculates how fast the display is rotating and adjusts its timing accordingly.&lt;br /&gt;
&lt;br /&gt;
The display receives commands via an [[XBee radio communication between PICs|XBee]] radio module.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Control Panel Circuit ===&lt;br /&gt;
[[Image:AP_KS_GM=Control_panel_schematic.jpg|400px|right|Control panel circuit]]&lt;br /&gt;
&lt;br /&gt;
The control panel receives user input through three potentiometers and a pushbutton. The states of these controls are read by the PIC which uses its XBee radio module to send appropriate commands to the display.&lt;br /&gt;
&lt;br /&gt;
If the USB cable is plugged in, the control panel is also responsible for accepting commands from the PC and relaying these commands to the POV through the XBee.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-control_panel_code.c|Code for the control panel PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-pov_code.c|Code for the display PIC]]&lt;br /&gt;
&lt;br /&gt;
[[AP_KS_GM-POVInput.java|Code for the PC applet]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== Mode 1: Canned Response ===&lt;br /&gt;
In the first mode of operation, a user can just plug in the POV display into a wall socket, turn on the device and display an image immediately. This will allow a quick and easy demonstration without a computer. We have stored ten different responses on the PIC ROM sitting on the rotating display panel. Using a potentiometer, the device allow the user to set which canned response is being displayed.&lt;br /&gt;
&lt;br /&gt;
video link to mode 1 &lt;br /&gt;
&lt;br /&gt;
=== Mode 2: Real time image input ===&lt;br /&gt;
In the second mode of operation, a user can interact more closely with the POV display. In this mode, the POV  display is connected via a USB port to a computer which needs to have Java installed. The Java program with the code listed above allows a user to draw pictures or type letters which will be tranmitted real time from the control panel PIC to the rotating display panel PIC through the wireless Xbee chips.&lt;br /&gt;
&lt;br /&gt;
In both modes of operation, we have set up knobs that will allow a user to scroll a message manually or set the scroll speed of an image. &lt;br /&gt;
&lt;br /&gt;
video link to mode 2&lt;br /&gt;
&lt;br /&gt;
== Additional Notes ==&lt;br /&gt;
=== Possible Future Improvements/Enhancements ===&lt;br /&gt;
We have thought about using RGB LEDS to give the display panel more colorful. Also, we can use different sensors to make the display more interactive. For example putting on distance sensors on the display so that the panel color scheme changes when you wave a hand in front of it.&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10610</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10610"/>
		<updated>2009-02-12T06:38:33Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, but SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously. There is no standard communication protocol for SPI.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|I2C]] (another type of serial data communication). SPI can communicate at much higher data rates than I2C. Furthermore, when multiple slaves are present, SPI requires no addressing to differentiate between these slaves. Compared to parallel buses, SPI has the additional benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out; each side sends and receives one bit of information. Because there is no standard communication protocol, the master can either send data or both send and receive data, depending on the needs of the application. Likewise, the slave can either receive data or both receive and send data back to the master.&lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master chooses which slave with which to communicate. Note that more than one slave may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the schematic diagram shown above. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/ SPI Background](www.totalphase.com)&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus SPI Wikipedia Article] (www.wikipedia.org)&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html More Information] (www.mct.net)&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&amp;lt;b&amp;gt;Master connected to three slaves:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png]]&lt;br /&gt;
&lt;br /&gt;
Here each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;One PIC master and one PIC slave:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The master, on the left, and the slave, on the right, are connected as shown above. Be sure you also connect grounds!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
SPI communication on the PIC is accomplished via the functions spi_read() and spi_write(), which read and write one byte at a time over SPI. In the example below, the master reads an 8-bit value from the analog-to-digital converter and sends it to the slave via SPI. The slave reads the value and displays it on an LCD display.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; The code given below does not work perfectly: the slave failed to received 10-20% of the messages sent by the master. In this example that failure rate was not critical, as the slave just missed an update of the ADC reading when it missed a message. If more accurate data transmission is required, the failure rate inherent in this system may be unacceptable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;SPI Mode Numbers&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four SPI &amp;quot;modes&amp;quot; which describe the relationship between the phase of the clock line and the phase of the MISO/MOSI lines. In order to successfully communicate using SPI, the master and slave must operate using the same mode. [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Mode_Numbers Wikipedia] has a good explanation of these mode numbers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The Slave Select Line&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to being used to select which slave is active during a communication, the slave select (SS) line, is vital for synchronization. A slave&amp;#039;s SS line should be high except when the master is talking to it. When the SS line is pulled low, the slave knows that a new communication is starting. &lt;br /&gt;
&lt;br /&gt;
If a slave fails to receive a message properly, it will be reset when the SS line goes high at the end of the message and the slave will be prepared for a new message when the SS line goes low again. If the SS line is not used (e.g. by disabling it or running it directly to ground) there is a risk of the slave becoming out of sync with the master; if the slave misses a bit, it will always be one bit off in the future. Effective use of the SS line allows the slave and master to realign themselves at the beginning of each communication, in case of a transmission error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Master Code:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#device ADC=8&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
//These define the different SPI modes in terms of constants the compiler knows about&lt;br /&gt;
//NOTE: our PICs only seemed to work in modes 1 and 3, though they are supposed to work with any modes&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H) &lt;br /&gt;
&lt;br /&gt;
#define SS_PIN PIN_D0         //this can be any output pin on the master&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   int val;&lt;br /&gt;
&lt;br /&gt;
   //Set up the ADC to read from A0&lt;br /&gt;
   setup_adc_ports(AN0);&lt;br /&gt;
   setup_adc(ADC_CLOCK_INTERNAL);&lt;br /&gt;
   set_adc_channel(0);&lt;br /&gt;
&lt;br /&gt;
   //The next statement sets up the SPI hardware, with this PIC as a master using mode 1&lt;br /&gt;
   //SPI_CLK_DIV_64 sets the speed of the SPI clock pulses--this is the slowest speed&lt;br /&gt;
   setup_spi(SPI_MASTER | SPI_MODE_1 | SPI_CLK_DIV_64); &lt;br /&gt;
   &lt;br /&gt;
   while(true) {&lt;br /&gt;
       val = read_adc();      //read the value to be sent&lt;br /&gt;
       &lt;br /&gt;
       output_low(SS_PIN);    //pull the slave select line low to select the slave&lt;br /&gt;
       delay_us(10);          //give the slave time to notice this (may be unnecessary)&lt;br /&gt;
       &lt;br /&gt;
       spi_write(val);        //send the value&lt;br /&gt;
       &lt;br /&gt;
       delay_us(10);          //(may be unnecessary)&lt;br /&gt;
       output_high(SS_PIN);   //deselect the slave. &lt;br /&gt;
       &lt;br /&gt;
       delay_ms(10);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Slave Code:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;LCD.C&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   setup_spi(SPI_SLAVE | SPI_MODE_1); //set up SPI hardware as a slave in mode 1&lt;br /&gt;
   &lt;br /&gt;
   lcd_init();&lt;br /&gt;
   &lt;br /&gt;
   while(true) {&lt;br /&gt;
       val = spi_read(0); //spi_read must be passed an argument. The argument value is sent&lt;br /&gt;
                          //back to the master whenever the master sends us a message again. &lt;br /&gt;
                          //This allows two-way communication, but here the master ignores&lt;br /&gt;
                          //whatever the slave sends back, so just send a 0.&lt;br /&gt;
&lt;br /&gt;
       //display the value read:&lt;br /&gt;
       lcd_gotoxy(1, 1);&lt;br /&gt;
       printf(lcd_putc, &amp;quot;Pot at: %u   &amp;quot;, val);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Alternative Slave Code, Using Interrupts:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;LCD.C&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)&lt;br /&gt;
&lt;br /&gt;
#int_ssp //this interrupt will occur whenever we receive an SPI message (or an I2C message, actually)&lt;br /&gt;
void message_receieved() {&lt;br /&gt;
    unsigned int val;&lt;br /&gt;
&lt;br /&gt;
    val = spi_read(); //When you don&amp;#039;t pass an argument, spi_read just returns the most&lt;br /&gt;
                      //recently received SPI message. We can do this here because we know&lt;br /&gt;
                      //that we just received a new message.&lt;br /&gt;
&lt;br /&gt;
    //display the value:&lt;br /&gt;
    lcd_gotoxy(1, 1);&lt;br /&gt;
    printf(lcd_putc, &amp;quot;Pot at: %u   &amp;quot;, val);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   setup_spi(SPI_SLAVE | SPI_MODE_1); //setup the PIC as a slave in mode 1&lt;br /&gt;
   enable_interrupts(INT_SSP); //enable interrupts on SPI messages&lt;br /&gt;
   enable_interrupts(GLOBAL);&lt;br /&gt;
   &lt;br /&gt;
   lcd_init();&lt;br /&gt;
   &lt;br /&gt;
   while(true); //sit and wait for a message&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Two-way communication&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Though not shown above, it is possible to use SPI for two-way communication between master and slave. If the slave calls&lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_master = spi_read(123);&amp;lt;/pre&amp;gt;&lt;br /&gt;
It will wait for the master to send some clock pulses; when the clock pulses come the slave will simultaneously read the message being sent by the master and send its own message (the number 123). The master, for its part, will call&lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_slave = spi_read(22);&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will cause the master to send the number 22 to the slave and simultaneously read the message sent back by the slave (in this case the number 123). So the master and slave have exchanged one byte of information. If you are the master and you just want to get a byte from the slave without sending one, just send a junk value, which the slave will discard: &lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_slave = spi_read(0);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Useful resources&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Wikipedia article]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10608</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10608"/>
		<updated>2009-02-12T06:37:42Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, but SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously. There is no standard communication protocol for SPI.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|I2C]] (another type of serial data communication). SPI can communicate at much higher data rates than I2C. Furthermore, when multiple slaves are present, SPI requires no addressing to differentiate between these slaves. Compared to parallel buses, SPI has the additional benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out; each side sends and receives one bit of information. Because there is no standard communication protocol, the master can either send data or both send and receive data, depending on the needs of the application. Likewise, the slave can either receive data or both receive and send data back to the master.&lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master chooses which slave with which to communicate. Note that more than one slave may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the schematic diagram shown above. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/ SPI Background](www.totalphase.com)&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus SPI Wikipedia Article] (www.wikipedia.org)&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html More Information] (www.mct.net)&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&amp;lt;b&amp;gt;Master connected to three slaves:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png]]&lt;br /&gt;
&lt;br /&gt;
Here each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;One PIC master and one PIC slave:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The master, on the left, and the slave, on the right, are connected as shown above. Be sure you also connect grounds!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
SPI communication on the PIC is accomplished via the functions spi_read() and spi_write(), which read and write one byte at a time over SPI. In the example below, the master reads an 8-bit value from the analog-to-digital converter and sends it to the slave via SPI. The slave reads the value and displays it on an LCD display.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; The code given below does not work perfectly: the slave failed to received 10-20% of the messages sent by the master. In this example that failure rate was not critical, as the slave just missed an update of the ADC reading when it missed a message. If more accurate data transmission is required, the failure rate inherent in this system may be unacceptable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;SPI Mode Numbers&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four SPI &amp;quot;modes&amp;quot; which describe the relationship between the phase of the clock line and the phase of the MISO/MOSI lines. In order to successfully communicate using SPI, the master and slave must operate using the same mode. [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Mode_Numbers Wikipedia] has a good explanation of these mode numbers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The Slave Select Line&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to being used to select which slave is active during a communication, the slave select (SS) line, is vital for synchronization. A slave&amp;#039;s SS line should be high except when the master is talking to it. When the SS line is pulled low, the slave knows that a new communication is starting. &lt;br /&gt;
&lt;br /&gt;
If a slave fails to receive a message properly, it will be reset when the SS line goes high at the end of the message and the slave will be prepared for a new message when the SS line goes low again. If the SS line is not used (e.g. by disabling it or running it directly to ground) there is a risk of the slave becoming out of sync with the master; if the slave misses a bit, it will always be one bit off in the future. Effective use of the SS line allows the slave and master to realign themselves at the beginning of each communication, in case of a transmission error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Master Code:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#device ADC=8&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
//These define the different SPI modes in terms of constants the compiler knows about&lt;br /&gt;
//NOTE: our PICs only seemed to work in modes 1 and 3, though they are supposed to work with any modes&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H) &lt;br /&gt;
&lt;br /&gt;
#define SS_PIN PIN_D0         //this can be any output pin on the master&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   int val;&lt;br /&gt;
&lt;br /&gt;
   //Set up the ADC to read from A0&lt;br /&gt;
   setup_adc_ports(AN0);&lt;br /&gt;
   setup_adc(ADC_CLOCK_INTERNAL);&lt;br /&gt;
   set_adc_channel(0);&lt;br /&gt;
&lt;br /&gt;
   //The next statement sets up the SPI hardware, with this PIC as a master using mode 1&lt;br /&gt;
   //SPI_CLK_DIV_64 sets the speed of the SPI clock pulses--this is the slowest speed&lt;br /&gt;
   setup_spi(SPI_MASTER | SPI_MODE_1 | SPI_CLK_DIV_64); &lt;br /&gt;
   &lt;br /&gt;
   while(true) {&lt;br /&gt;
       val = read_adc();      //read the value to be sent&lt;br /&gt;
       &lt;br /&gt;
       output_low(SS_PIN);    //pull the slave select line low to select the slave&lt;br /&gt;
       delay_us(10);          //give the slave time to notice this (may be unnecessary)&lt;br /&gt;
       &lt;br /&gt;
       spi_write(val);        //send the value&lt;br /&gt;
       &lt;br /&gt;
       delay_us(10);          //(may be unnecessary)&lt;br /&gt;
       output_high(SS_PIN);   //deselect the slave. &lt;br /&gt;
       &lt;br /&gt;
       delay_ms(10);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Slave Code:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;LCD.C&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   setup_spi(SPI_SLAVE | SPI_MODE_1); //set up SPI hardware as a slave in mode 1&lt;br /&gt;
   &lt;br /&gt;
   lcd_init();&lt;br /&gt;
   &lt;br /&gt;
   while(true) {&lt;br /&gt;
       val = spi_read(0); //spi_read must be passed an argument. The argument value is sent&lt;br /&gt;
                          //back to the master whenever the master sends us a message again. &lt;br /&gt;
                          //This allows two-way communication, but here the master ignores&lt;br /&gt;
                          //whatever the slave sends back, so just send a 0.&lt;br /&gt;
&lt;br /&gt;
       //display the value read:&lt;br /&gt;
       lcd_gotoxy(1, 1);&lt;br /&gt;
       printf(lcd_putc, &amp;quot;Pot at: %u   &amp;quot;, val);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Alternative Slave Code, Using Interrupts:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;LCD.C&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)&lt;br /&gt;
&lt;br /&gt;
#int_ssp //this interrupt will occur whenever we receive an SPI message (or an I2C message, actually)&lt;br /&gt;
void message_receieved() {&lt;br /&gt;
    unsigned int val;&lt;br /&gt;
&lt;br /&gt;
    val = spi_read(); //When you don&amp;#039;t pass an argument, spi_read just returns the most&lt;br /&gt;
                      //recently received SPI message. We can do this here because we know&lt;br /&gt;
                      //that we just received a new message.&lt;br /&gt;
&lt;br /&gt;
    //display the value:&lt;br /&gt;
    lcd_gotoxy(1, 1);&lt;br /&gt;
    printf(lcd_putc, &amp;quot;Pot at: %u   &amp;quot;, val);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   setup_spi(SPI_SLAVE | SPI_MODE_1); //setup the PIC as a slave in mode 1&lt;br /&gt;
   enable_interrupts(INT_SSP); //enable interrupts on SPI messages&lt;br /&gt;
   enable_interrupts(GLOBAL);&lt;br /&gt;
   &lt;br /&gt;
   lcd_init();&lt;br /&gt;
   &lt;br /&gt;
   while(true); //sit and wait for a message&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Two-way communication&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Though not shown above, it is possible to use SPI for two-way communication between master and slave. If the slave calls&lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_master = spi_read(123);&amp;lt;/pre&amp;gt;&lt;br /&gt;
It will wait for the master to send some clock pulses; when the clock pulses come the slave will simultaneously read the message being sent by the master and send its own message (the number 123). The master, for its part, will call&lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_slave = spi_read(22);&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will cause the master to send the number 22 to the slave and simultaneously read the message sent back by the slave (in this case the number 123). So the master and slave have exchanged one byte of information. If you are the master and you just want to get a byte from the slave without sending one, just send a junk value, which the slave will discard: &lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_slave = spi_read(0);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Useful resources&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10604</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10604"/>
		<updated>2009-02-12T06:36:37Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, but SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously. There is no standard communication protocol for SPI.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|I2C]] (another type of serial data communication). SPI can communicate at much higher data rates than I2C. Furthermore, when multiple slaves are present, SPI requires no addressing to differentiate between these slaves. Compared to parallel buses, SPI has the additional benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out; each side sends and receives one bit of information. Because there is no standard communication protocol, the master can either send data or both send and receive data, depending on the needs of the application. Likewise, the slave can either receive data or both receive and send data back to the master.&lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master chooses which slave with which to communicate. Note that more than one slave may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the schematic diagram shown above. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/ SPI Background](www.totalphase.com)&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus SPI Wikipedia Article] (www.wikipedia.org)&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html More Information] (www.mct.net)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&amp;lt;b&amp;gt;Master connected to three slaves:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png]]&lt;br /&gt;
&lt;br /&gt;
Here each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;One PIC master and one PIC slave:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The master, on the left, and the slave, on the right, are connected as shown above. Be sure you also connect grounds!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
SPI communication on the PIC is accomplished via the functions spi_read() and spi_write(), which read and write one byte at a time over SPI. In the example below, the master reads an 8-bit value from the analog-to-digital converter and sends it to the slave via SPI. The slave reads the value and displays it on an LCD display.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; The code given below does not work perfectly: the slave failed to received 10-20% of the messages sent by the master. In this example that failure rate was not critical, as the slave just missed an update of the ADC reading when it missed a message. If more accurate data transmission is required, the failure rate inherent in this system may be unacceptable. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;SPI Mode Numbers&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are four SPI &amp;quot;modes&amp;quot; which describe the relationship between the phase of the clock line and the phase of the MISO/MOSI lines. In order to successfully communicate using SPI, the master and slave must operate using the same mode. [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Mode_Numbers Wikipedia] has a good explanation of these mode numbers. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;The Slave Select Line&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to being used to select which slave is active during a communication, the slave select (SS) line, is vital for synchronization. A slave&amp;#039;s SS line should be high except when the master is talking to it. When the SS line is pulled low, the slave knows that a new communication is starting. &lt;br /&gt;
&lt;br /&gt;
If a slave fails to receive a message properly, it will be reset when the SS line goes high at the end of the message and the slave will be prepared for a new message when the SS line goes low again. If the SS line is not used (e.g. by disabling it or running it directly to ground) there is a risk of the slave becoming out of sync with the master; if the slave misses a bit, it will always be one bit off in the future. Effective use of the SS line allows the slave and master to realign themselves at the beginning of each communication, in case of a transmission error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Master Code:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#device ADC=8&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
//These define the different SPI modes in terms of constants the compiler knows about&lt;br /&gt;
//NOTE: our PICs only seemed to work in modes 1 and 3, though they are supposed to work with any modes&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H) &lt;br /&gt;
&lt;br /&gt;
#define SS_PIN PIN_D0         //this can be any output pin on the master&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   int val;&lt;br /&gt;
&lt;br /&gt;
   //Set up the ADC to read from A0&lt;br /&gt;
   setup_adc_ports(AN0);&lt;br /&gt;
   setup_adc(ADC_CLOCK_INTERNAL);&lt;br /&gt;
   set_adc_channel(0);&lt;br /&gt;
&lt;br /&gt;
   //The next statement sets up the SPI hardware, with this PIC as a master using mode 1&lt;br /&gt;
   //SPI_CLK_DIV_64 sets the speed of the SPI clock pulses--this is the slowest speed&lt;br /&gt;
   setup_spi(SPI_MASTER | SPI_MODE_1 | SPI_CLK_DIV_64); &lt;br /&gt;
   &lt;br /&gt;
   while(true) {&lt;br /&gt;
       val = read_adc();      //read the value to be sent&lt;br /&gt;
       &lt;br /&gt;
       output_low(SS_PIN);    //pull the slave select line low to select the slave&lt;br /&gt;
       delay_us(10);          //give the slave time to notice this (may be unnecessary)&lt;br /&gt;
       &lt;br /&gt;
       spi_write(val);        //send the value&lt;br /&gt;
       &lt;br /&gt;
       delay_us(10);          //(may be unnecessary)&lt;br /&gt;
       output_high(SS_PIN);   //deselect the slave. &lt;br /&gt;
       &lt;br /&gt;
       delay_ms(10);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Slave Code:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;LCD.C&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   setup_spi(SPI_SLAVE | SPI_MODE_1); //set up SPI hardware as a slave in mode 1&lt;br /&gt;
   &lt;br /&gt;
   lcd_init();&lt;br /&gt;
   &lt;br /&gt;
   while(true) {&lt;br /&gt;
       val = spi_read(0); //spi_read must be passed an argument. The argument value is sent&lt;br /&gt;
                          //back to the master whenever the master sends us a message again. &lt;br /&gt;
                          //This allows two-way communication, but here the master ignores&lt;br /&gt;
                          //whatever the slave sends back, so just send a 0.&lt;br /&gt;
&lt;br /&gt;
       //display the value read:&lt;br /&gt;
       lcd_gotoxy(1, 1);&lt;br /&gt;
       printf(lcd_putc, &amp;quot;Pot at: %u   &amp;quot;, val);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Alternative Slave Code, Using Interrupts:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses EC,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=40000000)&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;LCD.C&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H)&lt;br /&gt;
#define SPI_MODE_1 (SPI_L_TO_H)&lt;br /&gt;
#define SPI_MODE_2 (SPI_H_TO_L)&lt;br /&gt;
#define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)&lt;br /&gt;
&lt;br /&gt;
#int_ssp //this interrupt will occur whenever we receive an SPI message (or an I2C message, actually)&lt;br /&gt;
void message_receieved() {&lt;br /&gt;
    unsigned int val;&lt;br /&gt;
&lt;br /&gt;
    val = spi_read(); //When you don&amp;#039;t pass an argument, spi_read just returns the most&lt;br /&gt;
                      //recently received SPI message. We can do this here because we know&lt;br /&gt;
                      //that we just received a new message.&lt;br /&gt;
&lt;br /&gt;
    //display the value:&lt;br /&gt;
    lcd_gotoxy(1, 1);&lt;br /&gt;
    printf(lcd_putc, &amp;quot;Pot at: %u   &amp;quot;, val);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
   setup_spi(SPI_SLAVE | SPI_MODE_1); //setup the PIC as a slave in mode 1&lt;br /&gt;
   enable_interrupts(INT_SSP); //enable interrupts on SPI messages&lt;br /&gt;
   enable_interrupts(GLOBAL);&lt;br /&gt;
   &lt;br /&gt;
   lcd_init();&lt;br /&gt;
   &lt;br /&gt;
   while(true); //sit and wait for a message&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Two-way communication&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Though not shown above, it is possible to use SPI for two-way communication between master and slave. If the slave calls&lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_master = spi_read(123);&amp;lt;/pre&amp;gt;&lt;br /&gt;
It will wait for the master to send some clock pulses; when the clock pulses come the slave will simultaneously read the message being sent by the master and send its own message (the number 123). The master, for its part, will call&lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_slave = spi_read(22);&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will cause the master to send the number 22 to the slave and simultaneously read the message sent back by the slave (in this case the number 123). So the master and slave have exchanged one byte of information. If you are the master and you just want to get a byte from the slave without sending one, just send a junk value, which the slave will discard: &lt;br /&gt;
&amp;lt;pre&amp;gt;message_from_slave = spi_read(0);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Useful resources&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10117</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10117"/>
		<updated>2009-02-05T03:56:20Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, but SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously. There is no standard communication protocol for SPI.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|I2C]] (another type of serial data communication). SPI can communicate at much higher data rates than I2C. Furthermore, when multiple slaves are present, SPI requires no addressing to differentiate between these slaves. Compared to parallel buses, SPI has the additional benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png|thumbnail|right]]&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out; each side sends and receives one bit of information. Because there is no standard communication protocol, the master can either send data or both send and receive data, depending on the needs of the application. Likewise, the slave can either receive data or both receive and send data back to the master.&lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master chooses which slave with which to communicate. Note that more than one slave may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the schematic diagram shown above. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/#modes SPI Background].www.totalphase.com&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface]. Www.wikipedia.org&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html mct.net]&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-circuit.jpg]]&lt;br /&gt;
&lt;br /&gt;
see [http://www.totalphase.com/support/articles/article03/#modes www.totalphase.com]&lt;br /&gt;
&lt;br /&gt;
Above shows the Master connected to three slaves. Each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The two PICs can be wired directly by connecting these input and output pins of the diagram above.&lt;br /&gt;
&lt;br /&gt;
== Code (Code mentioned on this page does NOT work when tried with the PIC18F4520) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*MASTER CODE*/&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave and so we have commented out code that should be included if an output pin (PIN_D0 in this case) of &lt;br /&gt;
the master is connected to the SS pin of the slave/ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
int value; 	//for 8 bit transfer which is default&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16); // sets the PIC as a master which generates the clock signal, a slower clock can be  generated by changing 16 to 64&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
      value = 4;     // value to be sent to spi&lt;br /&gt;
&lt;br /&gt;
    //output_low(PIN_D0); //Turns on slave if slave select is used           &lt;br /&gt;
    &lt;br /&gt;
      spi_write(value);&lt;br /&gt;
    &lt;br /&gt;
      value_read = spi_read();&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
  &lt;br /&gt;
   // output_high(PIN_D0); //Turns off slave if slave select is used   &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*SLAVE CODE*/&lt;br /&gt;
&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave */&lt;br /&gt;
/* In most cases, simply grounding the SS pin of the slave should work */&lt;br /&gt;
/* slave code is really hard to find on the internet */&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
 	&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_SLAVE|SPI_H_TO_L); // sets the PIC as a slave which recieves a clock signal and data is transferred during H to L&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
          &lt;br /&gt;
      value_read = spi_read(); // according to the reference manual this should work but also see the code below&lt;br /&gt;
&lt;br /&gt;
     // if(spi_data_is_in())   // Checks to see if data is ready to be read&lt;br /&gt;
	//	value_read = spi_read(); //reads the data from spi&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
&lt;br /&gt;
      output_d(value_read);  //display the number that has been read&lt;br /&gt;
      spi_write(0);        // This is probably unnecessary&lt;br /&gt;
  &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* WATCH OUT FOR UPDATES */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the sample code was obtained from the following sources&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10116</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10116"/>
		<updated>2009-02-05T03:50:45Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, but SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously. There is no standard communication protocol for SPI.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|I2C]] (another type of serial data communication). SPI can communicate at much higher data rates than I2C. Furthermore, when multiple slaves are present, SPI requires no addressing to differentiate between these slaves. Compared to parallel buses, SPI has the additional benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png|thumbnail|right]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out; each side sends and receives one bit of information. Because there is no standard communication protocol, the master can either send data or both send and receive data, depending on the needs of the application. Likewise, the slave can either receive data or both receive and send data back to the master.&lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master chooses which slave with which to communicate. Note that more than one slave may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the schematic diagram shown above. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/#modes SPI Background].www.totalphase.com&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface]. Www.wikipedia.org&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html mct.net]&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-circuit.jpg]]&lt;br /&gt;
&lt;br /&gt;
see [http://www.totalphase.com/support/articles/article03/#modes www.totalphase.com]&lt;br /&gt;
&lt;br /&gt;
Above shows the Master connected to three slaves. Each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The two PICs can be wired directly by connecting these input and output pins of the diagram above.&lt;br /&gt;
&lt;br /&gt;
== Code (Code mentioned on this page does NOT work when tried with the PIC18F4520) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*MASTER CODE*/&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave and so we have commented out code that should be included if an output pin (PIN_D0 in this case) of &lt;br /&gt;
the master is connected to the SS pin of the slave/ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
int value; 	//for 8 bit transfer which is default&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16); // sets the PIC as a master which generates the clock signal, a slower clock can be  generated by changing 16 to 64&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
      value = 4;     // value to be sent to spi&lt;br /&gt;
&lt;br /&gt;
    //output_low(PIN_D0); //Turns on slave if slave select is used           &lt;br /&gt;
    &lt;br /&gt;
      spi_write(value);&lt;br /&gt;
    &lt;br /&gt;
      value_read = spi_read();&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
  &lt;br /&gt;
   // output_high(PIN_D0); //Turns off slave if slave select is used   &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*SLAVE CODE*/&lt;br /&gt;
&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave */&lt;br /&gt;
/* In most cases, simply grounding the SS pin of the slave should work */&lt;br /&gt;
/* slave code is really hard to find on the internet */&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
 	&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_SLAVE|SPI_H_TO_L); // sets the PIC as a slave which recieves a clock signal and data is transferred during H to L&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
          &lt;br /&gt;
      value_read = spi_read(); // according to the reference manual this should work but also see the code below&lt;br /&gt;
&lt;br /&gt;
     // if(spi_data_is_in())   // Checks to see if data is ready to be read&lt;br /&gt;
	//	value_read = spi_read(); //reads the data from spi&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
&lt;br /&gt;
      output_d(value_read);  //display the number that has been read&lt;br /&gt;
      spi_write(0);        // This is probably unnecessary&lt;br /&gt;
  &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* WATCH OUT FOR UPDATES */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the sample code was obtained from the following sources&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10115</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10115"/>
		<updated>2009-02-05T03:41:18Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, but SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously. There is no standard communication protocol for SPI.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|I2C]] (another type of serial data communication). SPI can communicate at much higher data rates than I2C. Furthermore, when multiple slaves are present, SPI requires no addressing to differentiate between these slaves. Compared to parallel buses, SPI has the additional benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png|right]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out; each side sends and receives one bit of information. Because there is no standard communication protocol, the master can either send data or both send and receive data, depending on the needs of the application. Likewise, the slave can either receive data or both receive and send data back to the master. &lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master also chooses which slave with which to communicate. Note that multiple slaves may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the diagram to the right. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/#modes SPI Background].www.totalphase.com&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface]. Www.wikipedia.org&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html mct.net]&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-circuit.jpg]]&lt;br /&gt;
&lt;br /&gt;
see [http://www.totalphase.com/support/articles/article03/#modes www.totalphase.com]&lt;br /&gt;
&lt;br /&gt;
Above shows the Master connected to three slaves. Each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The two PICs can be wired directly by connecting these input and output pins of the diagram above.&lt;br /&gt;
&lt;br /&gt;
== Code (Code mentioned on this page does NOT work when tried with the PIC18F4520) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*MASTER CODE*/&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave and so we have commented out code that should be included if an output pin (PIN_D0 in this case) of &lt;br /&gt;
the master is connected to the SS pin of the slave/ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
int value; 	//for 8 bit transfer which is default&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16); // sets the PIC as a master which generates the clock signal, a slower clock can be  generated by changing 16 to 64&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
      value = 4;     // value to be sent to spi&lt;br /&gt;
&lt;br /&gt;
    //output_low(PIN_D0); //Turns on slave if slave select is used           &lt;br /&gt;
    &lt;br /&gt;
      spi_write(value);&lt;br /&gt;
    &lt;br /&gt;
      value_read = spi_read();&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
  &lt;br /&gt;
   // output_high(PIN_D0); //Turns off slave if slave select is used   &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*SLAVE CODE*/&lt;br /&gt;
&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave */&lt;br /&gt;
/* In most cases, simply grounding the SS pin of the slave should work */&lt;br /&gt;
/* slave code is really hard to find on the internet */&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
 	&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_SLAVE|SPI_H_TO_L); // sets the PIC as a slave which recieves a clock signal and data is transferred during H to L&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
          &lt;br /&gt;
      value_read = spi_read(); // according to the reference manual this should work but also see the code below&lt;br /&gt;
&lt;br /&gt;
     // if(spi_data_is_in())   // Checks to see if data is ready to be read&lt;br /&gt;
	//	value_read = spi_read(); //reads the data from spi&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
&lt;br /&gt;
      output_d(value_read);  //display the number that has been read&lt;br /&gt;
      spi_write(0);        // This is probably unnecessary&lt;br /&gt;
  &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* WATCH OUT FOR UPDATES */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the sample code was obtained from the following sources&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10113</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10113"/>
		<updated>2009-02-05T03:27:40Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, however SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|IC2]] (another type of serial data communication). SPI can send much higher rates of data than I2C and requires no addressing to separate slave devices. Compared to parallel buses, SPI has the benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
There is no standard communication protocol for SPI. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Peripheral devices that still use SPI:&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png|right]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. Within each clock cycle a full duplex communication is carried out.&lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master also chooses which slave with which to communicate. Note that multiple slaves may be selected, simply by applying a logic low to the desired SS lines, as illustrated in the diagram to the right. If a given slave is not selected (its SS is high) it disregards signals sent by the master. &lt;br /&gt;
&lt;br /&gt;
As such, depending on the application, the the master can either send data or both send and receive data. Likewise, slave can then either receive data or both receive and send data back to the master. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/#modes SPI Background].www.totalphase.com&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface]. Www.wikipedia.org&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html mct.net]&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-circuit.jpg]]&lt;br /&gt;
&lt;br /&gt;
see [http://www.totalphase.com/support/articles/article03/#modes www.totalphase.com]&lt;br /&gt;
&lt;br /&gt;
Above shows the Master connected to three slaves. Each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The two PICs can be wired directly by connecting these input and output pins of the diagram above.&lt;br /&gt;
&lt;br /&gt;
== Code (Code mentioned on this page does NOT work when tried with the PIC18F4520) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*MASTER CODE*/&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave and so we have commented out code that should be included if an output pin (PIN_D0 in this case) of &lt;br /&gt;
the master is connected to the SS pin of the slave/ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
int value; 	//for 8 bit transfer which is default&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16); // sets the PIC as a master which generates the clock signal, a slower clock can be  generated by changing 16 to 64&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
      value = 4;     // value to be sent to spi&lt;br /&gt;
&lt;br /&gt;
    //output_low(PIN_D0); //Turns on slave if slave select is used           &lt;br /&gt;
    &lt;br /&gt;
      spi_write(value);&lt;br /&gt;
    &lt;br /&gt;
      value_read = spi_read();&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
  &lt;br /&gt;
   // output_high(PIN_D0); //Turns off slave if slave select is used   &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*SLAVE CODE*/&lt;br /&gt;
&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave */&lt;br /&gt;
/* In most cases, simply grounding the SS pin of the slave should work */&lt;br /&gt;
/* slave code is really hard to find on the internet */&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
 	&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_SLAVE|SPI_H_TO_L); // sets the PIC as a slave which recieves a clock signal and data is transferred during H to L&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
          &lt;br /&gt;
      value_read = spi_read(); // according to the reference manual this should work but also see the code below&lt;br /&gt;
&lt;br /&gt;
     // if(spi_data_is_in())   // Checks to see if data is ready to be read&lt;br /&gt;
	//	value_read = spi_read(); //reads the data from spi&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
&lt;br /&gt;
      output_d(value_read);  //display the number that has been read&lt;br /&gt;
      spi_write(0);        // This is probably unnecessary&lt;br /&gt;
  &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* WATCH OUT FOR UPDATES */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the sample code was obtained from the following sources&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10108</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10108"/>
		<updated>2009-02-05T03:07:00Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, however SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|IC2]] (another type of serial data communication). SPI can send much higher rates of data than I2C and requires no addressing to separate slave devices. Compared to parallel buses, SPI has the benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
Below are some peripheral devices that still use SPI.&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png|right]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. &lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master also chooses which slave with which to communicate. Note that multiple slaves may be selected, simply by applying a logic low bias to the desired SS lines, as illustrated in the diagram to the right. If a slave is not selected (SS is high) it disregards signals sent by the master. Although possible, multi-master systems are rarely implemented.&lt;br /&gt;
&lt;br /&gt;
Within each clock cycle a full duplex communication is carried out. Each bit is shuffled into the slave line and a bit is shuffled from the slave line back to the master line. The master first sends logic low to select the slave. There is no general protocol for the transmission. The slave can then either just receive or receive and reply to the Master. The Master can also either just send data or send and receive data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/#modes SPI Background].www.totalphase.com&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface]. Www.wikipedia.org&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html mct.net]&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-circuit.jpg]]&lt;br /&gt;
&lt;br /&gt;
see [http://www.totalphase.com/support/articles/article03/#modes www.totalphase.com]&lt;br /&gt;
&lt;br /&gt;
Above shows the Master connected to three slaves. Each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The two PICs can be wired directly by connecting these input and output pins of the diagram above.&lt;br /&gt;
&lt;br /&gt;
== Code (Code mentioned on this page does NOT work when tried with the PIC18F4520) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*MASTER CODE*/&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave and so we have commented out code that should be included if an output pin (PIN_D0 in this case) of &lt;br /&gt;
the master is connected to the SS pin of the slave/ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
int value; 	//for 8 bit transfer which is default&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16); // sets the PIC as a master which generates the clock signal, a slower clock can be  generated by changing 16 to 64&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
      value = 4;     // value to be sent to spi&lt;br /&gt;
&lt;br /&gt;
    //output_low(PIN_D0); //Turns on slave if slave select is used           &lt;br /&gt;
    &lt;br /&gt;
      spi_write(value);&lt;br /&gt;
    &lt;br /&gt;
      value_read = spi_read();&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
  &lt;br /&gt;
   // output_high(PIN_D0); //Turns off slave if slave select is used   &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*SLAVE CODE*/&lt;br /&gt;
&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave */&lt;br /&gt;
/* In most cases, simply grounding the SS pin of the slave should work */&lt;br /&gt;
/* slave code is really hard to find on the internet */&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
 	&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_SLAVE|SPI_H_TO_L); // sets the PIC as a slave which recieves a clock signal and data is transferred during H to L&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
          &lt;br /&gt;
      value_read = spi_read(); // according to the reference manual this should work but also see the code below&lt;br /&gt;
&lt;br /&gt;
     // if(spi_data_is_in())   // Checks to see if data is ready to be read&lt;br /&gt;
	//	value_read = spi_read(); //reads the data from spi&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
&lt;br /&gt;
      output_d(value_read);  //display the number that has been read&lt;br /&gt;
      spi_write(0);        // This is probably unnecessary&lt;br /&gt;
  &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* WATCH OUT FOR UPDATES */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the sample code was obtained from the following sources&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
	<entry>
		<id>https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10107</id>
		<title>SPI communication between PICs</title>
		<link rel="alternate" type="text/html" href="https://hades.mech.northwestern.edu//index.php?title=SPI_communication_between_PICs&amp;diff=10107"/>
		<updated>2009-02-05T03:06:49Z</updated>

		<summary type="html">&lt;p&gt;Alex Park: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Overview ==&lt;br /&gt;
SPI or [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface] is a communication method that was once used to connect devices such as printers, cameras, scanners, etc. to a desktop computer. This function has largely  been taken over by USB, however SPI can still be a useful communication tool for some applications. SPI runs using a master/slave set-up and can run in full duplex mode, meaning that signals can be transmitted between the master and the slave simultaneously.&lt;br /&gt;
&lt;br /&gt;
SPI is still used to control some peripheral devices and has some advantages over [[I2C communication between PICs|IC2]] (another type of serial data communication). SPI can send much higher rates of data than I2C and requires no addressing to separate slave devices. Compared to parallel buses, SPI has the benefit of requiring only simple wiring. &lt;br /&gt;
&lt;br /&gt;
Below are some peripheral devices that still use SPI.&lt;br /&gt;
&lt;br /&gt;
•	Converters (ADC and DAC)&lt;br /&gt;
&lt;br /&gt;
•	Memories (EEPROM and FLASH)&lt;br /&gt;
&lt;br /&gt;
•	Real Time Clocks (RTC)&lt;br /&gt;
&lt;br /&gt;
•	Sensors (temperature, pressure, etc.)&lt;br /&gt;
&lt;br /&gt;
•	Others (signal mixer, potentiometer, LCD controller, UART, CAN controller, USB controller, amplifier)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Basic Operation&amp;lt;/b&amp;gt;&lt;br /&gt;
SPI requires four lines, and is therefore often termed the “four wire” serial bus. These four lines are described in the table below.&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-diagram.png|right]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;3&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Line!! Name!! Description&lt;br /&gt;
|-&lt;br /&gt;
|SCLK||Serial Clock||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MOSI/SIMO||Master Output, Slave Input||Output from master&lt;br /&gt;
|-&lt;br /&gt;
|MISO/SOMI||Master Input, Slave Output||Output from slave&lt;br /&gt;
|-&lt;br /&gt;
|SS||Slave Select||Output from master (active low)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The master, as its name suggests, controls all communication. By controlling the clock, the master decides when data is sent and received. &lt;br /&gt;
&lt;br /&gt;
Using the “Slave Select” line, the master also chooses which slave with which to communicate. Note that multiple slaves may be selected, simply by applying a logic low bias to the desired SS lines, as illustrated in the diagram to the right. If a slave is not selected (SS is high) it disregards signals sent by the master. Although possible, multi-master systems are rarely implemented.&lt;br /&gt;
&lt;br /&gt;
Within each clock cycle a full duplex communication is carried out. Each bit is shuffled into the slave line and a bit is shuffled from the slave line back to the master line. The master first sends logic low to select the slave. There is no general protocol for the transmission. The slave can then either just receive or receive and reply to the Master. The Master can also either just send data or send and receive data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References&amp;lt;b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://www.totalphase.com/support/articles/article03/#modes SPI Background].www.totalphase.com&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Serial Peripheral Interface]. Www.wikipedia.org&lt;br /&gt;
&lt;br /&gt;
[http://www.mct.net/faq/spi.html mct.net]&lt;br /&gt;
&lt;br /&gt;
== Circuit ==&lt;br /&gt;
&lt;br /&gt;
[[Image:spi-circuit.jpg]]&lt;br /&gt;
&lt;br /&gt;
see [http://www.totalphase.com/support/articles/article03/#modes www.totalphase.com]&lt;br /&gt;
&lt;br /&gt;
Above shows the Master connected to three slaves. Each slave must be enabled through the slave select pin in order to communicate with the Master. &lt;br /&gt;
&lt;br /&gt;
[[Image:spi.jpg]]&lt;br /&gt;
&lt;br /&gt;
The two PICs can be wired directly by connecting these input and output pins of the diagram above.&lt;br /&gt;
&lt;br /&gt;
== Code (Code mentioned on this page does NOT work when tried with the PIC18F4520) ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*MASTER CODE*/&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave and so we have commented out code that should be included if an output pin (PIN_D0 in this case) of &lt;br /&gt;
the master is connected to the SS pin of the slave/ &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
int value; 	//for 8 bit transfer which is default&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_16); // sets the PIC as a master which generates the clock signal, a slower clock can be  generated by changing 16 to 64&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
      value = 4;     // value to be sent to spi&lt;br /&gt;
&lt;br /&gt;
    //output_low(PIN_D0); //Turns on slave if slave select is used           &lt;br /&gt;
    &lt;br /&gt;
      spi_write(value);&lt;br /&gt;
    &lt;br /&gt;
      value_read = spi_read();&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
  &lt;br /&gt;
   // output_high(PIN_D0); //Turns off slave if slave select is used   &lt;br /&gt;
&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*SLAVE CODE*/&lt;br /&gt;
&lt;br /&gt;
/* This code is valid only for devices that support hardware spi such as the PIC18F4520. For all other devices use&lt;br /&gt;
software spi. This code does not work on PIC18F4520 and will require more experimentation. This is the code that&lt;br /&gt;
looks most promising to start with from our review of codes on the internet for hardware SPI*/&lt;br /&gt;
&lt;br /&gt;
/* For hardware spi, library functions such as spi_setup(), spi_read() and spi_write() can be used */&lt;br /&gt;
/* For software spi, spi_xfer() can be used alongwith the #use spi directive*/&lt;br /&gt;
/* We are not entirely sure if an output pin of the master should be connected to the SS pin (A5 for PIC18f4520) &lt;br /&gt;
of the slave */&lt;br /&gt;
/* In most cases, simply grounding the SS pin of the slave should work */&lt;br /&gt;
/* slave code is really hard to find on the internet */&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;18f4520.h&amp;gt;&lt;br /&gt;
#fuses HS,XT,NOLVP,NOWDT,NOPROTECT&lt;br /&gt;
#use delay(clock=20000000)&lt;br /&gt;
&lt;br /&gt;
void main(){&lt;br /&gt;
&lt;br /&gt;
 	&lt;br /&gt;
int value_read; // to be read from spi&lt;br /&gt;
&lt;br /&gt;
setup_spi(SPI_SLAVE|SPI_H_TO_L); // sets the PIC as a slave which recieves a clock signal and data is transferred during H to L&lt;br /&gt;
&lt;br /&gt;
 while (TRUE) {&lt;br /&gt;
        &lt;br /&gt;
          &lt;br /&gt;
      value_read = spi_read(); // according to the reference manual this should work but also see the code below&lt;br /&gt;
&lt;br /&gt;
     // if(spi_data_is_in())   // Checks to see if data is ready to be read&lt;br /&gt;
	//	value_read = spi_read(); //reads the data from spi&lt;br /&gt;
     &lt;br /&gt;
      delay_us(100);   &lt;br /&gt;
&lt;br /&gt;
      output_d(value_read);  //display the number that has been read&lt;br /&gt;
      spi_write(0);        // This is probably unnecessary&lt;br /&gt;
  &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/* WATCH OUT FOR UPDATES */&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most of the sample code was obtained from the following sources&lt;br /&gt;
&lt;br /&gt;
The CCS user manual&lt;br /&gt;
&lt;br /&gt;
[http://www.ccsinfo.com/forum/ CCS forum]&lt;/div&gt;</summary>
		<author><name>Alex Park</name></author>
	</entry>
</feed>