0% found this document useful (0 votes)
186 views5 pages

NXShield User Guide

NXShield is an Arduino shield designed to control NXT motors and sensors. It connects directly to an Arduino board and can be used with other shields. NXShield gets power from external batteries and has motor and sensor ports that can be programmed and read using the Arduino IDE and NXShield library.

Uploaded by

Filipe Escalise
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views5 pages

NXShield User Guide

NXShield is an Arduino shield designed to control NXT motors and sensors. It connects directly to an Arduino board and can be used with other shields. NXShield gets power from external batteries and has motor and sensor ports that can be programmed and read using the Arduino IDE and NXShield library.

Uploaded by

Filipe Escalise
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NXShield v1.

0 User Guide

What is NXShield
NXShield is a shield designed for Arduino to control NXT Motors and operate NXT Sensors. There are different models of NXShield, designed to work with different Arduino boards as follows: Model Name NXShield (or NXShield !" NXShield M Supported Arduino boards Arduino !uemilano#e Arduino $no (or clones with similar form factor" Arduino Mega%&'( Android A!)

Connections and Placement


NXShield is designed to connect directl* o#er Arduino board b* connecting o#er it+s header pins. ,ou can use it -ointl* with other shields, pro#ided there is no conflict between Arduino pins used b* the two shields. (.efer to /Arduino 0ins $sed b* NXShield+ section for details". Supplying power to your NXShield The NXShield has 1reen terminals to connect e2ternal batter*3 this batter* will also suppl* power to attached Arduino. ,ou do not need to power Arduino with different power source3 howe#er suppl*ing e2ternal power to Arduino (such as through $S4" is also ok. NOTE NXShield is rated for e2ternal power suppl* of 5(.& #olts !6 ma2. 7nsure to not e2ceed this #alue. 8hile connecting e2ternal batter*, ensure correct polarit*. 8hile using motors or ser#os, at least '.' #olts power is needed. Recommended Battery Options 'AA batteries (rechargeable or non rechargeable". 6op*right 9 %(55 :pen7lectrons.com 5;&

To hold and mount these batteries, *ou can purchase a holder with NXT mounts as shown here from Mindsensors.com website. <.= > ?i @on batter* or A.'>olts Ni 6! or Ni MB .6 rechargeable batter*. ,ou can bu* such batter* and it+s charger in local to* store.

Mounting NXShield on your contraption The holes on the NXShield enclosure are designed for tight fit of Technic pins (or a2les" with /+ cross section. The holes howe#er are not designed for repeated insertions;remo#als of these pins. To mount NXShield on *our contraption we suggest that *ou use two dark gra* /Technic A2le C with Stud+ as shown. @nsert a2les from the top of the de#ice and secure with a bushing on the back or mount it on *our contraption directl*. Alternatel*, *ou ma* use blue /Technic A2le 0in with Driction+, as shown. 8hile disassembling contraption, lea#e the pins on the de#ice.

Architecture Highlights
NXShield has two banks for motor and sensor ports (4ank A and 4ank 4". 7ach bank has its own @%6 address. 7ach bank has two NXT motors and % sensor ports. (Total = motors and = sensor ports". NXShield has four switches: .eset switch is connected to Arduino .eset pin and used to reset the program running on Arduino. 1: switch is used to wait in the beginning before *ou run the program. The ?eft input and .ight input switches can be programmed to suit *our needs. The NXShield supports two #ariants of @%6 protocol Bardware @%6 and Software @%6. The protocol is chosen in *our sketch.

6op*right 9 %(55 :pen7lectrons.com

%;&

Feature Highlights
Table below lists the important features pro#ided b* the NXShield. To use these features in *our specific programming en#ironment, please refer to A0@ help file or program header file. Feature Timed 6ontrol of each motor 7ncoder control of each motor escription 7ach motor can be run for a specified duration of time. 7ach motor can be run from its current 7ncoder position to a new position (with or without a specific speed". Speed of each motor can be controlled in timed run or encoder based run. 7ach motor can be set to 4rake (where motor shaft can not be turned easil*", >s Dloat (where motor shaft is free to rotate b* e2ternal force. At the end of run, hold the encoder position (i.e. motor turned b* e2ternal force is restored to last set encoder position". Mo#e it in forward or re#erse direction. C'( degrees makes one rotation. 8hile a motor is running other operations ma* be performed. 8hile motors are running, *ou can also perform other operations. N:T7: 8hen motors are set to run for /$nlimited !uration+, the* will continue to run until a Stop command is issued (or power is disconnected". @n other words, after starting the motors for /$nlimited !uration+ if *our program does something else without stopping the motors, the* will continue to run. ,ou can read the #alue of each encoder from the NXShield. ,ou can read from #arious @%6 sensors connected to NXShield.

Speed control of each motor 4rake >s Dloat while stopping the motors

Bolding 7ncoder position

Turning motor b* degrees Turning motor b* rotations .unning operations as*nchronousl* .unning motors for unlimited duration.

Stopping motors abruptl*. .eading Motor 7ncoders .eading from NXT @%6 sensors

6op*right 9 %(55 :pen7lectrons.com

C;&

Feature .eading from NXT $ltrasonic Sensor .eading from NXT Analog Sensors

escription ,ou can connect one NXT $ltrasonic Sensor to *our NXShield and read from it. ,ou can connect analog sensors to NXShield and read from them.

Programming or NXShield
Arduino !rogramming En"ironment NXShield uses Arduino Software for programming. @f *ou ha#e not alread*, #isit following webpage, and download the Arduino 0rogramming en#ironment software for *our operating s*stem (as of this writing, the software #ersion is ((%%": http#$$arduino%cc$en$Main$So&tware Dollow the instructions at that webpage to install it on *our computer. NXShield !rogramming 'ibrary NXShield pro#ides se#eral features which are accessible through 6;6EE NXShieldFA>. librar*. @f *ou ha#e not alread*, #isit following webpage, and download latest librar*, e2ample programs and utilities from following location. http#$$source&orge%net$pro(ects$n)shield$&iles$A*R$ Dollow the instructions at that webpage to install it on *our computer. +hat this ,ip -ontains . NXShieldFA>. folder contains librar* header files and class files. $se these header files in *our program. ,ou should refer to these classes and learn from them. @f *ou need to add ad#anced features to NXShield librar*, this is where *ou will ha#e to add them. Dor normal use *ou shouldnGt ha#e to edit files in this librar*. NXShieldFA>.Fe2amples folder contains #arious e2ample programs. $se these programs as a reference or a starting point for *our own programs. Deel free to modif* them to suit *our needs %

Need Hel! Programming"


NXShield !rogramming A!/ 0uide &or A*R Arduinos The latest on line A0@ guide is a#ailable at following url: http:;;n2shield.s#n.sourceforge.net;#iew#c;n2shield;NXShieldFA>. ;html;inde2.html

6op*right 9 %(55 :pen7lectrons.com

=;&

This guide is also a#ailable with *ou when *ou download and install the librar*. @t will be located at: 12our Arduino3&older4$libraries$NXShield5A*R$html$inde)%html Also refer to NXShield3A*R3'ibrary3Tutorial%pd& from following location. http:;;www.openelectrons.com;inde2.phpH moduleIdocumentsJKASF!ocumentManagerFopI#iew!ocumentJKAS F!ocumentFidI5 More NXShield Resources Are a#ailable here: http:;;www.openelectrons.com;inde2.phpH moduleIpagemasterJ0A17FuserFopI#iewFpageJ0A17FidIL

Current Characteristics
A#erage current consumption of this de#ice is about &.( mA. NXShield can deli#er upto 5 Amp current per NXT Motor attached. !rawing of e2cessi#el* large current (such as incorrect motors or stalled motors" will result in internal shutdown until the situation is corrected.

#$C %us address


Factory Factory e&ault Address o& Ban63A# 7)78 e&ault Address o& Ban63B# 7)79

6op*right 9 %(55 :pen7lectrons.com

&;&

You might also like