scsnapino manual 112816.qxp 12/30/16 1:59 pm page 1direction, (indicated by the “arrow” in the...

32
Copyright © 2017 by ELENCO ® Electronics, Inc. All rights reserved. No part of this book shall be reproduced by any means; electronic, photocopying, or otherwise without written permission from the publisher. U.S. Patents: 7,144,255; 7,273,377; & patents pending 753106

Upload: others

Post on 24-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Copyright © 2017 by ELENCO® Electronics, Inc. All rights reserved. No part of this book shall be reproducedby any means; electronic, photocopying, or otherwise without written permission from the publisher. U.S. Patents: 7,144,255; 7,273,377; & patents pending

753106

SCSNAPINO_Manual_112816.qxp 12/30/16 1:59 PM Page 1

● Use only 9V type, alkaline battery (notincluded).

● Insert batteries with correct polarity.● Remove batteries when they are used

up.● Never throw batteries in a fire or attempt

to open its outer casing.

● Non-rechargeable batteries should notbe recharged. Rechargeable batteriesshould only be charged under adultsupervision, and should not berecharged while in the product.

● Do not short circuit the batteryterminals.

● Batteries are harmful if swallowed, sokeep away from small children.

-1-

WARNING: Always check your wiringbefore turning on a circuit. Never leave acircuit unattended while the batteries areinstalled. Never connect additional batteriesor any other power sources to your circuits.Discard any cracked or broken parts.

Adult Supervision: Becausechildren’s abilities vary so much, even withage groups, adults should exercisediscretion as to which experiments aresuitable and safe (the instructions should

enable supervising adults to establish theexperiment’s suitability for the child). Makesure your child reads and follows all of therelevant instructions and safety procedures,and keeps them at hand for reference.This product is intended for use by adultsand children who have attained sufficientmaturity to read and follow directions andwarnings.Never modify your parts, as doing so maydisable important safety features in them,and could put your child at risk of injury.

Batteries:!

Conforms to all applicable U.S. government requirements and CAN ICES-3 (B)/NMB-3 (B).

WARNING: This product should ONLY be powered using a USBcable, the 9V battery holder included in the set, or an AC adapterwith 9V output (not included)! It should NEVER be used with SnapCircuits® battery holders or other power sources!

!A NOTE ABOUT THE FCCThe Federal Communications Commission (FCC)regulates use of the radio frequency spectrum in theUnited States to prevent products from interfering witheach other.Snapino™ has been tested and found to comply with thelimits for a Class B digital device, pursuant to part 15 ofthe FCC Rules. These limits are designed to providereasonable protection against harmful interference in aresidential installation. Snapino™ generates, uses and canradiate radio frequency energy and, if not installed andused in accordance with the instructions, may causeharmful interference to radio communications. However,there is no guarantee that interference will not occur in aparticular installation. If Snapino™ does cause harmfulinterference to radio or television reception, which can bedetermined by turning Snapino™ off and on, try to correctthe interference by:

1. Moving Snapino™ away from the receiver.2. Contacting Elenco® for help by calling (800) 533-2441,

or e-mail us at [email protected] regulations for your Snapino™ require you to accept anyinterference from authorized sources and that you shut downif you are causing interference with other authorized products.You should never modify the electrical circuit componentsinside your Snapino™ module (U31) as this may causemalfunctions or violate FCC regulations for this product.

Snapino™Model 6SCU31

WARNING: CHOKING HAZARDSmall parts. Not for childrenunder 3 years.

!WARNING: SHOCK HAZARDNever connect SnapinoTM to the electricaloutlets in your home in any way!

SCSNAPINO_Manual_112816.qxp 12/30/16 1:59 PM Page 2

Important: If any parts are missing or damaged, DO NOTRETURN TO RETAILER. Call toll-free (800) 533-2441 ore-mail us at: [email protected]. Customer Service ● 150Carpenter Ave. ● Wheeling, IL 60090 U.S.A.

Qty. ID Name Symbol Part # Qty. ID Name Symbol Part #

r 1 2-Snap Wire 6SC02 r 1 White Jumper Wire SCJ3F

r 1 3-Snap Wire 6SC03 r 1 Red Snap-to-pinWire 6SCJ5RED

r 1 5-Snap Wire 6SC05 r 1 Phototransistor 6SCQ4

r 1 9V Battery Holderand Switch 6SCB9 r 1 Resistor 10kW 6SCR4

r 1 Base Grid Mini(7.7” x 5.5”) 6SCBGM r 1 Press Switch 6SCS2

r 1 Red LED 6SCD1 r 1 SnapinoTM Module 6SCU31

r 1 Green LED 6SCD2 r 1 USB Cable(A-male to B-male) 9TLSCUSBAB

r 1 Red/YellowBi-color LED 6SCD10 You may order additional / replacement parts at our

website: www.snapcircuits.net

2

S2

Q4

U31

R4

Parts List

-2-

3

5

D1

D2

D10

Parts List 2How to Use SnapinoTM 3About Your SnapinoTM Parts 4, 5Introduction to Electricity 6DOs and DON’Ts of Building Circuits 7Troubleshooting 8

Project Listings 9Projects 1 - 20 9−29Introduction to Microcontrollers 13Installing Software & Programming Cable 14Learn About Programming 16To Go Further 30

Table of Contents

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 3

Battery Holder

USB Cable

Snap Circuits® uses building blocks withsnaps to build the different electrical andelectronic circuits in the projects. Each blockhas a function: there are switch blocks, lightblocks, battery blocks, different length wireblocks, etc. These blocks are different colorsand have numbers on them so that you caneasily identify them. The blocks you will beusing are shown as color symbols with levelnumbers next to them, allowing you to easilysnap them together to form a circuit.For Example:This is the press switch block which isgreen and has the marking on it. Thepart symbols in this booklet may not exactlymatch the appearance of the actual parts,but will clearly identify them.

This is a wire block which is blue andcomes in different wire lengths. This onehas the number , , or on itdepending on the length of the wireconnection required.

You need a power source to run yourcircuits. You can use your USB cable or your9V battery holder (9V battery not included).

A clear plastic base grid is included withthis kit to help keep the circuit blocksproperly spaced. You will see evenlyspaced posts that the different blocks snapinto. The base has rows labeled A-E andcolumns labeled 1-7.

Next to each part in every circuit drawing isa small number in black. This tells youwhich level the component is placed at.Place all parts on level 1 first, then all of theparts on level 2, then all of the parts onlevel 3, etc.

Some circuits use jumper wires to makeunusual connections. Just clip them to themetal snaps or as indicated.

There is a snap-to-pin wire that allows youto make connections directly to the ArduinoUNO circuit board on the SnapinoTM

module (U31).

How to Use SnapinoTM

S2

Note: While building the projects, becareful not to accidentally make a directconnection across the battery holder (a“short circuit”), as this may damageand/or quickly drain the batteries.

2 3 5

-3-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 4

9VBattery

About Your SnapinoTM Parts(Part designs are subject to change without notice).

BASE GRID

The blue snap wires are wiresused to connect components.

They are used to transportelectricity and do not affect circuit

performance. They come in differentlengths to allow orderly arrangement ofconnections on the base grid.The white jumper wire makesflexible connections for timeswhen using the snap wireswould be difficult.

The red snap-to-pin wireallows for direct connection tothe Arduino UNO circuit board. Wires transport electricity justlike pipes are used totransport water. The colorful plastic coatingprotects them and prevents electricity fromgetting in or out.

BATTERY HOLDER

The base grid is a platform for mounting partsand wires. It functions like the printed circuitboards used in most electronic products, or likehow the walls are used formounting the electrical wiring inyour home.

SNAP WIRES & JUMPER WIRES

Batteries, like that in your 9V battery connector,produce an electrical voltage using a chemicalreaction. This “voltage” can be thought of aselectrical pressure pushing electricity through acircuit just like a pump pushes water throughpipes. This voltage is much lower and much saferthan that used in your house wiring. Using morebatteries increases the “pressure”, therefore,more electricity flows. SnapinoTM circuits can alsobe powered through the USB.

Battery Holder

SWITCHESThe press switch (S2) and the switch in the 9Vbattery holder connect (pressed or “ON”) ordisconnect (not pressed or “OFF”) the wires in acircuit. When ON they have no effect on circuitperformance. Switches turn on electricity just likea faucet turns on water from a pipe.

LEDsThe red & green LEDs (D1 & D2) are lightemitting diodes, and may be thought of as aspecial one-way light bulb. In the “forward”direction, (indicated by the “arrow” in the symbol)electricity flows if the voltage exceeds a turn-onthreshold (about 1.5V for red and yellow, about2.0V for green, and about 3.0V for blue;brightness then increases. A high current willburn out an LED, so your Snap Circuits® LEDshave internal resistors to protect them. LEDsblock electricity in the “reverse” direction.

Red & green LEDs (D1 & D2)

Red / yellow LED (D10)

The red/yellow LED (D10) is like the others buthas red and yellow LEDs connected in oppositedirections.

Press Switch(S2)

-4-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 5

About Your SnapinoTM Parts

U31 SnapinoTM module snap connections:(+) - power(−) - powerA0 - Analog inputD9-D11 - Digital inputs/outputs

Note: SnapinoTM does not have an on/off switchwhen powered using the USB cable. To turn it off,disconnect the USB cable from your computer.

Note: There is additional Arduino informationat www.arduino.cc, including a schematic forthe Arduino UNO.

The USB cable is usedto program andcommunicate with theSnapinoTM module(U31).

CABLE

SNAPINOTM MODULEThe SnapinoTM module (U31) includes an ArduinoUNO circuit board. This is a mini computer whichcan be programmed to perform different tasks,including monitoring things and making thingshappen.

Notes for using the SNAPINOTM module inother applications:Power source:SnapinoTM should ONLY be powered using aUSB cable, the 9V battery holder included inthe set, or an AC adapter with 9V output (notincluded). SnapinoTM should NEVER be usedwith Snap Circuits® battery holders from othersets or other power sources. Analog inputs (snap A0, or pins A0-A5 onthe circuit board):These can measure voltage with 10-bit accuracy(1024 levels). They can also be configured to actas additional digital inputs/outputs.Digital inputs/outputs (snaps D9-D11, orpins 0-13 on the circuit board):When configured as inputs the voltages shouldbe above 80% of the power source voltage tobe high, or below 20% of the power sourcevoltage to be low. When configured as outputseach can supply or receive up to 20 mA; thisis enough to light an LED, but an interfacetransistor may be needed when controlling amotor or speaker. Some of these (3, 5, 6, 9, 10,and 11) can be configured to simulate analogoutputs using Pulse Width Modulation (PWM). Other pins on the circuit board can be accessedusing snap-to-pin wires; see the Arduinowebsite (www.arduino.cc) for more information.

RESISTORSResistors “resist” the flow of electricity and areused to control or limit the current in a circuit. Thisset includes a 10kW resistor (R4) (“k” symbolizes1,000, so R4 is really 10,000W). Materials likemetal have very low resistance (<1W), whilematerials like paper, plastic, and air have near-infinite resistance. Increasing circuit resistancereduces the flow of electricity.

-5-

10kW Resistor (R4)

USB Cable

SnapinoTM module (U31)The phototransistor (Q4) is a transistor thatuses light to control electric current.

Phototransistor(Q4)

PHOTOTRANSISTOR

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 6

Introduction to ElectricityWhat is electricity? Nobody really knows. We only know how to produceit, understand its properties, and how to control it. Electricity is themovement of sub-atomic charged particles (called electrons) througha material due to electrical pressure across the material, such as froma battery.Power sources, such as batteries, push electricity through a circuit, likea pump pushes water through pipes. Wires carry electricity, like pipescarry water. Devices like LEDs, motors, and speakers use the energyin electricity to do things. Switches and transistors control the flow ofelectricity like valves and faucets control water. Resistors limit the flowof electricity.The electrical pressure exerted by a battery or other power source iscalled voltage and is measured in volts (V). Notice the “+” and “–”signs on the battery; these indicate which direction the battery will“pump” the electricity.The electric current is a measure of how fast electricity is flowing in awire, just as the water current describes how fast water is flowing in apipe. It is expressed in amperes (A) or milliamps (mA, 1/1000 of anampere).The “power” of electricity is a measure of how fast energy is movingthrough a wire. It is a combination of the voltage and current (Power =Voltage x Current). It is expressed in watts (W).The resistance of a component or circuit represents how much itresists the electrical pressure (voltage) and limits the flow of electriccurrent. The relationship is Voltage = Current x Resistance. When theresistance increases, less current flows. Resistance is measured inohms (W), or kilo ohms (kW, 1000 ohms).Nearly all of the electricity used in our world is produced at enormous

Placing components in series increases the resistance; highest valuedominates. Placing components in parallel decreases the resistance;lowest value dominates.The parts within these series and parallel sub-circuits may be arrangedin different ways without changing what the circuit does. Large circuitsare made of combinations of smaller series and parallel circuits.

-6-

Parallel Circuit

generators driven by steam or water pressure. Wires are used toefficiently transport this energy to homes and businesses where it isused. Motors convert the electricity back into mechanical form to drivemachinery and appliances. The most important aspect of electricity inour society is that it allows energy to be easily transported overdistances.Note that “distances” includes not just large distances but also tinydistances. Try to imagine a plumbing structure of the same complexityas the circuitry inside a portable radio - it would have to be largebecause we can’t make water pipes so small. Electricity allowscomplex designs to be made very small.There are two ways of arranging parts in a circuit, in series or inparallel. Here are examples:

Series Circuit

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 7

DOs and DON’Ts of Building CircuitsAfter building the circuits given in this booklet, you may wish to experiment onyour own. Use the projects in this booklet as a guide, as many important designconcepts are introduced throughout them. Every circuit will include a power source(the 9V battery holder or USB cable), a resistance (which might be a resistor, LED(which has an internal protection resistor), etc.), and wiring paths between themand back. You must be careful not to create “short circuits” (very low-resistancepaths across the power source, see examples below) as this will damagecomponents and/or quickly drain your batteries. ELENCO® is not responsiblefor parts damaged due to incorrect wiring.Here are some important guidelines:ALWAYS USE EYE PROTECTION WHEN ExPERIMENTING ON YOUR OWN.ALWAYS include at least one component that will limit the current through a circuit,

such as a resistor, an LED (which has an internal protection resistor), etc.ALWAYS use switches in conjunction with other components that will limit the

current through them. Failure to do so will create a short circuit and/ordamage those parts.

ALWAYS disconnect your power source immediately and check your wiring ifsomething appears to be getting hot.

ALWAYS check your wiring before turning on a circuit.ALWAYS connect the SnapinoTM module (U31) using configurations given in the

projects, as per the About Your Parts section, or as per the Arduino website.NEVER connect to an electrical outlet in your home in any way.NEVER leave a circuit unattended when it is turned on.NEVER connect battery holders from other Snap Circuits® sets to the SnapinoTM

(U31) module.

Placing a 3-snap wire directly across the 5VOUT and GND snaps is a SHORT CIRCUIT. This is also a

SHORT CIRCUIT.

When the press switch (S2) ispushed, this large circuit has aSHORT CIRCUIT path (asshown by the arrows). The shortcircuit prevents any otherportions of the circuit from everworking. !

NEVERDO!

NEVERDO!

!

You are encouraged to tell us about new programs and circuits you create. If theyare unique, we will post them with your name and state on our website at:www.snapcircuits.net/learning_center/kids_creationSend your suggestions to ELENCO®: [email protected]® provides a circuit designer so that you can make your own SnapCircuits® drawings. This Microsoft® Word document can be downloaded from:www.snapcircuits.net/learning_center/kids_creationor through the www.snapcircuits.net website.

Warning about power sources:SnapinoTM should ONLY be powered using a USB cable, the 9Vbattery holder included in the set, or an AC adapter with 9V output(not included). SnapinoTM should NEVER be used with SnapCircuits® battery holders from other sets or other power sources.

!

Examples of SHORT CIRCUITS - NEVER DO THESE!!!

WARNING: SHOCK HAZARD - Never connect Snap Circuits® tothe electrical outlets in your home in any way!

-7-

!NEVER

DO!

!NEVER

DO!

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 8

Troubleshooting (Adult supervision recommended)

-8-

Elenco® is not responsible for parts damaged due to incorrect wiring.Basic Troubleshooting

1. Most circuit problems are due to incorrect assembly, alwaysdouble-check that your circuit exactly matches the drawing for it.

2. Be sure that parts with positive/negative markings arepositioned as per the drawing.

3. Be sure that all connections are securely snapped. 4. Try replacing the batteries.Advanced Troubleshooting

If you suspect you have damaged parts, you can follow thisprocedure to systematically determine which ones need replacing:1. SnapinoTM module (U31 - partial test, see step 6 for full test),

9V battery holder, and USB cable: Install a 9V battery into thebattery holder, turn on its switch, and plug the holder into theSnapinoTM module; a green “ON” light and another light on theSnapinoTM module should be on. Remove the 9V battery holderand connect the USB cable; the same lights on the SnapinoTM

module should be on. If the SnapinoTM lights do not come on ineither case then SnapinoTM is damaged, if they only come on forone power source then the other power source is damaged.

2. Red LED (D1), green LED (D2), and red/yellow LED (D10):Place the red LED across the “5V OUT” and “GND” snaps onthe SnapinoTM module (U31), with LED “+” to 5V OUT; the redLED should light. Repeat for the green LED. Repeat for thered/yellow LED but test it in both directions. If some LEDs workbut others do not then the ones that did not work are damaged.If no LEDs work then the SnapinoTM module is damaged.

3. White jumper wire and red snap-to-pin wire: Use this mini-circuit to test the white jumper wire, the LED should light.Replace the white jumper wire withthe red snap-to-pin wire (snap iton the LED, then touch thepin end to the GND snap onthe SnapinoTM module(U31)) to test it.

4. Snap wires: Use this mini-circuit to test each of thesnap wires, one at a time.The LED should light.

5. Press switch (S2), 10kW resistor (R4), and phototransistor(Q4): Build project #1 and push the press switch, if the red LED(D1) doesn’t light then the press switch is bad. Replace the pressswitch with the 10kW resistor; the LED should be much dimmernow but still light. Replace the 10kW resistor with thephototransistor (“+” on right) and vary the amount of light shiningon it; more light should make the LED brighter.

6. SnapinoTM module (U31 - full test): Use project 15 to test it. ELENCO®

150 Carpenter Avenue ● Wheeling, IL 60090 U.S.A.Phone: (847) 541-3800 ● Fax: (847) 520-0085

e-mail: [email protected] ● Website: www.elenco.comYou may order additional / replacement parts at:

www.snapcircuits.net

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 9

-9-

Project Listings Project 1Red LightProject # Title Page #

1 Red Light 92 Lights 113 Blinking Light (Programming SnapinoTM) 144 Alternating Lights 175 Stoplight 186 Button 197 Bicolor Light 208 Night Light 219 Blink Rate 2110 Copy Cat Light 2111 Light Monitor 2212 Distance Sensor 2313 Photo Stop 2314 Button Stoplight 2415 SnapinoTM Test 2516 Varying LED Brightness 2617 Light Controlled LED 2718 LED Brightness Button 2819 Sloppy Switches 2920 Click Counter 29

Optional: USB cableto USB device maybe used as alternatepower source in placeof 9V battery.

+ Placement Level Numbers

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 10

-10-

A. Snap Circuits® uses electronic blocks that snap onto a clearplastic grid to build different circuits. These blocks have differentcolors and numbers on them so you can easily identify them.Build the circuit shown by placing all the parts with a black 1 nextto them on the board first. Then, assemble parts marked with a2. Install a 9V battery into the 9V battery holder, plug it into theconnector on the SnapinoTM module (U31), and turn on the switchon the battery holder. A small green light (usually labeled “ON”)on the SnapinoTM module should be on, indicating that it haspower. Alternately you may power the circuit using the USB cableinstead of the 9V battery.Push the press switch (S2), and the red LED (D1) lights.

B. Use the preceding circuit butreplace the 3-snap wire with thered/yellow LED (D10, in eitherorientation). The red LED is alittle dimmer now.

C. Use the preceding circuit butreplace the red/yellow LED(D10) with the 10kW resistor(R4). The red LED (D1) is muchdimmer now.

D. Use the preceding circuit butreplace the 10kW resistor (R4)with the phototransistor (Q4, “+”towards S2). Vary the brightnessof light on the phototransistor tochange the red LED brightness.

E. Replace the red LED (D1)with the green LED (D2) in anyof the preceding four circuits.

Educational Note: The voltagefrom the SnapinoTM module(U31) is now split between thetwo LEDs, making the red onedimmer.

Educational Note: The greenLED needs a little more voltageto turn on than the red LED, soit will be a little dimmer.

Educational Note: Theresistance of the photo-transistor varies depending onhow much light is shining on it.

Educational Note: Resistors“resist” the flow of electricity, sothe LED is much dimmer now.

Educational Note: When you press the press switch, electricity flows from theSnapinoTM module, through the switch and back to the SnapinoTM

module through the red LED. If the switch is not pressed, theflow of electricity is blocked, and the red LED won’t light. For this and the next few circuits, the SnapinoTM module is usedonly to provide power to the rest of the circuit. SnapinoTM ispowered using a 9V battery or through the USB, and producesa 5V output to operate other Snap Circuits® components. NOTE: This circuit (and many others in this book) have an LEDbeing used without a resistor or other component to limit theelectric current through it. Normally this could damage an LED,but your Snap Circuits® LEDs include internal protection resistorsand will not be damaged. Be careful if you later use otherelectrical sets with unprotected LEDs.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 11

Lights

Placement Level Numbers

+Project 2

YELLOW

-11-

Optional: USB cableto USB device maybe used as alternatepower source in placeof 9V battery.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 12

-12-

B. Use the preceding circuit butreverse the position of the press switch(S2), 3-snap wire, 5-snap wire, andeach of the LEDs (D1, D2, & D10),separately.

C. Use the project 2A circuit butreplace the press switch (S2) with thephototransistor (Q4, “+” on right). Varythe brightness of light shining on thephototransistor and see how it changesthe brightness of the LEDs.

D. Use the project 2A circuit butremove the press switch (S2) andmove one of the LEDs (D1, D2, orD10) to where the switch was (placethe LED “+” on the right). The LEDsmay be a little dimmer now.

Educational Note: Reversing theswitch and snap wires has no effect.LEDs only work in one direction, sothe red & green LEDs do not work inreverse, but the yellow LED (D10) is abi-color LED, with separate red &yellow LEDs in opposite directions, asshown in its symbol.

Educational Note: All the electricityflows through the LED that replacedthe switch, then divides between theremaining two LEDs. The LEDs are alittle dimmer because the batteryvoltage is split between them now.

Educational Note: The resistance ofthe phototransistor varies dependingon how much light is shining on it,brighter light lowers its resistance. Inthis circuit the phototransistor restrictsthe flow of electricity to all three LEDsat once, so it takes very bright light tomake all three LEDs light. Some LEDsneed less electricity to turn on thanothers, so they may turn on sooner.

A. Build the circuit, turn on the switch in the 9V battery holder, and push thepress switch (S2). The red, green, and yellow LEDs (D1, D2, & D10) light. Note: The white jumper wire is used only as a spacer (so both snaps on theyellow LED are on level 3); its right snap need not be connected.

Educational Note: LEDs are light emitting diodes, which convert electricalenergy into light. The color of the light depends on thecharacteristics of the material used in them.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 13

Introduction to Microcontrollers

WHAT IS A MICROCONTROLLER?A microcontroller is a mini computer. It’s a miniaturized circuit thatcontains memory, logic, processing, and input/output circuitry.Microcontrollers are programmed with specific instructions tocontrol many different devices. Once programmed themicrocontroller is built into a product to make the product moreintelligent and easier to use.A microcontroller receives input (such sources such as a switch,phototransistor, or computer keyboard), processes it and makesdecisions, then controls outputs (such as an LED, speaker, motor,or computer display) based on the decisions. For example, a microwave ovenuses a single microcontroller toprocess information from thekeypad, display user informationon a display, and control theturntable motor, light, bell andcooking time.

One microcontroller can often replace a number of separate parts,or even a number of complete electronic circuits.Microcontrollers are used in household appliances,alarm systems, medical equipment, vehiclesubsystems, musical instruments, andelectronic instrumentation. Mostcars contain many micro-controllers, using them forengine management, remotelocking, and other functions.

Programs are stored in memory as a series of numbers. A programis executed by moving information (stored as numbers) betweenplaces, such as activity registers, input/output ports, and memory.Computers cannot do complex mathematics, but they can performsimple math very quickly, and programming tricks allow complexcalculations to be performed as a series of simple ones.

The SnapinoTM module (U31) is an Arduino UNO microcontroller mounted on aSnap Circuits® base. Arduino is an electronics platform for prototyping with easy-to-use hardware and software. Usually Arduino is used with a prototypingbreadboard, but combining with it with Snap Circuits® - which has electronic partsand modules mounted on snaps - makes an even better prototyping platform. This set is only intended as an introduction to Arduino. Users who want to learnmore about it should visit the Arduino website (www.arduino.cc) after finishing theprojects in this set.

Arduino UNO circuit boardon Snap Circuits® platform

-13-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 14

Blinking Light (Programming Snapino™)Project 3This project explains the procedure for programming the SnapinoTM

module (U31). The microcontroller can be re-programmed in ANYcircuit that uses it, by attaching the programming cable to it. Whenyou initiate a new program download, any program currently runningin the microcontroller is interrupted. When a new program downloadis complete, the new program will begin running.

The USB cable is needed to download new programs to themicrocontroller, and to allow some programs to transfer informationto/from the computer’s display. The USB also provides power to yourcircuits, so the 9V battery connector is ignored while you areconnected to a USB device. Once SnapinoTM has beenprogrammed, you may disconnect the USB cable and run the circuitusing the 9V battery connector.

Installing Software and Programming CableInstall the Arduino software - called the Integrated Development Environment(IDE) from the Arduino website (www.arduino.cc/en/main/software). Choosethe appropriate version for your computer’s operating system (most users willpick “Windows installer” or “Mac OS X”), then follow the installation instructionsthere. Depending on your operating system, you may be asked to agree to alicense agreement, or to give permission to install drivers. When the IDE installation is complete, build the circuit shown here (whichincludes the red snap-to-pin wire, which is plugged into slot 13 of the blackconnector on the circuit board on the SnapinoTM module (U31)), connect theUSB cable to your computer. The green LED (marked ON) on the circuit boardshould be on, and other lights may be on if the board had previously beenprogrammed. Your computer should automatically find the drivers it needs. Runthe Arduino IDE. Now select the port for communicating with SnapinoTM. In the Tools menu inthe Arduino IDE, select Port, then pick the one that shows an Arduino UNO(Windows users) or either of the following:/dev/tty/usbmodem or /dev/cu.usbmodem5dll (Mac users). +

-14-

to 13

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 15

Educational Note: Any time a task needs to be performed over and over again, a microcontroller should be considered to help performthe task.

-15-

Go to the SnapinoTM product page (www.snapcircuits.net/scsnapino) and downloadthe SnapinoTM program files from our website to your computer. In the File menu inthe Arduino IDE, pick Open, then go to where you downloaded the SnapinoTM

program files to, and pick the Blinking_Light program or “sketch” (Arduino usersrefer to a program as a sketch). The sketch should appear in the IDE window, asshown below.

Now download the program into the SnapinoTM module. Click on the Upload buttonin the IDE.

The blue status bar near the bottom should indicate that the upload is occurring,and when it is done. Two LEDs should now be blinking - a small yellow LED onthe UNO board (usually marked “L”) and the green LED (D2) in Snap Circuits®.

You can now disconnect the USB cable and connect the 9V battery holder. Turnon the switch on the 9V battery holder, and the sketch will begin running.

Note: SnapinoTM does not have an on/off switch when powered using the USBcable. To turn it off, disconnect the USB cable from your computer.

Troubleshooting: If there was a problem with the upload, then the status bar would be orange, indicating a problem.

If you had unplugged the USB cable and it does not recognize the module whenUSB is connected again, then you may need to re-select the port. In Tools, selectPort, then pick the one that shows an Arduino UNO (Windows users) or either ofthe following: /dev/tty/usbmodem or /dev/cu.usbmodem5dll (Mac users).

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 16

Learn About ProgrammingHere is how the sketch works: void - this sets up a function.setup - this is a function that initializes variables, pin modes,etc. pinMode(13, OUTPUT) - this configures digital pin 13 to actas an output. loop - this is a function for executing the followingcommands in a continuous loop.digitalWrite(13, HIGH) - this tells SnapinoTM to put anelectrical voltage at digital pin 13 (where the Snap Circuits®

green LED (D2) is connected). This voltage will light theLED. A small yellow LED on the UNO circuit board alsolights; this LED is permanently connected to digital pin 13. delay(500) - this tells SnapinoTM to pause for 500milliseconds, or 0.5 second, before performing the nextinstruction.digitalWrite(13, LOW) - this tells SnapinoTM to turn off orremove any voltage at digital pin 13. This will turn off thegreen LED (and the yellow LED on the UNO board). Comments: All information after // is Comments. Commentsare a description of what the sketch is doing, to help youunderstand and remember it. Comments are automaticallyremoved before the sketch is downloaded to SnapinoTM.

-16-

You can edit the sketch to change parameters or commands ifdesired. The editing procedure is similar to other wordprocessors. You may also type in a completely new sketch. Tosave sketches you have created or modified, use Save As underFile menu.Only valid sketches (without errors) may be downloaded, or adownloading error will result. You can check for errors by clicking theVerify box. Verify also tells you how much memory the sketch uses.Explanations for all Arduino commands, and some basicinformation about programming, can be found under the Helpmenu or on the Arduino website (www.arduino.cc).

You can change the blink rate by changing the delay value from 500 tosomething else. Try 200 (faster blinking) or 2000 (slower blinking). Change thevalue at both locations in the sketch, then upload the sketch into SnapinoTM.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 17

-17-

Alternating LightsProject 4Build this circuit. Load sketch Alternating_Lights intoSnapinoTM using the programming instructions in project 3.Arduino controls the two Snap Circuits® LEDs (red andgreen), and alternates turning them on and off.

Programming Note: This sketch uses the int command (int is short for integer)to assign a constant value that will be used within thesketch. You can change the blink rate by editing the delayvalue, then reloading it into SnapinoTM. The microcontroller on the Arduino UNO board lets youcontrol the LEDs in ways that would be difficult to do usingswitches or other devices.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 18

YELLOW

-18-

StoplightProject 5Build this circuit. Load sketch Stoplight into SnapinoTM usingthe programming instructions in project 3. SnapinoTM

controls the three Snap Circuits® LEDs (green, yellow, andred), and turns them on and off like a stoplight. The yellowlight is only on for half as long, just like a normal stoplight.

Programming Note: This sketch usesthe int command to assign constantvalues for the delay and LED connectionpins. Doing this makes them easy tochange later, because you would onlyneed to change them in one place,instead of throughout the sketch. You canchange the blink rate by editing the delayvalue, then reloading it into SnapinoTM.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 19

-19-

ButtonProject 6Build this circuit. Load sketch Button into SnapinoTM usingthe programming instructions in project 3. The red LED (D1)should be on; push the press switch (S2) to turn it off.Swap the locations of the press switch and 10KW resistor(R4). Now the red LED turns on when the press switch ispushed.

Programming Note: This sketch monitors the voltage between the 10KW resistor andpress switch; normally the resistor pulls the voltage high, butpushing the switch pulls it low. SnapinoTM monitors the voltage andturns off the red LED when it receives a low signal from the button.If the button is released, then the monitored voltage will go back tohigh, and SnapinoTM turns on the red LED.digitalRead(button) - this command tells SnapinoTM to read thevoltage at button (which had been assigned as digital pin 9), andassign it to variable buttonState.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 20

-20-

Bicolor LightProject 7Build the circuit and load sketch Bicolor_Light intoSnapinoTM using the programming instructions in project 3.The red/yellow bicolor LED (D10) alternates between redand yellow.

Programming Note: The red/yellow bicolor LED (D10) has red and yellowLEDs connected in opposite directions. The sketchinstructions alternate between turning digital pins 9and 10 HIGH or LOW, so that electricity flows out ofone and into the other. Try reducing the delay to 100 to make it changecolors faster. Next, reduce the delay to 10 to make itchange colors really fast - so fast that red and yellowblend into orange.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 21

Project 10

Project 8 Night Light Build this circuit. Load sketch Night_Light into Snapinousing the programming instructions in project 3. Coverthe phototransistor (Q4) to turn on the red LED (D1). Once programmed, you can use the 9V batteryconnector to power the circuit instead of the USBcable, then take the circuit with you into a dark room.

Programming Note: analogRead(0) - thiscommand measuresthe voltage at analogpin A0 using a 10-bitana log - t o -d i g i t a lconverter, and out-puts a value from 0 to1023 (representing avoltage of 0V to 5V). You can adjust thesensitivity by chang-ing 200 to be higheror lower.

Use the preceding circuit, but load sketchBlink_Rate into SnapinoTM. The red LED (D1)will be blinking; the darker the room, the fasterit blinks. If the room is very dark then the redLED may appear to be on continuously.

Swap the locations of the 10KW (R4)resistor and phototransistor (Q4). Nowbrighter light makes the LED blink faster anddarkness makes it slower.

Project 9Blink Rate

Use the preceding circuit, with the R4 and Q4locations swapped (so Q4 connects to the 5-snap wire). Load sketch Copy_Cat_Light intoSnapinoTM. Place the circuit in a bright room, sothere is light on the phototransistor (Q4). Blockthe light to the phototransistor with your hand;when you uncover it then the red LED (D1) willbe on for as long as the phototransistor wascovered. Try this several times.

Copy Cat LightProgramming Note: This program uses acounter to keep track of how long you coverthe phototransistor. The longer you cover it,the higher the counter gets. Once thephototransistor is uncovered, the LED willturn on, and the program will start subtractingfrom the counter. This can count backwardsuntil the counter is equal to zero, where itwould then turn the LED off.

-21-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 22

Project 11 Light MonitorThis project opens a window on your computer todisplay measured data in real time. Build thecircuit shown. Load sketch Light_Monitor intoSnapinoTM using the programming instructions inproject 3. When the upload is finished, click on theTools menu, then pick Serial Monitor from thelist. A window opens on your computer screen,displaying the measured light value. Vary theamount of light shining on the phototransistor (Q4)and see how the number displayed changes.

Programming Note: The Serial commands open the window, then display some textwith the light measurement. Changing the amount of light shining on the phototransistorchanges its resistance, and so changes the voltage measured atthe A0 input. The analogRead command has 10-bit accuracy, sothe measured number will be from 0 (darkest) to 1023 (brightest).The 10KW resistor (R4) allows the voltage at the A0 input to fallwhen it is dark and rise when there is light on the phototransistor.The voltage measured depends on the ratio of thephototransistor resistance to the 10KW resistor (R4). Themeasured value will be about 512 when the phototransistorresistance equals R4. Replacing R4 with another resistor wouldshift the measured light value.

-22-

Serial monitor window:

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 23

Project 12 Distance Sensor This sketch changes which LED is on depending on the amount of light thephototransistor is getting. Build the circuit and load sketch Distance_Sensorinto SnapinoTM using the programming instructions in project 3.Vary the amount of light shining on the phototransistor (Q4) - if the light isbright then the green LED (D2) will be on, if there is less light then theyellow LED (D10) will be on, and if there is low light or no light then thered LED (D1) will be on. This can be used to determine the distancesomething is above it, since the object will slowly block out more light thecloser it gets to the phototransistor.Once programmed, you can use the 9V battery connector to power thecircuit instead of the USB cable, then walk around with it.

Programming Note: This sketch works by measuring howmuch light the phototransistor is getting,and assigning that value to a variable,in this case the variable is “Val”. TheArduino then uses this value todetermine which light to turn on. If thevariable is above a certain value, theArduino switches the LED from greento yellow, and if the value still gets toohigh, the Arduino switches the yellowLED to the red LED.You can adjust the sensitivity bychanging values 750 and 150 to behigher or lower.

Use the preceding circuit, but load sketchPhoto_Stop into SnapinoTM. The LEDs changecolors in a stoplight pattern, with the rate of changecontrolled by the phototransistor (Q4). Vary theamount of light shining on the phototransistor; thebrighter the light, the faster the LEDs change.

Programming Note: This sketch reads the valuefrom the phototransistor, and uses that value tochange the time delay, causing the stoplight toswitch the LEDs faster or slower.

-23-

Project 13Photo Stop

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 24

Project 14 Button StoplightBuild this circuit. Load sketch Button_Stoplight into SnapinoTM

using the programming instructions in project 3. The red LED (D1)should be on; push the press switch (S2) to change which LED ison, order is red-yellow-green like a stoplight.

Programming Note: This sketch uses acounter to switch between different LEDs.When the button is pressed, it increases thecounter by 1. Each LED is activated when thecounter reaches a certain number. When thecounter reaches 4 it is reset to back 1.

-24-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 25

Project 15 Snapino™ TestThis circuit tests the snapconnections on the SnapinoTM

module (U31), and is referenced bythe Advanced Troubleshootingprocedure on page 8. Build the circuitas shown, leaving one end of thewhite jumper wire unconnected fornow. Load sketch Snapino_Test intoSnapinoTM using the programminginstructions in project 3.The green LED (D2) should be on.Connect the loose end of the whitejumper wire to each of the unusedsnaps on the SnapinoTM module(U31), one at a time; the red LED(D1) should be blinking each time.Remove the USB cable, then connectthe 9V battery holder and turn on itsswitch; the circuit should work thesame as with the USB cable.

Programming Note: This sketch setseach connection on SnapinoTM to be anoutput, then toggles each on and off.

-25-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 26

Programming Note: This sketch uses a counter to increase thebrightness of the LEDs. Once the LED nears fullbrightness then the counter decreases to makethe LEDs dimmer. Some of the digital pins (including D9, D10, andD11, which are connect to snaps and used here)may be controlled using the analogWrite()command. analogWrite() simulates an analogvoltage using pulse width modulation, whichvaries the duration of a digital pulse. Here theLEDs are made brighter by increasing theduration of the pulse (making the LEDs on for alonger amount of time), or made dimmer bydecreasing the duration of the pulse. The value for analogWrite() can be from 0 (LEDoff) to 255 (LED always on). This sketch uses amaximum value of 30 for analogWrite(), becausethe LED brightness would change very slowly forhigher values. Try increasing this value from 30 to255, upload the sketch to SnapinoTM, and see howit affects the LED brightness. You can also adjustthe delay value (currently 30) to make the LEDbrightness change faster or slower. Why do analogWrite() values of 30 or more makethe LEDs appear at full brightness? Because thelight is changing faster than your eyes can adjust,and your eyes continue seeing what they havejust seen. This is often called “persistence ofvision”. This concept is used in movie theaters.

Project 16 Varying LED BrightnessBuild the circuit and load sketchVarying_LED_Brightness into SnapinoTM usingthe programming instructions in project 3. Thethree LEDs (D1, D2, & D10) continuously vary inbrightness.

-26-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 27

Project 17 Light Controlled LEDBuild the circuit and load sketch Light_Controlled_LED into SnapinoTM

using the programming instructions in project 3. Vary the brightness oflight on the phototransistor (Q4) to change the brightness of the redLED (D1). The red LED gets brighter as the phototransistor gets darker.The circuit acts as a night light, making the red LED brighter as theroom gets darker.

Programming Note: The light on the phototransistor is measured with theanalogRead() command, then 1/16 of that value isused for the red LED brightness with theanalogWrite() command. The value is divided by 16because analogRead() returns a number between0 and 1023 while the analogWrite() value must bebetween 0 and 255, and because the red LED willappear to be near full brightness for values >30.

-27-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 28

Project 18 LED Brightness ButtonBuild the circuit and load sketch LED_Brightness_Button intoSnapinoTM using the programming instructions in project 3. Push thepress switch (S2) repeatedly; the red LED (D1) gets brighter each time.After the red LED reaches full brightness then it resets and starts over.

Programming Note: The red LED brightness is set using theanalogWrite() command, which uses values from0 to 255, but incremental increases will be muchmore noticeable between low numbers thanbetween high numbers. Because of this, this sketchuses an array to set the red LED brightness inmultiples of 2, then resets back to minimum.

-28-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 29

Project 19 Sloppy SwitchesBuild the circuit and load sketch Sloppy Switches into SnapinoTM usingthe programming instructions in project 3. Slowly push the press switch(S2) many times, watching the red LED (D1) as you do. Usually theLED will turn on or off when you push the switch, but sometimes it willstay the same. Do you know why the LED sometimes stays the same?

Programming Note: When you push the switchits contacts may bounce,sometimes makingequipment monitoring theswitch think it was pressedmore than once. Thiseffect is called “switchbounce”. To prevent this asmall delay is normallyadded to ensure theswitch contacts havesettled before the sketchchecks the switch again. In this sketch thedelay(10); command has// in front of it, making it acomment that is ignoredby the sketch. Remove the//, upload the revisedsketch, and see if the redLED always changeswhen you push the switch.

Project 20 Click CounterThis project opens a window on yourcomputer to display how many timesyou pressed a button. Use thepreceding circuit but upload sketchClick_Counter into SnapinoTM. Whenthe upload is finished, click on theTools menu, then pick Serial Monitorfrom the list. A window opens on yourcomputer screen. Push the pressswitch (S2) as many times as you like;the program displays the current counton your computer screen. The red LED(D1) is not used, and may be removed.

Programming Note: Remove the delay(10);command from the sketch(or add // in front to make ita comment that is ignored),upload the revised sketch,and watch the display asyou are pushing the pressswitch. Notice thatsometimes the display willshow you pushed theswitch several times whenyou only pushed it once.

-29-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 30

To Go Further

WARNING: This product should ONLY bepowered using a USB cable, the 9V batteryholder included in the set, or an AC adapterwith 9V output (not included). It should NEVERbe used with Snap Circuits® battery holdersor other power sources!

!

Some graphical programming languages have been developed tomake Arduino programming easier by picking command blocksfrom a list instead of typing in a program; these may be helpful tonew Arduino users. One is Ardublock, see www.ardublock.com tolearn more about it.

Snap Circuits® is an ideal environment for working with Arduino due to the ease of building circuits with it. The modules available in yourSnapinoTM set comprise only a small fraction of those available, for a full listing go to www.snapcircuits.net. Additional SnapinoTM sketchesfor use with other Snap Circuits® sets are available at the SnapinoTM product page (www.snapcircuits.net/scsnapino).Only 9 of the Arduino UNO connection points are accessible by snaps on the SnapinoTM module and some of those (A1 & A2) are notused in any SnapinoTM projects; they are available for future experimenting on your own. The UNO connection points that are not accessibleby snaps may be accessed using snap-to-pin wires, which may be purchased from Elenco® in 10-packs as SCJW-10.This set is only intended as an introduction to Arduino. Users who want to learn more about it should visit the Arduino website(www.arduino.cc) after finishing the projects in this set. Explanations for all Arduino commands, and some basic information aboutprogramming, can be found under the Help menu in the Arduino software IDE, or on the Arduino website (www.arduino.cc).

-30-

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 31

SC-SNAPINO Block LayoutImportant: If any parts are missing or damaged, DO NOT RETURN TO RETAILER.Call toll-free (800) 533-2441 or e-mail us at: [email protected]. Customer Service ● 150 Carpenter Ave.Wheeling, IL 60090 U.S.A. Note: A complete parts list is on page 2 in this manual.

SCSNAPINO_Manual_112816.qxp 12/30/16 2:00 PM Page 32