41
1 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

Final Report(Minor Project)

Embed Size (px)

Citation preview

Page 1: Final Report(Minor Project)

1

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.

Page 2: Final Report(Minor Project)

2

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 Ku-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.

Types

Page 3: Final Report(Minor Project)

3

Minor project 2012

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 (Ku-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.

VSATA 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 Ku band; C band is restricted to less populated regions of the world. There is a move which started in 2005

towards new Ka band satellites operating at higher frequencies, offering greater performance at lower cost. These

Page 4: Final Report(Minor Project)

4

Minor project 2012

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).

Automatic Tracking Satellite Dish

Big ugly dish

Ad hocThe 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".

Page 5: Final Report(Minor Project)

5

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.

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.

Ra = armature-winding resistance, ohmsLa = armature-winding inductance, henrysia = armature-winding current, amperesif = field current, amperesea = applied armature voltage, voltseb = back emf, voltsθ = angular displacement of the motor shaft, radiansT = torque delivered by the motor, lb-ftJ = moment of inertia of the motor and load referred to the motor shaft, slug-ft2 .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 ia and the air gap flux Ψ, which is in turn is proportional to the field current

Page 6: Final Report(Minor Project)

6

Minor project 2012

Ψ = Kf if

where Kf is a constant. The torque can be written as

T = Kf if Ka ia

where Ka is also constant. Therefore, the torque is proportional to the armature current so that with a motor torque constant K ,

T = K ia

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

dθ eb = Kb dt

The speed f an armature controlled DC servo motor is controlled by the armature voltage ea , which is supplied by a power supply (or amplifier). The differential equation for the armature circuit is

lL dia

+ R i + e =

ea dt

a a b a

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

d2 θ dθJ

dt2 + f dt = T = K ia

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.

Kb sΘ(s) = Eb (s)

(La s + Ra )Ia (s) + Eb

(s) (J s2 + f s)Θ(s)

=

=

Ea (s)

T (s) = K Ia (s)

Considering Ea (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)=

Ea (s)K

s[La J s2 + (La f + Ra J )s + Ra f + K Kb ]

The inductance La in the armature circuit is usually small and maybe neglected. If La is neglected, the transfer function is reduced to

whee

Θ(s)=

Ea (s)K

=s[(La f + Ra J )s + Ra f + K

Kb ]

K

Kms(Tm s +1)

Page 7: Final Report(Minor Project)

7

Minor project 2012

Km =R f + K K

= motor gain constanta b

Ra J

Tm =R f + K K

= motor time constanta b

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

dθω = or Ω(s) = sΘ(s)

dt

we have transfer function from the input Ea (s) to the angular velocity Ω(s),

Ω(s)Ea (s)

=Km

(Tm s + 1)

Applying the final value theorem to the response to the unit step input of 1V, 1/s,

Kmω(∞) = lim s 1= Km

s→0 (Tm s + 1) s

The gain Km thus means the final angular velocity that the DC motor reaches with the input voltage of 1V. Tm is the time constant that indicates time for the angular velocity to reach 1 − e−1

= 0.6321. Therefore, these constants Km and Tm can be measured without knowing the mechanical parameters J , f and the torque delivered by the DC motor.

Fig. 2. (a) Positional Servomechanism

Page 8: Final Report(Minor Project)

8

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 JL and fL 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 = Jm + n2

JL

f = fm + n2

fL

changing the mechanical system’s time constant Tm and gain Km .

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.

Page 9: Final Report(Minor Project)

T

9

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 Km and Tm .

1. Km Open loop gain : Calculate the velocity in terms “revolutions per second, rps”which is Km .

2. Tm From the exponential 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(s)Gc (s) =

1 + G(s)

G(s) =12Km

, s(Tm s +1)

The closed loop transfer function Gc (s) is given by

12Km

From the characteristic equation

Gc (s) =ms2 + s + 12Km

Tm s2 + s + 12Km = Tm (s + a)(s + b) = 0

we will likely have two real roots s = −a and s = −b. From the time response,

t t C1 e

−at + C2 e−bt = C1 e

− T1 + C2 e− T2

We can calculate two time constants T1 =

1and T2 =

a

1. The expected closed loop time constant,

b

Page 10: Final Report(Minor Project)

Minor project 2012

representing how fast the output reaches the reference angle, is close to the larger time constant of thetwo, T1 and T2 .

Fig. 4. (a) Positional Servomechanism, block diagram

10

Page 11: Final Report(Minor Project)

Minor project 2012

Matlab Code

num=[12*7.476];den=[0.153 1 12*7.476];

H=tf(num,den);step(H)

11

Page 12: Final Report(Minor Project)

Minor project 2012

num=[7.476];den=[0.153 1];H=tf(num,den);

step(H)

12

Page 13: Final Report(Minor Project)

Minor project 2012

Detailed Design

1. SERVO :

SERVOMOTOR INFORMATION

13

A servo is a mechanical motorized device that can be instructed to move the output shaft attached to a servowheel or arm to a specified position. Inside the servo box is a DC motor mechanically linked to a positionfeedback potentiometer, gearbox, electronic feedback control loop circuitry and motor drive electronic circuit.

A typical R/C servo looks like a plastic rectangular box with a rotary shaft coming up and out the top of the boxand 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 attachingpush / pull rods, ball joints or other mechanical linkage devices to the servo. The three electrical connection wiresout of the side are V- (Ground), V+ (Plus voltage) and S Control (Signal). The control S (Signal) wire receivesPulse Width Modulation (PWM) signals sent from an external controller and is converted by the servo on boardcircuitry to operate the servo.

R/C Servos are controlled by sending pulse width signals (PWM) from an external electronic device thatgenerates 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 electronicsinside the servo. When the servo is instructed to move (Received a PWM signal) the on board electronics convertthe PWM signal to a electrical resistance value and the DC motor is powered on. As the motor moves and rotatesthe linked potentiometer also rotates. Electrical resistance value from the moving potentiometer are sent back tothe servo electronics until the potentiometer value matches the position value sent by the on-board servoelectronics that was converted from the PWM signal. Once the potentiometer value and servo electronic signalsmatch, the motor stops and waits for the next PWM signal input signal for conversion.

Page 14: Final Report(Minor Project)

Minor project 2012

SERVO INFORMATION

Servo Ratings

Servo Speed

14

A pulse width signal (PWM) of approximately 1.5 mS (1500 uS) is the "neutral" position for the servo. Theservo, 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) sentto 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, near1 Amp of current. (Torque load on the servo arm determines amps and can be from 200 mA to 1 Amp dependingon moving or holding force the servo needs for position)

The most common details available on a servo are its speed and torque rating. Nearly all servo packages are listedwith 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 is defined as the amount of time ( in seconds) that a servo arm attached to the servo output shaft willmove 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 maylower torque available.

Page 15: Final Report(Minor Project)

Minor project 2012

Servo Torque

15

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 armServo-B has 2.5 oz-in of torque 2.5 divided by 2 = 1.25 pounds of force on a 2" servo armServo-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 bythe number 16. Different sized arms can be used. Use the length of the arm and divide the oz-in value by thearm length

Page 16: Final Report(Minor Project)

Minor project 2012

SERVO INFORMATION

Servo power

16

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 forcesagainst 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

Page 17: Final Report(Minor Project)

Minor project 2012

17

Page 18: Final Report(Minor Project)

Minor project 2012

Servo wire Information

18

Page 19: Final Report(Minor Project)

Minor project 2012

Servo function

19

Page 20: Final Report(Minor Project)

Minor project 2012

20

Page 21: Final Report(Minor Project)

Minor project 2012

Servo Mechanics

21

Page 22: Final Report(Minor Project)

Minor project 2012

Servo Centering

22

R/C servos are usually mechanically stopped from moving at full rotation. They have limited rotation through amechanical, plastic block on the internal gearing and can rotate about 90 to 180 degrees or less only. Servos areunable to continually rotate and usually can't be used for driving rotating wheels. A servos precision positioningmakes them ideal for robotics and animatronics, since servos are self contained with control loop circuitry, drivecircuits, 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 forexample a servo is instructed to move in the clockwise position and an external force is present and pushingagainst the servo such as a mechanical linkage, the servo will resist being moved out of that position or continueto try and move to the instructed position, even if the servo arm is incorrectly placed on the motor shaft, untilpowered off. It is for this reason that every servo output arm or servo wheel used should be placed into theneutral position before instillation into your project.

Setting the servo arm or wheel to the neutral position prevents stress to the servo motor, damages to theelectronics and provides wider movement ranges and angles for operating the mechanical linkages connected tothe servo arm or servo wheel.

Page 23: Final Report(Minor Project)

Minor project 2012

Servo Sizes

23

Page 24: Final Report(Minor Project)

Minor project 2012

Further Information

24

Page 25: Final Report(Minor Project)

Minor project 2012

ARDUINO25

Page 26: Final Report(Minor Project)

Minor project 2012

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)

Introduction

26

Page 27: Final Report(Minor Project)

Minor project 2012

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 Arduino—with varying levels of

compatibility—have 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

27

Page 28: Final Report(Minor Project)

Minor project 2012

2.Software

28

Page 29: Final Report(Minor Project)

Minor project 2012

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); // enable pin 13 for digital output

void loop ()

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.

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.

29

Page 30: Final Report(Minor Project)

Minor project 2012

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.

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!

30

Page 31: Final Report(Minor Project)

Minor project 2012

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.

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.

31

Page 32: Final Report(Minor Project)

Minor project 2012

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.

32

Page 33: Final Report(Minor Project)

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 theArduino 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!

33

Page 34: Final Report(Minor Project)

Minor project 2012

34