<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BrickEngineer: LEGO Design &#187; &#187; LEGO Electronics</title>
	<atom:link href="http://www.brickengineer.com/pages/tag/lego-electronics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brickengineer.com/pages</link>
	<description>LEGO Engineering for LEGO NXT and Robot Enthusiasts</description>
	<lastBuildDate>Tue, 10 Mar 2015 04:45:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.39</generator>
	<item>
		<title>LEGO NXT Motor Wiring</title>
		<link>http://www.brickengineer.com/pages/2008/09/05/lego-nxt-motor-wiring/</link>
		<comments>http://www.brickengineer.com/pages/2008/09/05/lego-nxt-motor-wiring/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 05:15:58 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[LEGO Engineering]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[LEGO]]></category>
		<category><![CDATA[LEGO Electronics]]></category>
		<category><![CDATA[LEGO mindstorms]]></category>
		<category><![CDATA[motor]]></category>
		<category><![CDATA[NXT]]></category>
		<category><![CDATA[wire]]></category>
		<category><![CDATA[wiring]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/2008/09/05/lego-nxt-motor-wiring/</guid>
		<description><![CDATA[After posting Hacking the LEGO Mindstorms NXT Standard Motor, I received several requests for more information regarding the wiring of the motor. The NXT cable has six wires. Below I list a table with the wires and their colors: Color Name White Motor 1 Black Motor 2 Red GND Green 4.3 Volts Yellow Tach01 Blue [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>After posting <a href="http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-standard-motor/" title="Hacking the LEGO Motor">Hacking the LEGO Mindstorms NXT Standard Motor</a>, I received several requests for more information regarding the wiring of the motor.</p>
<p>The NXT cable has six wires.   Below I list a table with the wires and their colors:</p>
<table>
<tr>
<td><strong>Color    </strong></td>
<td><strong>Name</strong></td>
</tr>
<tr>
<td>White</td>
<td>Motor 1</td>
</tr>
<tr>
<td>Black</td>
<td>Motor 2</td>
</tr>
<tr>
<td>Red</td>
<td>GND</td>
</tr>
<tr>
<td>Green</td>
<td>4.3 Volts</td>
</tr>
<tr>
<td>Yellow</td>
<td>Tach01</td>
</tr>
<tr>
<td>Blue</td>
<td>Tach02</td>
</tr>
</table>
<p>The WHITE and BLACK wires (Motor 1 and Motor 2) deliver power to the motor.<br />
If standard batteries are used, the potential difference will be 9 volts, otherwise the NiMH rechargeable batteries provide 7.2 volts.  If the white wire is positive and black is negative, the motor will turn one way.  If you reverse the polarity, the motor will turn the other way.</p>
<p>The RED wire is connected to the ground (GND).  Note that in the sensors, RED and BLACK are connected to one another.  This is not the case in the motors.</p>
<p>The GREEN wire is connected to the +4.3 NXT power supply.</p>
<p>The YELLOW and BLUE wires are connected to the <a href="http://en.wikipedia.org/wiki/Rotary_encoder">quadrature encoder</a>, also called an <a href="http://en.wikipedia.org/wiki/Rotary_encoder">incremental rotary encoder</a>.</p>
<p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/c/c1/Basic-Rotary.jpg/180px-Basic-Rotary.jpg" alt="Basic Rotary Encoder" align="middle" height="179" width="180" /></p>
<p><a href="http://en.wikipedia.org/wiki/Quadrature_encoder"><img src="http://upload.wikimedia.org/wikipedia/en/thumb/6/68/Quadrature_Diagram.svg/300px-Quadrature_Diagram.svg.png" alt="Square waves from quadrature encoder" align="middle" /></a></p>
<p>As shown in the figure from Wikipedia above, (<a href="http://en.wikipedia.org/wiki/Quadrature_encoder">http://en.wikipedia.org/wiki/Quadrature_encoder</a>) the wires return square wave pulses that are 90 degrees out of phase.  If the rising pulse on TACH00 leads the rising pulse of TACH01 by 90 degrees, then the motor is going forward.  If it instead lags by 90 degrees, the motor is rotating backwards.  One complete square wave cycle corresponds to 2 degrees of rotation.  In the diagram above, if TACH00 refers to A and TACH01 refers to B, we can see that the motor is going backwards as TACH00 is lagging TACH 01.</p>
<p>By measuring the frequency of the square wave oscillation, one can compute the rotational velocity.  Since one cycle corresponds to 2 degrees of rotation, one cycle per second (1 Hz) corresponds to 2 degrees/sec.  If you record a frequency of X Hz, then the rotation rate is 2X cycles/sec.</p>
<p>Note also that by tracking both square waves, you can identify quarter cycles, which gives you a resolution of 1/4 of 2 degrees, which is 0.5 degrees.</p>
<p>The motor speed is controlled by <a href="http://en.wikipedia.org/wiki/Pulse-width_modulation">pulse-width modulation</a> (pwm), which works by driving the motor with a variable duty cycle square wave.  This effectively turns the motor on and off, fast.  The longer it is on, the more torque it will generate and the faster it will go.</p>
<p>These details and more can be found in the excellent book: Extreme: NXT with a sneak peak <a href="http://books.google.com/books?id=ze1vS5f4apUC&amp;pg=PA32&amp;lpg=PA32&amp;dq=lego+mindstorms+quadrature+encoder&amp;source=web&amp;ots=AdmPVFnk6s&amp;sig=RY_mOg7YTePFTb_YMg-slF0VP-w&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=7&amp;ct=result#PPA32,M1">here</a>.</p>
<p>Additional details can be found in the excellent book <a href="http://www.amazon.com/gp/product/1590598180?ie=UTF8&amp;tag=onlicort-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598180">Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level (Technology in Action)</a><img src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&amp;l=as2&amp;o=1&amp;a=1590598180" style="border: medium none ; margin: 0px" border="0" height="1" width="1" /> by Michael Gasperi, Philippe E. Hurbain, and Isabelle L. Hurbain.</p>
<p><a href="http://www.amazon.com/gp/product/1590598180?ie=UTF8&amp;tag=onlicort-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598180"><img src="http://www.brickengineer.com/pages/pics/books/extreme-nxt.jpg" border="0" /></a><img src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&amp;l=as2&amp;o=1&amp;a=1590598180" style="border: medium none ; margin: 0px" border="0" height="1" width="1" /></p>
<p>Philo uploaded a comment, and reminded me that &#8220;Note that there are some internal photos of the NXT motor here: <a href="http://philohome.com/nxtmotor/nxtmotor.htm" onclick="javascript:pageTracker._trackPageview('/outgoing/philohome.com/nxtmotor/nxtmotor.htm');" rel="nofollow">http://philohome.com/nxtmotor/nxtmotor.htm</a> and schematics here: <a href="http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1846577" onclick="javascript:pageTracker._trackPageview('/outgoing/www.brickshelf.com/cgi-bin/gallery.cgi?i=1846577');" rel="nofollow">http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1846577</a>&#8221;</p>
<p>Happy Hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2008/09/05/lego-nxt-motor-wiring/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Hacking the LEGO Mindstorms NXT Standard Motor</title>
		<link>http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-standard-motor/</link>
		<comments>http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-standard-motor/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 14:20:33 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[LEGO Engineering]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[interfacing]]></category>
		<category><![CDATA[LEGO]]></category>
		<category><![CDATA[LEGO Electronics]]></category>
		<category><![CDATA[mindstorms]]></category>
		<category><![CDATA[motor]]></category>
		<category><![CDATA[NXT]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-standard-motor/</guid>
		<description><![CDATA[We are working on interfacing the LEGO sensors and motors to a compact lightweight computer for more sophisticated control. Aret Carlsen brings us a video demonstrating how one can hack into the NXT Standard Motor: See also quadrature encoder or rotary encoder at wikipedia and the LEGO NXT Hardware Developers Kit (LEGO NXT data sheets). [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We are working on interfacing the LEGO sensors and motors to a compact lightweight computer for more sophisticated control. Aret Carlsen brings us a video demonstrating how one can hack into the NXT Standard Motor:</p>
<p><object width="350" height="292"><param name="movie" value="http://www.youtube.com/v/_NQ3qng_b80&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/_NQ3qng_b80&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="350" height="292"></embed></object></p>
<p>See also quadrature encoder or <a href="http://en.wikipedia.org/wiki/Rotary_encoder">rotary encoder</a> at wikipedia and the <a href="http://mindstorms.lego.com/Overview/NXTreme.aspx">LEGO NXT Hardware Developers Kit</a> (LEGO NXT data sheets). Philo also has the pinout diagram on his page on <a href="http://www.philohome.com/nxtpwr/pwr.htm">deriving power from the Motor A port</a>.</p>
<p>Additional details can be found in the excellent book <a href="http://www.amazon.com/gp/product/1590598180?ie=UTF8&amp;tag=onlicort-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598180">Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level (Technology in Action)</a><img border="0" width="1" src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&amp;l=as2&amp;o=1&amp;a=1590598180" height="1" style="margin: 0px; border: medium none" /> by Michael Gasperi, Philippe E. Hurbain, and Isabelle L. Hurbain.</p>
<p><a href="http://www.amazon.com/gp/product/1590598180?ie=UTF8&amp;tag=onlicort-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598180"><img border="0" src="http://www.brickengineer.com/pages/pics/books/extreme-nxt.jpg" /></a><img border="0" width="1" src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&amp;l=as2&amp;o=1&amp;a=1590598180" height="1" style="margin: 0px; border: medium none" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-standard-motor/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Hacking the LEGO Mindstorms NXT Light Sensor</title>
		<link>http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-light-sensor/</link>
		<comments>http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-light-sensor/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 13:59:13 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[LEGO Engineering]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[LEGO]]></category>
		<category><![CDATA[LEGO Electronics]]></category>
		<category><![CDATA[mindstorms]]></category>
		<category><![CDATA[NXT]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-light-sensor/</guid>
		<description><![CDATA[We are working on interfacing the LEGO sensors and motors to a compact lightweight computer for more sophisticated control.  Aret Carlsen brings us a video demonstrating how one can hack into the NXT Light Sensor: Additional details can be found in the excellent book Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We are working on interfacing the LEGO sensors and motors to a compact lightweight computer for more sophisticated control.  Aret Carlsen brings us a video demonstrating how one can hack into the NXT Light Sensor:</p>
<p><object width="350" height="292"><param name="movie" value="http://www.youtube.com/v/H7YjkqnqaY0&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/H7YjkqnqaY0&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="350" height="292"></embed></object></p>
<p>Additional details can be found in the excellent book <a href="http://www.amazon.com/gp/product/1590598180?ie=UTF8&amp;tag=onlicort-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598180">Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level (Technology in Action)</a><img border="0" width="1" src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&amp;l=as2&amp;o=1&amp;a=1590598180" height="1" style="margin: 0px; border: medium none" /> by Michael Gasperi, Philippe E. Hurbain, and Isabelle L. Hurbain.</p>
<p><a href="http://www.amazon.com/gp/product/1590598180?ie=UTF8&amp;tag=onlicort-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590598180"><img border="0" src="http://www.brickengineer.com/pages/pics/books/extreme-nxt.jpg" /></a><img border="0" width="1" src="http://www.assoc-amazon.com/e/ir?t=onlicort-20&amp;l=as2&amp;o=1&amp;a=1590598180" height="1" style="margin: 0px; border: medium none" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brickengineer.com/pages/2008/04/05/hacking-the-lego-mindstorms-nxt-light-sensor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
