|
digital inputs | analog input | outputs | motors | reset | oscillator | PC interface | power supplies | remote control receivers
digital inputs | analog
input (comparator) |
outputs |
pushbutton to GND | photocell | relay, relay with LED, power relay |
pushbutton to +5V | LED, LED clusters | |
alarm sensor |
da completare: |
buzzer 5V, high-power buzzer |
magnetic switch | termostato | logic gates |
limit switch | misura di resistenza | 7-segments display |
encoder | ritardo regolabile | triacs (light effects) |
a.c. inputs | misura di tensioni | stereo headphone |
logic gates | sensore di suono | amplifiers |
voltages from 12 to 24 Vcc | sensore di campo RF | low-voltage lamps |
potentiometers, trimmers | timer supplementare | LED, bi-color |
opto-coupled input | convertitore tensione/tempo |
power supplies | reset | remote-control receivers |
5V - 12V power supply | lab- reset | infrared receivers |
power supply form surplus PCs | R-C network based reset | radio receivers |
professional reset | ||
Folllowing circuits are suitable not only for programmable inputs IN1, IN2, IN3 e IN4, but also for specialized inputs ST0, STOP and HOLD. When using IN4 remember to leave the "Enable analog comparator" box blank. |
The simplest way to connect a switch or a pushbutton to Nutchip inputs is across the input itself and GND. Nutchip inputs have an high-value internal resistor keeping them positive if not externally connected elsewere. Therefore, reding the input when the button is released gives a logic 1. Pressing the button connects it to GND, giving a logic 0 level. |
Is always possible to connect a pushbutton to positive rail, although this requires an additional low-value resistor to contrast the action of Nutchip's internal pull-up one. The 470-ohm resistor R1 shown here, connected across the input and GND, does exactly this pull-down job. Therefore the input is at logic level zero as long a s SW1 is released. Pressing SW1 connects the input to the positive rail, overriding R1's effect, bringing the input to logic 1. |
All of Nutchip inputs can be connected to TTL or CMOS outputs - the latter
only when power supply voltage is the same as Nutchips, 5V. |
Should you need to connect Nutchip inputs to a DC voltage higher than
5V, you must reduce it to safer levels, for example using a couple of
resistors as shown here. 12V signals are often found in alarm systems, as the voltage is required to power electronic sensors. A signal voltage swing of 12V is also advantageous to increase noise immunity: as signal voltage will by reduced by about 2/3 by the resistor divider, the same will happen to noise spikes captured by input wiring. Such noise-rejection effect can be improved even further connecting a 100nF capacitor in parallel to R2.
|
When galavanic separation between external circuitry and Nutchips circuit is required, an optocoupler can be used easily. Optocouplers are specialized ICs were an LED faces a phototransistor. Externa circuit clamps to M1. When the external circuit is off, or as long as the voltage across M1 is less than 1 volt, the phototransistor is not off and Nutchip input will read as 1. Voltages around 5V will lit the LED, bringing the phototransistor to conduction. As the transistor is across the input and GND, the Nutchip will then read zero. |
Use this circuit for:
Here is how it works:
Note: we recommend to add a 220 ohm resistor in series with the output to protect the Nutchip in case the potentiometer be set to zero-resistance. |
This is an improved version with respect to previous circuit, allowing a fast capacitor discharge thanks to diode D1. This addition allows to reduce the time when the output is kept to zero in order to discharge the capacitor; otherwise the circuit works in the same way of the previous one. Note: we recommend to add also a 220 ohm resistor in series with the output to reduce peak current. |
A mechanical "quadrature" encoder is equivalent to a couple of switches. These parts usually require just three pins because of a COMmon pin joining two internal switches. Using a multimeter, discover which pin is in common by turning the knob while measuring pin-to-pin resistance. Some encoders have both switches closed while standing in rest position, others either A or B, lastly some others have both switches closed. |
Limit switches - aka "microswitches" - are just a special form of switches, suitable for detectin the position of a lever, or any other movable mechanical device. Connect microswitches to Nutchip as if it were an ordinary pushbutton, according to make-to-GND or make_to_5V models. If the wire length connecting the switch to Nutchip is more than a couple of meters, the make-to-12V connection offers greater noise immunity (especially when adding the capacitor). |
Magnet activated switch, also named reed switches, are often used for detecting door and windows opening in an alarm system. Reed switches are small hermetic switches whose contact opens or closes under the effect of a strong magnet nearby. The most popular open the contact when away from the magnet. As long as the magnet is in close proximity (e.g. windows closed) the contact is closed, therefore should a burglar cut alarm wires the alarm will trigger as well.
|
The simplest way to connect a reed (magnetic) switch or a pushbutton to Nutchip inputs is across the input itself and GND. Nutchip inputs have an high-value internal resistor keeping them positive if not externally connected elsewere. Therefore, reding the input when the button is released gives a logic 1. Pressing the button connects it to GND, giving a logic 0 level. When using a reed in an alarm system, see also the following circuit which improves rejection to noise captured by long connection wires. |
Alarm sensors require (usually):
|
|
This circuit requires a dual voltage power supply (12Vds for the sensor, 5Vds for the Nutchip, negative rails in common).It requires just three wires to connect a sensor to the central and to supply it 12V power; a possible fourth wire can be used for an additional anti-tamper line. A generous capacitor and a zener diode protect the input from noise spikes that, almost unavoidably, are captured by sensor cabling. |
|
Sometimes Nutchip is requested to detect AC signals coming from external devices:
|
This circuit is suitable for detecting input waveforms from 12 to 48 volts, changing resistor R1 value accordingly. It offers optical insulation for improved safety, and rectifies the input signal in order to "clean" it from original AC waveform. |
Following mini-circuits appy to Nutchip's outputs: OUT1, OUT2, OUT3 and OUT4. Typical output devices are LED, relays, buzzers - but also logic gates and 7-segment displays. To connect lamps and motors we recommend to use a relay for the sake of simplicity. |
This is the preferred way to drive an LED froms logic output. It is a old times inheritance, when logic gates were capable to sink much more current when at logic level 0 - compared to current sourced when at logic level 1. With this connection the LED lits when the output is at logic level zero (the LED current flows from +5V to Nutchip pin, following the arrow symbolizing the LED). When the output is set to logic level 1, the LED goes off (and no current is required from output pin. The 390 ohm R! resistor limits current through the system. The suggested values limits the current around 10mA, as suggested by most LED manufacturers. |
Nowadays there are no more reasons to connect LEd across outputs and the positive power. Most beginners prefer to connect the LED as shown here, bacause in tihs case the LED lits when the output is at logic level 1, and is off when the output pin is at logic level 0. Always put the current limiting resistor (R1, 390 ohm) in series with the LED, as excessive current can damage both the LED and the Nutchip output circuitry. |
This schematic shows how to connect two LED to a single pin, with an
interesting alterante effect - when an LED is on, the other is OFF and
vice-versa. It is excellent for driving dual-color displays - e.g. a green
LED as DL1 and a red one as DL2, in order to build a light that changes
colour when the output flips. When the output is high, LED DL2 is on and LED DL1 if off. Both resistor are 390 ohm. Overall current through the output pin will always be around 10mA, not 20mA as it could seem at a glance, because there is only one LED on at any given time. Note: an intriguing behaviour of this circuit is that if you try building it, but omitting the connection to Nutchip's output pin, you will see both LED on. Can you tell why? |
In order to build light effects, Christmas decorations, and flashing words, it is sometimes required to drive a large number of LEDs together. This circuit can drive up to 12 LEDs for each Nutchip output (you can also use only 6 leds omitting the rightmost parts). If a LED-series needs less than 6 LEDs, increase the value of the relevant series resistor (R2 or R3) according to the following table.
Practically speaking, the current across the series-conected LED should be around 10 mA. |
As typical Nutchip output devices, relays are second only to LEDs. Thanks
to a relay, a Nutchip output can drive lamps, motors, electric valves,
transformers, heaters, pumps and many other devices. Relays are advantageous because the load (connected to clamp M1) is galvanically insulated from the Nutchip circuit. DANGER: when using a relay for switching mains-powered loads, like a desk lamp, great care is required to ensure there are not unwanted connection between the live mains-powered parts (lamp, M1, relay contacts) and the rest of the circuit. Accidental contacts can kill you or cause severe damages, fires, and fry your PC. Do not try to connect anything to the mains without your teacher and an experienced electrician assistance. Ask your power company and electrician for regulations that may apply in your contry. |
It is very handy to have an LED which lits when a realy is on. Resistor R2 varies from 390 ohm to 1000 ohm, according to coil voltage:
|
Small relays used in electronics circuits are not suitable for driving loads requiring more than a few amps - equivalent to roughly 200W at 220Vac. To drive heavier load an additional power relay is required. The smaller relay (RELAY1) drives the bigger one (RELAY2), which is a special type suitable for heavy loads (ask your electrician). The current on RELAY1 contacts is low - just enough to drive RELAY2 coil), but RELAY1 output contacts must be rated for at least 250Vac, because RELAY2 coil is mains-operated. DANGER: great care is required to ensure there are not unwanted connection between the live mains-powered parts. Accidental contacts can kill you or cause severe damages, fires, and fry your PC. Do not try to connect anything to the mains without your teacher and an experienced electrician assistance.Ask your power company and electrician for regulations that may apply in your contry. |
Any Nutchip output can drive a 5V buzzer, provided it is of the "all electronic" kind. Avoid using electro-mechanical types, ase they require far too much current that a Nutchip output can source, and can generate voltage spikes capable to damage the Nutchip output stages.
|
12V buzzers are quite common and are also easily found as surplus parts. Sometimes they are so loud that "mini-siren" would be a more appropriate name. This circuit is suitable for buzzers requiring up to 100 mA. Should your siren require more current, use a relay to drive it. |
DC lamps from 3 to 24Vdc can be driven with just one darlington-type transistor. Don't be fooled by the schematic, the symbol for a darlington is the same as a transistor pair! The voltage required by the lamps (+V) must be less than 40 volts, and the transistor type is TIP122. Tip: switching the output on/off creates the illusion of modulating lamp luminosity |
Light effects take advantage from using TRIACs instead of relays. Relays
are unsuitable for continuous flashing operation, as their contacts are
prone to wear out. |
TRIACs rated for 600V / 5A are commonly found in electronics shops. These parts are OK for flament lamps up to 200W at 220V. Heavier loads require more powerful TRIACS and an accurately insulated heatsink, as the TRIAC case is connected to the mains. |
A single darlington-type transistor is a simple and efficient way to switch a DC motor on/off according to Nutchip output. A TIP122 type can drive motors powered at up to 40 volts requiring less than 600mA, without heathsink. The motor runs when the output is 1, and stops when the output is 0. Note: the schematic symbol for a darlington transistor resembles a transitor pair. This schematics actually requires only one darlington transistor (see components details) |
This circuit is not designed to be used alone. It is used as a basis to build more complex circuits described in the following sections:
These motor drives require one or more copies of this sub-circuit. Every
sub-circuit is controlled by a distinct Nutchip output, and drives a distinc
motor's wire. |
To reverse the rotation direction two of the above circuits are required, which build a complete H-bridge. The motor is connected to the two MOTOR outputs. Two Nutchip outputs are required to drive the H-bridge halves.
|
Stepper motors require 4 identical copies of the half bridge circuit previously detailed. Each circuit drives one of the 4 motor wires (steppers have two coils internally). Therefore, all four Nutchip outputs are required to drive steppers. Here is the output sequence for stepping them:
To reverse rotation, just use the same sequence reversed, that is from last row to the first. |
Nutchip outputs can drive directly TTL gates and 5V-powered CMOS gates. This example shows how to connect a Nutchip output to one input of an AND logic gate. If the logic gate is on an external board, the negative power pins (GND) must be joined. |
This circuit drives walkman-type earphones/headphones from a Nutchip output. Note how the outer ring on the jack is kept disconnected. This arrangment makes phones connected in series, giving the impression of a sound centered between your ears! Nutchips can produce a range of noises. Shorter delays produce tones, truth table with slow delays make clicks and cracks. WARNING: depending on your earphones, volume can be quite loud. Put the phones on only after ascertaining the volume does not harm your ears! Increase R1 value to reduce volume. |
Want a high-power buzzer? This circuit turns your stereo in an mega-siren. It connects to the AUX input, alternaely it can be connected to TAPE, CD or TUNER inputs. Use an RCA patch cable (from HiFi shops) to connect the female RCA circuit (CN1) to the amplifier, and switch it in MONO mode (you can also build a two identical copies of the circuit for a stereo output). WARNING: this circuit produces a high-level output and very-low frequency signals. Start keeping your volume to a very low level, increase it gradually. Excessive power when reproduce high power signals and very-low frequencies can damage your speakers or harm your ears. |
A 7-segment display is made from 8 (!) LEDs. Each LED illuminates a distinct segment on the actual digit. Segments are convetionally referred to with a letters a,b,c,d,e,f,g, with the h referring to the decimal point. To reduce pin count, either all of the LED cathodes or anodes are joined into a single pin. This is what we mean when talking about "common cathode" and "common anode" displays. Display's segments can be illuminated exactly in the same way as plain
LEDs (that is, whit a digital output and a series resistor); however,
the most common practice is to use specilized display drivers IC like
the CD4511, as detailed in this project. |
Input IN4 doubles as analog comparator. When used as comparator,
the status of IN4 is 1 if the potential on IN4 is greater than the voltage
applied to AREF. To enable the analog comparator function, remeber to check the "Enable analog conparator" box prior to Nutchip programming. |
Conecting an LDR as shown in this circuit, the value on IN4 is read as
either 0 or 1 depending on the amount of light it receives. A trimmer/potentiometer sets the light level at with the photocell triggers. Any value from 1 kiloohm to 470kiloohm can be used in place of the 100 kiloohm shown here.
|
Nutchip's heartbeat is a 4MHz clock. Oscillator circuitry is included on-chip and requires only an external crystal or ceramic resonator to generate the waveform. |
Quartz cristals are connected in the same way as 2-pin ceramic resonators.
Quartz crystals offer best precision, therefore are the best choice when
building timers. Two small capacitors C1 and C2 are required to start oscillation and to keep the cristal on the right frequency. If you omit one or both, you can get erratic and unstable Nutchip behaviour. Sometimes,older crystal perform better with 100pF capacitors. Quartz crystals require longer to get started (at power-on), therefore when using a crystal ensure a proper reset to the Nutchip, e.g. adding a specilized reset IC. |
3-pin, 4 MHz ceramic resonetors require no additinal parts to get a stable
4MHz Nutchip clock. The middle pin is the one to be connected to GND. Cristal resonators typical precision is better than 1%. For short periods (up to 50 hours) this frequency error is not significant. But if you are going to make cyclic or very long-delay timers, the error can accumulate and become visible. Just consider how a clock accumulating a one-minute error every 100 minutes results in a three-days error over a year! |
If you have a 4MHz XCO, a small 4-pin self.oscillating module often sold
on surplus fairs, you can drive a Nutchip connecting XCO output to Nutchip
XTAL1 pin. In this case XTAL2 is not connected.
The same applies for an external 4MHz clock source. |
Nutchips talk with PCs through RX and TX pins. The protocol is standard serial, 9600 bps, N, 8, 1. You can program Nutchip prior to plugging into actual circuit board, or (re)program them in-circuit: the latter case requires at least a programming connector to be added to the board. As the prgramming circuit requires just 2 transistors, it could be wise to incorporate it to most of your projects. For more details about PC interfaces click here |
If you decide not to include the programming interface on-board, we suggest you to at least leave a programming connector for the necessary signals. The connector can host a PC interface in case you need to reprogram or monitor the Nutchip. The female connector must be suitable for fitting a male pin-strip whith pins spaced 2.54 mm apart. A cheap conector can be made from a 4+4 dual-in-line IC socket, cut in two. |
This is the simplest and cheaper among the programming interfaces. It works with almost every small-signal PNP and NPN transistor pair. Connector CN2 is a 2.54mm pin-strip provided for plugging into programming connector. Tip: Should you include the whole cuircuit to your actual board, we
suggest you to add a 10 kilooohm resistor across Q1 base and GND, to keep
in stable should the PC be disconnected. |
It is a simple extension cord which connects the interface to the PC.
If you use exclusively the 2 transistor interface above, you can adopt a simplifiede cable connecting olny 3 wires: pin 2, pin 3, and pin 5. |
After demodulation, the remote control signal enters Nutchip REMOTE pin. Always remember to select the correct kind of remote control (RF or infrared, key codes selection) before programming the Nutchip. |
This schematics refers to a TSOP1836 or TK1836 manufactured by Temic/Telefunken/Vishay. Other models suitable to be used with Nutchips are the SFH5110 (Siemens, Sharp) and LT1059 (Liteon): please note these models have a different pinout, please see the components page for details. |
There are many RF receivers available, in our test we adopted a pinout compatible with models NB-CE, RX-4M50RR30SF, RX-4M50SA60SF manufactured by Aurel, and MIPOT 2-5000650 manufactured by MIPOT. not all the modules have all of the pins: e.g. pin 5 is present only on Aurel modules, pin 12 only on Mipot's. Take care to alingn precisely the part while soldering it (some modules first pin is actually pin 2...) and not to reverse them. The ANTENNA pin is for connecting an external aerial, if you can't afford a commercial antenna a short rigid wire about 18 cm long will work OK. |
This power supply generates a 12V unregulated DC output in addition to a 5V
regulated source suitable for the logic chips (Nutchip). The 12V output is handy
for powering relays, for example.
If you are not going to take advantage from the 12V output then you can use
any transformer in the range from 7.5 to 14Vac in place of the 10V specified
on the schematic diagram. Integrated circuit U1 (power regulator) must be mounted
on a heatsink. Be careful when connecting the transformer, as it is connected
to live mains - with potentially dangerous (lethal) voltages. We suggest you
to add a mains switch and fuse to complete the circuit.
Used computer cases - power supplies included - are found for cheap in flea markets or surplus stores. Most of the times the power supply is still working perfectly. It is a very powerful power supply, capable to source tens of amperes, with multiple voltages (usually +5V , 12V, -12V, -5V). Look for a model with embedded power switch. Usually the cables follow this color coding: red = 5V, black=GND (common to all voltages), yellow = 12V; but please check all voltage with a multimeter and verifiy your findings against the label. Cables with the same color are usually in parallel. |
Proper RESET is very important for Nutchips. RESET failure
can stall the chip at power-on, while spikes, brown-outs and other anomalies
that can happen while the chip is working can block the chip or erase its
memory if the chip is not RESET immediately. Brown-out is a typical example: during brow-outs, the power voltage decreases under minimum working levels - altough without reaching zero volts. During brown-outs the RESET pin must always be at logic zero, to ensure the chip does not work out of its specified range. |
For lab experiments and non-critical designs (like a simple toy) that should not be used for extended periods of time, the RESET pin can be simply connected to +5V. You can also use a 100 kiloohm resistor in order to take advantage from little parasitic capacitance on the RESET pin. |
A resistor and a capacitor make a simple and affordable RESET circuit. |
This is an improved variant of the previous circuit. It performs better in case of short power drops or interruptions: in fact, the diode discharges the capacitor very quickly hould the power drop. When the power comes back, the diode does not conduct and the resistor operates the power-on delay allowing power to stabilize before firing the Nutchip. |
Of course, the best reset is achieved using a specialized intgrated circuit. The MC34064 generates a low-level reset any time it detects a voltage drop below 4.5 V. This happens whenever we power on or off the circuit: with the MC34064, we can be sure the RESET pin is always kept low for the period determined by resistor R! and capacitor C1. |