You are on page 1of 32

Minor project

2012

Abstract

A support system is used for supporting and enabling the orientation of a circular satellite antenna dish in azimuth and elevation. The system includes a hoop structure, the ends of which are connected to the antenna dish. The hoop structure is mounted for rotation about Y axis of the dish.The central axis of the hoop is coincidental with the ccentral axis of the antenna. The base is rotated with the help of a servo motor providing us the azimuth.

The device is less bulky lighter weight and less costly and does not have an overhead blind spot and is particularly suitable for use in smaller portable installations. Therefore it provides improved structure with full azimuth and elevation orientation for an antenna which can be used to communicate with satellite.

Description of the drawing Front elevation view. Side elevation view Front elevation view for illustrating the mechanism for the hoop structure. Top elevation view for drive of the base structure. Front elevation view illustrating the antenna elevation and azimuth drive Detailed Description of the apparatus

Referring now to the figures. A preferred embodiment of the device is shown. 1.Antenna assembly which includes parabolic reflector dish mounted on the base assembly

  • 2. Using nuts and bolts the antenna is fixed to the hoop structure for providing the elevational motion of the satellite

3.the dish is thus supported for pivotal motion relaive to its base.

4.the system is joined to the base structure as shown in figure.

  • 5. The base for the hoop structure is fixed to a square disc with the help of nuts .

6.Giving support for the rotor at the bottom. The rotor of the motor is fixed to center of the disc. Thus the whole structure is supported by the rotor whose motion gives the azimuth control of the dish.

Minor project

2012

Introduction

What is a Satellite Dish

A satellite dish is a dish-shaped type of parabolic antenna designed to receive microwaves from communications satellites, which transmit data transmissions or broadcasts, such as satellite television.

Principle of operation

The parabolic shape of a dish reflects the signal to the dish’s focal point. Mounted on brackets at the dish's focal point is a device called a feedhorn. This feedhorn is essentially the front-end of a waveguide that gathers the signals at or near the focal point and 'conducts' them to a low-noise block downconverter or LNB. The LNB converts the signals from electromagnetic or radio waves to electrical signals and shifts the signals from the downlinked C-band and/or K u -band to the L-band range. Direct broadcast satellite dishes use an LNBF, which integrates the feedhorn with the LNB. (A new form of omnidirectional satellite antenna, which does not use a directed parabolic dish and can be used on a mobile platform such as a vehicle was announced by the University of Waterloo in 2004. [1]

The theoretical gain (directive gain) of a dish increases as the frequency increases. The actual gain depends on many factors including surface finish, accuracy of shape, feedhorn matching. A typical value for a consumer type 60 cm satellite dish at 11.75 GHz is 37.50 dB.

With lower frequencies, C-band for example, dish designers have a wider choice of materials. The large size of dish required for lower frequencies led to the dishes being constructed from metal mesh on a metal framework. At higher frequencies, mesh type designs are rarer though some designs have used a solid dish with perforations.

A common misconception is that the LNBF (low-noise block/feedhorn), the device at the front of the dish, receives the signal directly from the atmosphere. For instance, one BBC News downlink shows a "red signal" being received by the LNBF directly instead of being beamed to the dish, which because of its parabolic shape will collect the signal into a smaller area and deliver it to the LNBF. [2]

Modern dishes intended for home television use are generally 43 cm (18 in) to 80 cm (31 in) in diameter, and are fixed in one position, for Ku-band reception from one orbital position. Prior to the existence of direct broadcast satellite services, home users would generally have a motorised C-band dish of up to 3 metres in diameter for reception of channels from different satellites. Overly small dishes can still cause problems, however, including rain fade and interference from adjacent satellites.

2

Minor project

2012

Types

Motor-driven dish

A dish that is mounted on a pole and driven by a stepper motor or a servo can be controlled and rotated to face any satellite position in the sky. Motor-driven dishes are popular with enthusiasts. There are three competing standards: DiSEqC, USALS, and 36v positioners. Many receivers support all of these standards.

Multi-satellite

Special dish for up to 16 satellite positions (K -band).

Special dish for up to 16 satellite positions (K u -band).

Some designs enable simultaneous reception from multiple different satellite positions without re-positioning the dish. The vertical axis operates as an off-axis concave parabolic concave hyperbolic Cassegrain reflector, while the horizontal axis operates as a concave convex Cassegrain. The spot from the main dish wanders across the secondary, which corrects astigmatism by its varying curvature. The elliptic aperture of the primary is designed to fit the deformed illumination by the horns. Due to double spill-over, this makes more sense for a large dish.

3

Minor project

2012

VSAT

A common type of dish is the very small aperture terminal (VSAT). This provides two way satellite internet communications for both consumers and private networks for organisations. Today most VSATs operate in K u band; C band is restricted to less populated regions of the world. There is a move which started in 2005 towards new K a band satellites operating at higher frequencies, offering greater performance at lower cost. These antennas vary from 74 to 120 cm (29 to 47 in) in most applications though C-band VSATs may be as large as 4 m (13 ft).

Others

U.S. residential satellite TV receiver dishes

  • Individual dishes serving one dwelling: Direct to Home (DTH).

  • Collective dishes, shared by several dwellings: satellite master antenna television (SMATV) or communal antenna broadcast distribution (CABD).

Ad hoc

The dish is a reflector antenna and almost anything that reflects radio frequencies can be used as a reflector antenna. This has led to dustbin lids, woks and other items being used as "dishes". Coupled with low noise LNBs and the higher transmission power of DTH satellites, it is easier to get a usable signal on some of these "dishes".

4

Minor project

2012

Design Method

Principles of operation

A DC motor is used in a control system where an appreciable amount of shaft power is required. The DC motors are either armature-controlled with fixed field, or field-controlled with fixed armature current. DC motors used in instrument employ a fixed permanent-magnet field, and the control signal is applied to the armature terminals.

Minor project 2012 Design Method Principles of operation A DC motor is used in a control

Fig.

1.

(a) Schematic diagram of an armature-controlled DC servo motor, (b) Block diagram

In order to model the DC servo motor shown in Fig. 1, we define parameters and variables as follows.

R a

= armature-winding resistance, ohms

  • L a = armature-winding inductance, henrys

  • i a = armature-winding current, amperes

  • i f

= field current, amperes

e a = applied armature voltage, volts e b = back emf, volts θ = angular displacement of the motor shaft, radians T = torque delivered by the motor, lb-ft J = moment of inertia of the motor and load referred to the motor shaft, slug-ft 2 .

f = viscous-friction coefficient of the motor and load referred to the motor shaft, lb-ft/rad/sec

The torque T is delivered by the motor is proportional to the product of the armature current i a

and the

air

gap

flux Ψ, which

is in turn

is proportional to the field current

5

 

Minor project

2012

 

Ψ = K f

 

i

f

where

K f

is a constant. The torque

can be written as

 

T = K f i f K a

 

i

a

where

K a

is also constant. Therefore, the torque is proportional to the armature current so that with

a motor torque constant K ,

T = K i a

The back emf is proportional to the angular velocity dθ/dt. Thus, with a back emf constant K b , we have

e b

dt

= K b

The speed f an armature controlled DC servo motor is controlled by the armature voltage e a , which is

supplied by a power supply (or amplifier). The differential equation for the armature circuit is

lL

di a

+ R

i

+ e

=

a

dt

a e

a

b

a

The armature current produces the torque which is applied to the inertia and friction.

d 2 θ

J dt 2

+ f

 

=

T = K i a

 

dt

Assuming that all initial condition are zero, and taking the Laplace transforms of the above three differ-

ential equations, we obtain the following equations in the Laplace transform.

K b sΘ(s)

(L a s + R a )I a (s) +

E b

(s) (J s 2

+

f

=

=

=

E b (s)

E a (s)

T (s) = K I a

Considering

E a (s)

as

the

input,

and Θ(s)

as the output, we can construct the block diagram

shown

in Fig.

1 (b)

from these

three

equations.

The effect of the

back

emf is seen

to

be the

feedback signal

proportional to the speed of the motor. This back emf thus increases the effective damping of the system.

The transfer function of this system is obtained as follows.

 

Θ(s)

=

K

E a (s)

s[L a J s 2

+ (L a f + R a J )s + R a f + K

 

K b ]

The

inductance L a

in

the armature circuit is usually small and maybe neglected.

If L a

is neglected,

the transfer function is reduced to

Θ(s)

 

K

K

=

=

E a (s)

s[(L a f

+ R a J )s + R a f + K

whee

K b ]

6

Minor project

2012

K

m

s(T m s

+1)

K m

=

T m

=

R

a f +

K K b

= motor gain constant

R a

J

R

a f +

K K b

= motor time constant

Recalling that the angular velocity is the derivative of the angular position,

ω =

dt

or

Ω(s) = sΘ(s)

we have transfer function from the input E a (s) to the angular velocity (s),

Ω(s)

K m

=

E a (s)

(T m s + 1)

Applying the final value theorem to the response to the unit

step input

of 1V, 1/s,

ω() =

lim s

s0

K m

1

(T m s + 1) s

= K m

The

gain

voltage of

K m

thus

means

the

final angular

velocity

that the

DC motor

reaches

1V. T m

is the time constant that indicates

time for the angular

velocity

to

with

reach

the

input − 1
input
− 1

1 e

= 0.6321.

Therefore,

these constants K m

and T m

can be measured

without knowing the mechanical

parameters J , f and the torque delivered by the DC motor.

Fig. 2. (a) Positional Servomechanism
Fig.
2.
(a) Positional Servomechanism

7

Minor project

2012

  • 1.2 Analog Circuit

Fig.

2 is the

diagram

showing the positional

servomechanism

applied

to

a DC servo motor.

A rotary

position sensor (potentiometer - right) is coupled to the motor shaft to measure the angle.

Our design

project is to accomplish the negative feedback by the Arduino-Duemilanove board. We do not have the load

connected to the DC servo motor.

But,

when an external

load

of J L

and f L

is

connected to the

output shaft

of the

down gear of gear

ratio

n,

both

moment

of inertia

J and friction coefficient f are

modified as

 
 

J

=

J m

+

n 2

 

J L

 

f

=

f m

+ n 2

 

f L

changing the mechanical system’s time constant T m

and gain

K m .

 
 

We use a small

DC motor

to realize the positional

servo mechanism.

Before we do computer control

by

the

microcontroller, we build

a stand-alone positional

servo system

from analog components.

The

DC motor is Servo RK-1211 (RoboKits). Torque

at

6 V is 16 kg/cm,

and

speed at

6 V is 0.14 sec/60

according

to

the

spec.

on the box.

The schematic

diagram of the servo system is shown in Fig.

3. Major

components are,

 
  • 1. Servo RK-1211 (Robokits)

  • 2. Rotary potentiometer 10KΩ

    • 3. A laptop connected with the Arduino Board which acts as power supply as well.

8

Minor project

2012

Preparatory Measurement

We assume that potentiometers both reference and built-in the DC motor are connected to the supply

voltage of ±6 V as shown in the schematic diagram. Another important assumption is that the angle is

measured in terms of ―revolutions‖ instead of radians or degrees. So, 90 is 0.25 revolutions. This also

make the velocity to be measured in ―rps‖ revolutions per second. Once the stand-alone analog circuit for

the positional servo system is built,

make sure first that the output angle θ follows the movement of

VR1 potentiometer. In order to make the block diagram to represent exactly the constructed system,

measure K m and T m .

  • 1. K m

Open loop gain

: Calculate the velocity in terms ―revolutions per second,

rps‖which

is K m .

  • 2. From the exponential

T m

rise or decay part

of the waveform, measure the open

loop time constant

T

from the

 

t

 

function e

T . Actually,

measure

the time

T that the

amplitude decays down to 1 e 1

= 0.6321.

When we have a unity gain feedback around a forward transfer function G(s), the feedback system’s

transfer function is given by

Since our G(s)

is

G c (s)

G(s)

=

1 + G(s)

G(s)

=

12K m

,

s(T m s +1)

The closed loop transfer

function

G c (s)

is given by

From the characteristic equation

G c (s)

12K m

=

T m s 2

+ s + 12K m

T m s 2

+ s + 12K m

=

T m (s + a)(s

+ b) = 0

we will likely have two real roots

s = a and

s = b.

From

the time

response,

C 1 e at

+ C 2 e bt

t

= C 1

e T 1

t

+ C 2 e T 2

We can calculate

two time constants T 1

=

1

a

and

=

T 2

1

b

.

The expected

closed loop time constant,

9

Minor project

2012

representing how fast the output reaches the reference angle, is close to the larger time constant of the

two, T 1

and

T 2 .

Minor project 2012 representing how fast the output reaches the reference angle, is close to the

Fig.

4.

(a) Positional Servomechanism, block diagram

10

 

Minor project

2012

Matlab Code

num=[12*7.476];

den=[0.153 1 12*7.476];

H=tf(num,den);

step(H)

Minor project 2012 Matlab Code num=[12*7.476]; den=[0.153 1 12*7.476]; H=tf(num,den); step(H) 11

11

 

Minor project

2012

num=[7.476];

den=[0.153 1];

H=tf(num,den);

step(H)

Minor project 2012 num=[7.476]; den=[0.153 1]; H=tf(num,den); step(H) 12

12

 

Minor project

2012

Detailed Design

1. SERVO :

SERVOMOTOR INFORMATION

A servo is a mechanical motorized device that can be instructed to move the output shaft attached to a servo

wheel or arm to a specified position. Inside the servo box is a DC motor mechanically linked to a position

feedback potentiometer, gearbox, electronic feedback control loop circuitry and motor drive electronic circuit.

Minor project 2012 Detailed Design 1. SERVO : SERVOMOTOR INFORMATION A servo is a mechanical motorized

A typical R/C servo looks like a plastic rectangular box with a rotary shaft coming up and out the top of the box

and three electrical wires out of the servo side to a plastic 3 pin connector. Attached to the output shaft out the

top of the box is a servo wheel or Arm. These wheels or arms are usually a plastic part with holes in it for attaching

push / pull rods, ball joints or other mechanical linkage devices to the servo. The three electrical connection wires

out of the side are V- (Ground), V+ (Plus voltage) and S Control (Signal). The control S (Signal) wire receives

Pulse Width Modulation (PWM) signals sent from an external controller and is converted by the servo on board

circuitry to operate the servo.

R/C Servos are controlled by sending pulse width signals (PWM) from an external electronic device that

generates the PWM signal values, such as a servo controller, servo driver module or R/C transmitter and receiver.

Pulse Width Modulation or PWM signals sent to the servo are translated into position values by electronics

inside the servo. When the servo is instructed to move (Received a PWM signal) the on board electronics convert

the PWM signal to a electrical resistance value and the DC motor is powered on. As the motor moves and rotates

the linked potentiometer also rotates. Electrical resistance value from the moving potentiometer are sent back to

the servo electronics until the potentiometer value matches the position value sent by the on-board servo

electronics that was converted from the PWM signal. Once the potentiometer value and servo electronic signals

match, the motor stops and waits for the next PWM signal input signal for conversion.

13

 

Minor project

2012

A pulse width signal (PWM) of approximately 1.5 mS (1500 uS) is the "neutral" position for the servo. The

servo, neutral is defined to be the point where the servomotor has exactly the same amount of potential rotation

in the counter clockwise direction as it does in the clockwise direction. When the pulse width signal (PWM) sent

to a servo is less than 1.5 mS. the servo moves some number of degrees counterclockwise from the neutral point.

When the pulse is greater than 1.5mS the servo moves some number of degrees clockwise from the neutral point.

Generally the minimum pulse will be about 1.0 mS and the maximum pulse will be 2.0 ms with neutral ( Stop)

movement at 1.5 mS

R/C servos run on 5 volts DC but they often work with voltages V-, V+ between 4 and 6 volts DC power, near

1 Amp of current. (Torque load on the servo arm determines amps and can be from 200 mA to 1 Amp depending

on moving or holding force the servo needs for position)

SERVO INFORMATION

Servo Ratings

The most common details available on a servo are its speed and torque rating. Nearly all servo packages are listed

with brand name, model name/ number, speed, and torque output at 4.8 volts and 6.0 volts. Some information

aboutmetal, plastic gears or ball bearings may also be listed.

Servo Speed

Servo Speed is defined as the amount of time ( in seconds) that a servo arm attached to the servo output shaft will

move from 0 to 60 degrees.

Servo Speed is measured by the amount of time (in seconds)it takes a 1 inch servo arm to sweep left or right through a 60

degree arc at either 4.8 or 6.0 volts. A servo rated at 0.22seconds/60 degrees takes 0.22 seconds to sweep through a 60

degree arc. Some of the fastest servos available move in the0.06 to 0.09 second range. In some servos, faster speeds may

lower torque available.

Minor project 2012 A pulse width signal (PWM) of approximately 1.5 mS (1500 uS) is the

14

 

Minor project

2012

Servo Torque

Servo Torque is defined as ounce-inch (oz-in).The total push / pull power a servo can apply on a 1" servo arm when

moving.

Servos have a certain amount of torque (strength) that isgenerally proportional to their size. Servos come in all kinds of

sizes, strengths and weight. Torque is the measurement of forcegiven over a distance. For most servos in the USA, torque is

measured in oz-in (force in ounces times inches, orounce-inch). Servo Torque is measured by the amount of weight (in

ounces) that a servo can hold at 1-inch out on the servo output arm in the horizontal plane, again at either 5.0 or 6.0 volts to

see when the servo stalls as it tries to lift the weight horizontally. The reported result is a measurement like this:

Servo XYZ = 100 oz/in. @ 6.0 V. That means that Servo XYZ is capable of holding 100 ounces using a 1 inch output arm

without excessive deflection at 6.0 input volts. To convert oz-into kilogram-centimeters (kg-cm) just divide by 13.9

Examples: Servo-A has 42 oz-in of torque 42 divided by 16 = 2.63 pounds of force on a 1" servo arm

Servo-B has 2.5 oz-in of torque 2.5 divided by 2 = 1.25 pounds of force on a 2" servo arm

Servo-C has 36 oz-in of torque 36 divided by 4 = 9 pounds of force on a 4" servo arm

Note: If you need to know how many pounds a servo can push or lift on a 1" servo arm, divide the oz-in by

the number 16. Different sized arms can be used. Use the length of the arm and divide the oz-in value by the

arm length

Minor project 2012 Servo Torque Servo Torque is defined as ounce-inch (oz-in).The total push / pull

15

 

Minor project

2012

SERVO INFORMATION

Minor project 2012 SERVO INFORMATION Servo power Servo Power is defined as the amount of DC

Servo power

Servo Power is defined as the amount of DC Voltage needed to operate a Servo without damage.

Servo operate from 4.5 to 6.0 volts DC. At the higher voltage servos tend to be faster and sometimes stronger, but can heat up

faster when stalled or in a hold position with stress forces

against the servo output shaft. Some servo controllers require a separate power source from the control source to deliver the

higher 6.0 Vdc. The current drain (Amps required) depends on the torque being put out by the servo motor and can be in

excess of one amp if the servo is stalled under load.

It is best to calculate 1 Amp per servo when figuring power supply needs for most servos.

Servo Connector

(S) Signal =Yellow (PWM Signal)

(+) 5 Vdc = Red

(-) Ground = Black

16

 

Minor project

2012

Servo wire Information

Minor project 2012 Servo wire Information 17
Minor project 2012 Servo wire Information 17

17

 

Minor project

2012

Servo function

Minor project 2012 Servo function 18
Minor project 2012 Servo function 18
Minor project 2012 Servo function 18
Minor project 2012 Servo function 18
Minor project 2012 Servo function 18

18

 

Minor project

2012

Minor project 2012 19
Minor project 2012 19

19

 

Minor project

2012

Servo Mechanics

Minor project 2012 Servo Mechanics 20
Minor project 2012 Servo Mechanics 20

20

 

Minor project

2012

Servo Centering

R/C servos are usually mechanically stopped from moving at full rotation. They have limited rotation through a

mechanical, plastic block on the internal gearing and can rotate about 90 to 180 degrees or less only. Servos are

unable to continually rotate and usually can't be used for driving rotating wheels. A servos precision positioning

makes them ideal for robotics and animatronics, since servos are self contained with control loop circuitry, drive

circuits, servo position, speed control, and are very easy to control by an external device such as a electronic

servo controller board used in animatronic character and robotic applications.

Servos are dynamic devices that when instructed to move position, will actively move to hold the position, If for

example a servo is instructed to move in the clockwise position and an external force is present and pushing

against the servo such as a mechanical linkage, the servo will resist being moved out of that position or continue

to try and move to the instructed position, even if the servo arm is incorrectly placed on the motor shaft, until

powered off. It is for this reason that every servo output arm or servo wheel used should be placed into the

neutral position before instillation into your project.

Setting the servo arm or wheel to the neutral position prevents stress to the servo motor, damages to the

electronics and provides wider movement ranges and angles for operating the mechanical linkages connected to

the servo arm or servo wheel.

Minor project 2012 Servo Centering R/C servos are usually mechanically stopped from moving at full rotation.
21
21
Minor project 2012 Servo Sizes
Minor project
2012
Servo Sizes
Minor project 2012 Servo Sizes 22
22
22

Minor project

2012

Further Information

Minor project 2012 Further Information 23
Minor project 2012 Further Information 23

23

 

Minor project

2012

ARDUINO

Parts list

Printed Circuit Board (with all the tiny bits pre-soldered on)

Power Jack

Power Switch

3-Pin Header (for USB <--> Jack power selection)

Shunt (for above header)

2x3 6-Pin header (for In-circuit serial programming)

2 x 6-socket headers (for shield interface)

2 x 8-socket headers (also for shield interface)

28-Pin DIP Socket for Atmel Microcontroller

tm ATmega-328 Atmel Microcontroller with Arduino bootloader

Pushbutton reset switch

USB Jack (mini-B)

Minor project 2012 ARDUINO Parts list  Printed Circuit Board (with all the tiny bits pre-soldered

24

 

Minor project

2012

Introduction

Arduino is a popular open-source single-board microcontroller, descendant of the open-source Wiring

platform, designed to make the process of using electronics in multidisciplinary projects more accessible. The

hardware consists of a simple open hardware design for the Arduino board with an Atmel AVR processor and on-

board input/output support. The software consists of a standard programming language compiler and theboot

loader that runs on the board.

Arduino hardware is programmed using a Wiring-based language (syntax and libraries), similar to C++ with some

slight simplifications and modifications, and a Processing-based integrated development environment.

Current versions can be purchased pre-assembled; hardware design information is available for those who would like

to assemble an Arduino by hand. Additionally, variations of the Italian-made Arduinowith varying levels of

compatibilityhave been released by third parties; some of them are programmed using the Arduino software.

Platform

1.Hardware

An Arduino board consists of an 8-bit Atmel AVR microcontroller with complementary components to facilitate

programming and incorporation into other circuits. An important aspect of the Arduino is the standard way that

connectors are exposed, allowing the CPU board to be connected to a variety of interchangeable add-on modules

known as shields. Official Arduinos have used the megaAVR series of chips, specifically the ATmega8, ATmega168,

ATmega328, ATmega1280, and ATmega2560. A handful of other processors have been used by Arduino

compatibles. Most boards include a 5 volt linear regulator and a 16 MHz crystal oscillator (or ceramic resonator in

some variants), although some designs such as the LilyPad run at 8 MHz and dispense with the onboard voltage

regulator due to specific form-factor restrictions. An Arduino's microcontroller is also pre-programmed with a boot

loader that simplifies uploading of programs to the on-chip flash memory, compared with other devices that typically

need an external programmer.

At a conceptual level, when using the Arduino software stack, all boards are programmed over an RS-232 serial

connection, but the way this is implemented varies by hardware version. Serial Arduino boards contain a simple

inverter circuit to convert between RS-232-level and TTL-level signals. Current Arduino boards are programmed

via USB, implemented using USB-to-serial adapter chips such as the FTDI FT232. Some variants, such as the

Arduino Mini and the unofficial Boarduino, use a detachable USB-to-serial adapter board or cable,Bluetooth or other

methods. (When used with traditional microcontroller tools instead of the Arduino IDE, standard AVR ISP

programming is used.)

The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. The Diecimila, now

superseded by the Duemilanove, for example, provides 14 digital I/O pins, six of which can produce pulse-width

modulated signals, and six analog inputs. These pins are on the top of the board, via female 0.1 inch headers. Several

plug-in application shields are also commercially available.

The Arduino Nano, and Arduino-compatible Bare Bones Board and Boarduino boards provide male header pins on

the underside of the board to be plugged into solderless breadboards.

Arduino Board Models

25

 

Minor project

2012

Minor project 2012 26

26

 

Minor project

2012

2.Software

The Arduino IDE is a cross-platform application written in Java, and is derived from the IDE for the Processing

programming language and the Wiring project. It is designed to introduce programming to artists and other

newcomers unfamiliar with software development. It includes a code editor with features such as syntax

highlighting, brace matching, and automatic indentation, and is also capable of compiling and uploading programs to

the board with a single click. There is typically no need to edit makefiles or run programs on a command-line

interface. Although building on command-line is possible if required with some third-party tools such as Ino.

The Arduino IDE comes with a C/C++ library called "Wiring" (from the project of the same name), which makes

many common input/output operations much easier. Arduino programs are written in C/C++, although users only

need define two functions to make a runnable program:

  • setup() a function run once at the start of a program that can initialize settings

  • loop() a function called repeatedly until the board powers off

A typical first program for a microcontroller simply blinks a LED on and off. In the Arduino environment, the

user might write a program like this:

#define LED_PIN 13

void setup () {

pinMode (LED_PIN, OUTPUT);

}

void loop () {

// enable pin 13 for digital output

digitalWrite (LED_PIN, HIGH);

// turn on the LED

delay (1000);

// wait one second (1000 milliseconds)

digitalWrite (LED_PIN, LOW);

// turn off the LED

delay (1000);

// wait one second

}

For the above code to work correctly, the positive side of the LED must be connected to pin 13 and the negative side

of the LED must be connected to ground. The above code would not be seen by a standard C++ compiler as a valid

program, so when the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written to a

temporary file with an extra include header at the top and a very simple main() function at the bottom, to make it a

valid C++ program.

The Arduino IDE uses the GNU toolchain and AVR Libc to compile programs, and uses avrdude to upload programs

to the board.

For educational purposes there is third party graphical development environment called Minibloq available under a

different open source license.

27

 

Minor project

2012

Construction

Step 1: The Reset Switch - What good is building a project that will take over the world (starting with your workshop)

if you don’t have a convenient way to knock it over the head? Exactly. Install this, here.

Minor project 2012 Construction Step 1: The Reset Switch - What good is building a project

Step 2: The ICSP 6-Pin Header & 28-Pin DIP Socket - Install them where shown. Watch that the notch on the end of

the 28-Pin DIP socket matches the picture on the PCB. It’s not critical, but it’s a good idea so you know how to

install the chip later.

28
28

Minor project

2012

Step 3: The Power Jack and 3-Pin Power Selector - Solder the jack into the only place that it will fit, and install the 3-

pin header where shown. Do NOT install it in the power switch location!

Minor project 2012 Step 3: The Power Jack and 3-Pin Power Selector - Solder the jack

Step 4: The USB Connector and the Power Switch. A small ―mini-B‖ connector is in your kit, but you can use a big

USB Jack (guess which we like best?).

NOTE: If you are planning on using Shield add-ons, you should use the ―Mini-B‖. Our design pushes the USB-B

connector up to make room for the switch, and it will interfere with some Shield boards. Not so for the Mini-B.

29
29

Minor project

2012

Step 5: The 6 and 8-Pin Headers. You don’t need to install these, but they’ll let you add Shield add-on boards, and

make it easy to plug wires in for quick prototyping. Install them on the top.

Minor project 2012 Step 5: The 6 and 8- Pin Headers. You don’t need to install

Step 6: Atmel ATmega328 - Almost time to install the brains! BEFORE touching the chip, touch a metal sink, your

computer’s USB cable connector or similar to discharge any static you may have built up. Static zaps will kill your

chip, so try to keep yourself grounded to something that will drain the staticcharge.

Insert the microcontroller so the end with the notch points left; the same side the notch on the carrier.

Minor project 2012 Step 5: The 6 and 8- Pin Headers. You don’t need to install

30

 

Minor project

2012

Testing the Board

Now download the latest Arduino software from the Arduino group

(http://www.arduino.cc/en/Main/Software). It’s time to test it!

The easiest way to test your board is to:

  • 1. Put the power jumper on the top two pins so it’s powered by the USB port.

  • 2. Plug it into your PC’s USB port.

  • 3. Let your computer detect it and install the USB device drivers.

  • 4. Turn on the Freeduino’s power switch (the power LED lights up).

  • 5. The blue LED should start blinking. That’s a sign the chip is alive.

  • 6. Let’s test programming. Load up the ―blink‖ code that comes with the

Arduino software (File/Sketchbook/Examples/Digital/Blink).

  • 7. Click the ―upload‖ button (CTRL-U).

8.

...

watch

the blinky lights on the upper-left corner of your Freeduino

...

  • 9. Watch your blue blinky light do it’s thing! It takes programs!

31
31

Minor project

2012

32