ix annexos

59
Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil IX ANNEXOS Índex ANNEX A FULLS DE CARACTERÍSTIQUES .................................................... 2 DS1307 .............................................................................................................. 3 HCSR501 ......................................................................................................... 15 Relé finder ........................................................................................................ 21 ACS712 ............................................................................................................ 26 ANNEX B Codi complert (sketch) ..................................................................... 41 ANNEX C PROGRAMACIÓ TEMPORAL......................................................... 51 ANNEX D GLOSSARI ...................................................................................... 54 ANNEX E GUIA D’ENTRADES I SORTIDES DEL PROTOTIP........................ 57 ANNEX F ESTUDIS AMBIENTALS SIGNIFICATIUS....................................... 58 Índex de taules Taula C 1. Durada de les tasques .................................................................... 53 Taula C 2. Durada de les tasques .................................................................... 53 Taula E 1. I/O Digitals ...................................................................................... 57 Taula E 2. I/O Analògiques............................................................................... 57 Taula F 1.Comparativa Estudi IDAE................................................................. 59 Taula F 2. Resultats Estudi IDAE ..................................................................... 59 Taula F 3. Resultats Estudi Super U ................................................................ 59 Taula F 4. Resultats Estudi Carrefour Itàlia ...................................................... 60 Taula F 5. Resultats Estudi Torre Agbar .......................................................... 61 Índex de figures Figura C 1 Diagrama de Gantt ......................................................................... 51 Figura C 2. Diagrama de Gantt ........................................................................ 52

Upload: others

Post on 04-Dec-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

IX ANNEXOS

Índex

ANNEX A FULLS DE CARACTERÍSTIQUES .................................................... 2

DS1307 .............................................................................................................. 3

HCSR501 ......................................................................................................... 15

Relé finder ........................................................................................................ 21

ACS712 ............................................................................................................ 26

ANNEX B Codi complert (sketch) ..................................................................... 41

ANNEX C PROGRAMACIÓ TEMPORAL......................................................... 51

ANNEX D GLOSSARI ...................................................................................... 54

ANNEX E GUIA D’ENTRADES I SORTIDES DEL PROTOTIP ........................ 57

ANNEX F ESTUDIS AMBIENTALS SIGNIFICATIUS ....................................... 58

Índex de taules

Taula C 1. Durada de les tasques .................................................................... 53

Taula C 2. Durada de les tasques .................................................................... 53

Taula E 1. I/O Digitals ...................................................................................... 57

Taula E 2. I/O Analògiques............................................................................... 57

Taula F 1.Comparativa Estudi IDAE ................................................................. 59

Taula F 2. Resultats Estudi IDAE ..................................................................... 59

Taula F 3. Resultats Estudi Super U ................................................................ 59

Taula F 4. Resultats Estudi Carrefour Itàlia ...................................................... 60

Taula F 5. Resultats Estudi Torre Agbar .......................................................... 61

Índex de figures

Figura C 1 Diagrama de Gantt ......................................................................... 51

Figura C 2. Diagrama de Gantt ........................................................................ 52

Page 2: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

ANNEX A FULLS DE CARACTERÍSTIQUES

Page 3: IX ANNEXOS

1 of 12 100101

FEATURES� Real-time clock (RTC) counts seconds,

minutes, hours, date of the month, month, dayof the week, and year with leap-yearcompensation valid up to 2100

� 56-byte, battery-backed, nonvolatile (NV)RAM for data storage

� Two-wire serial interface� Programmable squarewave output signal� Automatic power-fail detect and switch

circuitry� Consumes less than 500nA in battery backup

mode with oscillator running� Optional industrial temperature range:

-40°C to +85°C� Available in 8-pin DIP or SOIC� Underwriters Laboratory (UL) recognized

ORDERING INFORMATIONDS1307 8-Pin DIP (300-mil)DS1307Z 8-Pin SOIC (150-mil)DS1307N 8-Pin DIP (Industrial)DS1307ZN 8-Pin SOIC (Industrial)

PIN ASSIGNMENT

PIN DESCRIPTIONVCC - Primary Power SupplyX1, X2 - 32.768kHz Crystal ConnectionVBAT - +3V Battery InputGND - GroundSDA - Serial DataSCL - Serial ClockSQW/OUT - Square Wave/Output Driver

DESCRIPTIONThe DS1307 Serial Real-Time Clock is a low-power, full binary-coded decimal (BCD) clock/calendarplus 56 bytes of NV SRAM. Address and data are transferred serially via a 2-wire, bi-directional bus.The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end ofthe month date is automatically adjusted for months with fewer than 31 days, including corrections forleap year. The clock operates in either the 24-hour or 12-hour format with AM/PM indicator. TheDS1307 has a built-in power sense circuit that detects power failures and automatically switches to thebattery supply.

DS130764 x 8 Serial Real-Time Clock

www.maxim-ic.com

DS1307 8-Pin SOIC (150-mil)

DS1307 8-Pin DIP (300-mil)

X1X2

VBAT

GND

VCC

SQW/OUTSCL

l2

34

87

65 SDA

l

2

34

8

7

65

X1X2

VBAT

GND

VCC

SQW/OUTSCLSDA

Page 4: IX ANNEXOS

DS1307

2 of 12

OPERATIONThe DS1307 operates as a slave device on the serial bus. Access is obtained by implementing a STARTcondition and providing a device identification code followed by a register address. Subsequent registerscan be accessed sequentially until a STOP condition is executed. When VCC falls below 1.25 x VBAT thedevice terminates an access in progress and resets the device address counter. Inputs to the device willnot be recognized at this time to prevent erroneous data from being written to the device from an out oftolerance system. When VCC falls below VBAT the device switches into a low-current battery backupmode. Upon power-up, the device switches from battery to VCC when VCC is greater than VBAT + 0.2Vand recognizes inputs when VCC is greater than 1.25 x VBAT. The block diagram in Figure 1 shows themain elements of the serial RTC.

DS1307 BLOCK DIAGRAM Figure 1

TYPICAL OPERATING CIRCUIT

Page 5: IX ANNEXOS

DS1307

3 of 12

SIGNAL DESCRIPTIONSVCC, GND – DC power is provided to the device on these pins. VCC is the +5V input. When 5V isapplied within normal limits, the device is fully accessible and data can be written and read. When a 3Vbattery is connected to the device and VCC is below 1.25 x VBAT, reads and writes are inhibited. However,the timekeeping function continues unaffected by the lower input voltage. As VCC falls below VBAT theRAM and timekeeper are switched over to the external power supply (nominal 3.0V DC) at VBAT.

VBAT – Battery input for any standard 3V lithium cell or other energy source. Battery voltage must beheld between 2.0V and 3.5V for proper operation. The nominal write protect trip point voltage at whichaccess to the RTC and user RAM is denied is set by the internal circuitry as 1.25 x VBAT nominal. Alithium battery with 48mAhr or greater will back up the DS1307 for more than 10 years in the absence ofpower at 25ºC. UL recognized to ensure against reverse charging current when used in conjunction with alithium battery.

See “Conditions of Acceptability” at http://www.maxim-ic.com/TechSupport/QA/ntrl.htm.

SCL (Serial Clock Input) – SCL is used to synchronize data movement on the serial interface.

SDA (Serial Data Input/Output) – SDA is the input/output pin for the 2-wire serial interface. The SDApin is open drain which requires an external pullup resistor.

SQW/OUT (Square Wave/Output Driver) – When enabled, the SQWE bit set to 1, the SQW/OUT pinoutputs one of four square wave frequencies (1Hz, 4kHz, 8kHz, 32kHz). The SQW/OUT pin is opendrain and requires an external pull-up resistor. SQW/OUT will operate with either Vcc or Vbat applied.

X1, X2 – Connections for a standard 32.768kHz quartz crystal. The internal oscillator circuitry isdesigned for operation with a crystal having a specified load capacitance (CL) of 12.5pF.

For more information on crystal selection and crystal layout considerations, please consult ApplicationNote 58, “Crystal Considerations with Dallas Real-Time Clocks.” The DS1307 can also be driven by anexternal 32.768kHz oscillator. In this configuration, the X1 pin is connected to the external oscillatorsignal and the X2 pin is floated.

RECOMMENDED LAYOUT FOR CRYSTAL

Page 6: IX ANNEXOS

DS1307

4 of 12

CLOCK ACCURACYThe accuracy of the clock is dependent upon the accuracy of the crystal and the accuracy of the matchbetween the capacitive load of the oscillator circuit and the capacitive load for which the crystal wastrimmed. Additional error will be added by crystal frequency drift caused by temperature shifts. Externalcircuit noise coupled into the oscillator circuit may result in the clock running fast. See Application Note58, “Crystal Considerations with Dallas Real-Time Clocks” for detailed information.

Please review Application Note 95, “Interfacing the DS1307 with a 8051-Compatible Microcontroller”for additional information.

RTC AND RAM ADDRESS MAPThe address map for the RTC and RAM registers of the DS1307 is shown in Figure 2. The RTC registersare located in address locations 00h to 07h. The RAM registers are located in address locations 08h to3Fh. During a multi-byte access, when the address pointer reaches 3Fh, the end of RAM space, it wrapsaround to location 00h, the beginning of the clock space.

DS1307 ADDRESS MAP Figure 2

CLOCK AND CALENDARThe time and calendar information is obtained by reading the appropriate register bytes. The RTCregisters are illustrated in Figure 3. The time and calendar are set or initialized by writing the appropriateregister bytes. The contents of the time and calendar registers are in the BCD format. Bit 7 of register 0is the clock halt (CH) bit. When this bit is set to a 1, the oscillator is disabled. When cleared to a 0, theoscillator is enabled.

Please note that the initial power-on state of all registers is not defined. Therefore, it is importantto enable the oscillator (CH bit = 0) during initial configuration.

The DS1307 can be run in either 12-hour or 24-hour mode. Bit 6 of the hours register is defined as the12- or 24-hour mode select bit. When high, the 12-hour mode is selected. In the 12-hour mode, bit 5 isthe AM/PM bit with logic high being PM. In the 24-hour mode, bit 5 is the second 10 hour bit (20-23 hours).

On a 2-wire START, the current time is transferred to a second set of registers. The time information isread from these secondary registers, while the clock may continue to run. This eliminates the need to re-read the registers in case of an update of the main registers during a read.

SECONDS

MINUTES

HOURS

DAY

DATE

MONTH

YEAR

CONTROL

RAM56 x 8

00H

07H08H

3FH

Page 7: IX ANNEXOS

DS1307

5 of 12

DS1307 TIMEKEEPER REGISTERS Figure 3

CONTROL REGISTERThe DS1307 control register is used to control the operation of the SQW/OUT pin.

BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0OUT 0 0 SQWE 0 0 RS1 RS0

OUT (Output control): This bit controls the output level of the SQW/OUT pin when the square waveoutput is disabled. If SQWE = 0, the logic level on the SQW/OUT pin is 1 if OUT = 1 and is 0 ifOUT = 0.

SQWE (Square Wave Enable): This bit, when set to a logic 1, will enable the oscillator output. Thefrequency of the square wave output depends upon the value of the RS0 and RS1 bits. With the squarewave output set to 1Hz, the clock registers update on the falling edge of the square wave.

RS (Rate Select): These bits control the frequency of the square wave output when the square waveoutput has been enabled. Table 1 lists the square wave frequencies that can be selected with the RS bits.

SQUAREWAVE OUTPUT FREQUENCY Table 1RS1 RS0 SQW OUTPUT FREQUENCY

0 0 1Hz0 1 4.096kHz1 0 8.192kHz1 1 32.768kHz

0

0

0 0 0 0

000

00

00000

Page 8: IX ANNEXOS

DS1307

6 of 12

2-WIRE SERIAL DATA BUSThe DS1307 supports a bi-directional, 2-wire bus and data transmission protocol. A device that sendsdata onto the bus is defined as a transmitter and a device receiving data as a receiver. The device thatcontrols the message is called a master. The devices that are controlled by the master are referred to asslaves. The bus must be controlled by a master device that generates the serial clock (SCL), controls thebus access, and generates the START and STOP conditions. The DS1307 operates as a slave on the 2-wire bus. A typical bus configuration using this 2-wire protocol is show in Figure 4.

TYPICAL 2-WIRE BUS CONFIGURATION Figure 4

Figures 5, 6, and 7 detail how data is transferred on the 2-wire bus.

� Data transfer may be initiated only when the bus is not busy.� During data transfer, the data line must remain stable whenever the clock line is HIGH. Changes in

the data line while the clock line is high will be interpreted as control signals.

Accordingly, the following bus conditions have been defined:

Bus not busy: Both data and clock lines remain HIGH.

Start data transfer: A change in the state of the data line, from HIGH to LOW, while the clock is HIGH,defines a START condition.

Stop data transfer: A change in the state of the data line, from LOW to HIGH, while the clock line isHIGH, defines the STOP condition.

Data valid: The state of the data line represents valid data when, after a START condition, the data lineis stable for the duration of the HIGH period of the clock signal. The data on the line must be changedduring the LOW period of the clock signal. There is one clock pulse per bit of data.

Each data transfer is initiated with a START condition and terminated with a STOP condition. Thenumber of data bytes transferred between START and STOP conditions is not limited, and is determinedby the master device. The information is transferred byte-wise and each receiver acknowledges with aninth bit. Within the 2-wire bus specifications a regular mode (100kHz clock rate) and a fast mode(400kHz clock rate) are defined. The DS1307 operates in the regular mode (100kHz) only.

Page 9: IX ANNEXOS

DS1307

7 of 12

Acknowledge: Each receiving device, when addressed, is obliged to generate an acknowledge after thereception of each byte. The master device must generate an extra clock pulse which is associated withthis acknowledge bit.

A device that acknowledges must pull down the SDA line during the acknowledge clock pulse in such away that the SDA line is stable LOW during the HIGH period of the acknowledge related clock pulse. Ofcourse, setup and hold times must be taken into account. A master must signal an end of data to the slaveby not generating an acknowledge bit on the last byte that has been clocked out of the slave. In this case,the slave must leave the data line HIGH to enable the master to generate the STOP condition.

DATA TRANSFER ON 2-WIRE SERIAL BUS Figure 5

Depending upon the state of the R/ W bit, two types of data transfer are possible:

1. Data transfer from a master transmitter to a slave receiver. The first byte transmitted by themaster is the slave address. Next follows a number of data bytes. The slave returns an acknowledgebit after each received byte. Data is transferred with the most significant bit (MSB) first.

2. Data transfer from a slave transmitter to a master receiver. The first byte (the slave address) istransmitted by the master. The slave then returns an acknowledge bit. This is followed by the slavetransmitting a number of data bytes. The master returns an acknowledge bit after all received bytesother than the last byte. At the end of the last received byte, a “not acknowledge” is returned.

The master device generates all of the serial clock pulses and the START and STOP conditions. Atransfer is ended with a STOP condition or with a repeated START condition. Since a repeated STARTcondition is also the beginning of the next serial transfer, the bus will not be released. Data is transferredwith the most significant bit (MSB) first.

Page 10: IX ANNEXOS

DS1307

8 of 12

The DS1307 may operate in the following two modes:

1. Slave receiver mode (DS1307 write mode): Serial data and clock are received through SDA andSCL. After each byte is received an acknowledge bit is transmitted. START and STOP conditionsare recognized as the beginning and end of a serial transfer. Address recognition is performed byhardware after reception of the slave address and *direction bit (See Figure 6). The address byte isthe first byte received after the start condition is generated by the master. The address byte containsthe 7 bit DS1307 address, which is 1101000, followed by the *direction bit (R/ W ) which, for a write,is a 0. After receiving and decoding the address byte the device outputs an acknowledge on the SDAline. After the DS1307 acknowledges the slave address + write bit, the master transmits a registeraddress to the DS1307 This will set the register pointer on the DS1307. The master will then begintransmitting each byte of data with the DS1307 acknowledging each byte received. The master willgenerate a stop condition to terminate the data write.

DATA WRITE – SLAVE RECEIVER MODE Figure 6

2. Slave transmitter mode (DS1307 read mode): The first byte is received and handled as in the slavereceiver mode. However, in this mode, the *direction bit will indicate that the transfer direction isreversed. Serial data is transmitted on SDA by the DS1307 while the serial clock is input on SCL.START and STOP conditions are recognized as the beginning and end of a serial transfer (SeeFigure 7). The address byte is the first byte received after the start condition is generated by themaster. The address byte contains the 7-bit DS1307 address, which is 1101000, followed by the*direction bit (R/ W ) which, for a read, is a 1. After receiving and decoding the address byte thedevice inputs an acknowledge on the SDA line. The DS1307 then begins to transmit data startingwith the register address pointed to by the register pointer. If the register pointer is not written tobefore the initiation of a read mode the first address that is read is the last one stored in the registerpointer. The DS1307 must receive a “not acknowledge” to end a read.

DATA READ – SLAVE TRANSMITTER MODE Figure 7

Page 11: IX ANNEXOS

DS1307

9 of 12

ABSOLUTE MAXIMUM RATINGS*Voltage on Any Pin Relative to Ground -0.5V to +7.0VStorage Temperature -55°C to +125°CSoldering Temperature 260°C for 10 seconds DIP

See JPC/JEDEC Standard J-STD-020A forSurface Mount Devices

* This is a stress rating only and functional operation of the device at these or any other conditions abovethose indicated in the operation sections of this specification is not implied. Exposure to absolutemaximum rating conditions for extended periods of time may affect reliability.

Range Temperature VCCCommercial 0°C to +70°C 4.5V to 5.5V VCC1

Industrial -40°C to +85°C 4.5V to 5.5V VCC1

RECOMMENDED DC OPERATING CONDITIONS(Over the operating range*)

PARAMETER SYMBOL MIN TYP MAX UNITS NOTESSupply Voltage VCC 4.5 5.0 5.5 VLogic 1 VIH 2.2 VCC + 0.3 VLogic 0 VIL -0.5 +0.8 VVBAT Battery Voltage VBAT 2.0 3.5 V

*Unless otherwise specified.

DC ELECTRICAL CHARACTERISTICS(Over the operating range*)

PARAMETER SYMBOL MIN TYP MAX UNITS NOTESInput Leakage (SCL) ILI 1 �AI/O Leakage (SDA &SQW/OUT)

ILO 1 �A

Logic 0 Output (IOL = 5mA) VOL 0.4 VActive Supply Current ICCA 1.5 mA 7Standby Current ICCS 200 �A 1Battery Current (OSC ON);SQW/OUT OFF

IBAT1 300 500 nA 2

Battery Current (OSC ON);SQW/OUT ON (32kHz)

IBAT2 480 800 nA

Power-Fail Voltage VPF 1.216 x VBAT 1.25 x VBAT 1.284 x VBAT V 8*Unless otherwise specified.

Page 12: IX ANNEXOS

DS1307

10 of 12

AC ELECTRICAL CHARACTERISTICS(Over the operating range*)

PARAMETER SYMBOL MIN TYP MAX UNITS NOTESSCL Clock Frequency fSCL 0 100 kHzBus Free Time Between a STOP andSTART Condition

tBUF 4.7 �s

Hold Time (Repeated) START Condition tHD:STA 4.0 �s 3LOW Period of SCL Clock tLOW 4.7 �sHIGH Period of SCL Clock tHIGH 4.0 �sSet-up Time for a Repeated STARTCondition

tSU:STA 4.7 �s

Data Hold Time tHD:DAT 0 �s 4,5Data Set-up Time tSU:DAT 250 nsRise Time of Both SDA and SCL Signals tR 1000 nsFall Time of Both SDA and SCL Signals tF 300 nsSet-up Time for STOP Condition tSU:STO 4.7 �sCapacitive Load for each Bus Line CB 400 pF 6

I/O Capacitance (TA = 25ºC)CI/O 10 pF

Crystal Specified Load Capacitance(TA = 25ºC)

12.5 pF

*Unless otherwise specified.

NOTES:1. ICCS specified with VCC = 5.0V and SDA, SCL = 5.0V.2. VCC = 0V, VBAT = 3V.3. After this period, the first clock pulse is generated.4. A device must internally provide a hold time of at least 300ns for the SDA signal (referred to the

VIHMIN of the SCL signal) in order to bridge the undefined region of the falling edge of SCL.5. The maximum tHD:DAT has only to be met if the device does not stretch the LOW period (tLOW) of the

SCL signal.6. CB – Total capacitance of one bus line in pF.7. ICCA – SCL clocking at max frequency = 100kHz.8. VPF measured at VBAT = 3.0V.

Page 13: IX ANNEXOS

DS1307

11 of 12

TIMING DIAGRAM Figure 8

DS1307 64 X 8 SERIAL REAL-TIME CLOCK8-PIN DIP MECHANICAL DIMENSIONS

PKG 8-PINDIM MIN MAX

A IN.MM

0.3609.14

0.40010.16

B IN.MM

0.2406.10

0.2606.60

C IN.MM

0.1203.05

0.1403.56

D IN.MM

0.3007.62

0.3258.26

E IN.MM

0.0150.38

0.0401.02

F IN.MM

0.1203.04

0.1403.56

G IN.MM

0.0902.29

0.1102.79

H IN.MM

0.3208.13

0.3709.40

J IN.MM

0.0080.20

0.0120.30

K IN.MM

0.0150.38

0.0210.53

Page 14: IX ANNEXOS

DS1307

12 of 12

DS1307Z 64 X 8 SERIAL REAL-TIME CLOCK8-PIN SOIC (150-MIL) MECHANICAL DIMENSIONS

PKG 8-PIN(150 MIL)

DIM MIN MAXA IN.MM

0.1884.78

0.1964.98

B IN.MM

0.1503.81

0.1584.01

C IN.MM

0.0481.22

0.0621.57

E IN.MM

0.0040.10

0.0100.25

F IN.MM

0.0531.35

0.0691.75

G IN.MM

0.050 BSC1.27 BSC

H IN.MM

0.2305.84

0.2446.20

J IN.MM

0.0070.18

0.0110.28

K IN.MM

0.0120.30

0.0200.51

L IN.MM

0.0160.41

0.0501.27

phi 0� 8�56-G2008-001

Page 15: IX ANNEXOS

2011-6-3 1

Specification

1 Electrical parameters

Product Type HC--SR501 Body Sensor Module

Operating voltage range DC 4.5-20V

Quiescent Current <50uA

Level output High 3.3 V /Low 0V

Trigger L can not be repeated trigger/H can be repeated

trigger(Default repeated trigger)

Delay time 5-200S(adjustable) the range is (0.xx second to tens of

second)

Block time 2.5S(default)Can be made a range(0.xx to tens of seconds

Board Dimensions 32mm*24mm

Angle Sensor <100 ° cone angle

Operation Temp. -15-+70 degrees

Lens size sensor Diameter:23mm(Default)

2 Features:

1, the automatic sensor: to enter the sensor output range is high, people

leave the sensor range of the automatic delay off high, output low.

2, the photosensitive control (optional, factory is not set) may set the

photosensitive control during the day or light intensity without

induction.

Page 16: IX ANNEXOS

2011-6-3 2

3, the temperature compensation (optional, factory is not set): In the

summer when the ambient temperature rises to 30 ~ 32 ℃, slightly shorter

detection range, temperature compensation can be used as a performance

compensation.

4, two trigger mode: (can be selected by jumpers)

a. can not repeat the trigger: the sensor output high, the delay time is

over, the output will automatically become low from high;

b. repeatable trigger: the sensor output high after the delay period, if

the human body in its sensing range

Activities, its output will remain high until after the delay will be left

high to low (sensor module review

Measured activities of each body will be automatically extended after a

delay time, and the final event of the delay time

Starting point of time).

5, with induction blocking time (the default setting: 2.5S block time):

sensor module, after each sensor output (high change

Into a low level), you can set up a blockade followed by time period, in

this time period the sensor does not accept any sensor signal.

This feature can have a "sensor output time" and "blocking time" the

interval between the work produced can be applied to detect the interval

Products; also inhibit this function during load switching for a variety

of interference. (This time can be set at zero seconds

- Tens of seconds).

6, the working voltage range: the default voltage DC4.5V-20V.

7, micro-power consumption: static current "50 microamps, especially for

battery-powered automatic control products.

8, the output high level signals: types of circuits can be easily and

docking.

Page 17: IX ANNEXOS

2011-6-3 3

3 Instructions:

1. Sensing module for about a minute after power initialization time,

during the interval to the output module

0-3 times a minute in standby mode.

2. Should avoid direct lighting such as interference sources close the

surface of the lens module so as to avoid the introduction of interference

signal generator malfunction; use of the environment to avoid the flow

of the wind, the wind sensor will also cause interference.

3. Sensor module using a dual probe, the probe's window is rectangular,

dual (A per B million) in the direction of the ends of long, when the body

passed from left to right or right to left when the reach the dual IR time,

distance difference, the greater the difference, more sensitive sensors,

when the body from the front to the probe or from top to bottom or from

bottom to top direction passing, dual IR not detected changes in the

distance, no difference value, the sensor insensitive or does not work;

so the sensors should be installed dual direction of the probe with human

activities as much as possible parallel to the direction of maximum to

ensure that the body has been passed by the dual sensor probe. To increase

the sensing range of angles, the module using a circular lens, the probe

also makes sense on all four sides, but still higher than the upper and

lower left and right direction of sensing range, sensitivity and strong,

still as far as possible by the above installation requirements.VCC, trig

(control side), echo (receiving end), GND

Page 18: IX ANNEXOS

2011-6-3 4

Induction Range:

Dimensions and Adjustment:

NoteNoteNoteNote: The potentiometer clockwise to adjust the distance, sensing

range increases (about 7 meters), on the contrary, sensing range decreases

(about 3 meters).

Delay adjustment potentiometer clockwise rotation, sensor delay longer

(about 300S), the other hand, induction by the short delay (about 5S).

Page 19: IX ANNEXOS

2011-6-3 5

Applications:

1, Security Products

2, the human body sensors toys

3, the human body sensor lighting

4, industrial automation and control, etc.

It can automatically and quickly open various types of incandescent,

fluorescent lamps, buzzer, automatic doors, electric fans, automatic

washing machine and dryer

Machines and other devices, is a high-tech products. Especially suitable

for enterprises, hotels, shopping malls, warehouses and family aisles,

corridors and other sensitive.

Page 20: IX ANNEXOS

• Low coil power• Au clad contacts• PCB mount

2 CO (DPDT)

2/3

125/250

125

25

2/0.3/—

10 (0.1/1)

AgNi + Au

5 - 6 - 9 - 12 - 24 - 48

—/0.2

See table page 3

—/0.35 UN

—/0.05 UN

—/10 · 106

100 · 103

6/2

1.5

750

–40…+85

RT III

1

Contact specification

Contact configuration

Rated current/Maximum peak current A

Rated voltage/Maximum switching voltage V AC

Rated load AC1 VA

Rated load AC15 (230 V AC) VA

Single phase motor rating (230 V AC) kW

Breaking capacity DC1: 30/110/220 V A

Minimum switching load mW (V/mA)

Standard contact material

Coil specification

Nominal voltage (UN) V AC (50/60 Hz)

V DC

Rated power AC/DC VA (50 Hz)/W

Operating range AC

DC

Holding voltage AC/DC

Must drop-out voltage AC/DC

Technical data

Mechanical life AC/DC cycles

Electrical life at rated load AC1 cycles

Operate/release time ms

Insulation between coil and contacts (1.2/50 µs) kV

Dielectric strength between open contacts V AC

Ambient temperature range °C

Environmental protection

Approvals (according to type)

Copper side view

FeaturesPrinted circuit mount2 A signal relay

• 2 Pole changeover contactsLow level switching capability

• Subminiature - industry standard DIL package• Sensitive DC coil - 200 mW • Wash tight: RT III• Cadmium Free contact material

30 Series - Subminiature DIL relays 2 A

30.22

X-20

13, w

ww

.find

erne

t.com

30SERIES

Plug

-in /

PCB

Rel

ays

Page 21: IX ANNEXOS

30SERIES

Technical dataInsulation according to EN 61810-1

Nominal voltage of supply system V AC 230/400 120...240 single phase

Rated insulation voltage V AC 250 125

Pollution degree 1 2

Insulation between coil and contact set

Type of insulation Basic Basic

Overvoltage category I II

Rated impulse voltage kV (1.2/50 µs) 1.5 1.5

Dielectric strength V AC 1,000 1,000

Insulation between adjacent contacts

Type of insulation Basic Basic

Overvoltage category I II

Rated impulse voltage kV (1.2/50 µs) 1.5 1.5

Dielectric strength V AC 1,500 1,500

Insulation between open contacts

Type of disconnection Micro-disconnection Micro-disconnection

Dielectric strength V AC/kV (1.2/50 µs) 750/1 750/1

Other data

Bounce time: NO/NC ms 1/3

Vibration resistance (5…55)Hz: NO/NC g 15/15

Shock resistance g 16

Power lost to the environment without contact current W 0.2

with rated current W 0.4

Recommended distance between relays mounted on PCB mm ≥ 5

Example: 30 series PCB relay, 2 CO (DPDT) - 2 A contacts, 12 V sensitive DC coil.

A: Contact material0 = Standard

AgNi + Au B: Contact circuit0 = CO (DPDT)

Series

Type2 = PCB mount

No. of poles2 = 2 pole, 2 A

Coil version7 = Sensitive DC

Coil voltageSee coil specifications

2 2 07

D: Special versions0 = Wash tight (RT III)

C: Options1 = None

Ordering information

A B C D

. . . .0 1 23 0

30 Series - Subminiature DIL relays 2 A

2

0 1 0

X-20

13, w

ww

.find

erne

t.com

Plug

-in /

PCB

Rel

ays

Page 22: IX ANNEXOS

Nominal Coil Operating range Resistance Rated coilvoltage code consumption

UN Umin Umax R I at UNV V V Ω mA5 7.005 3.7 7.5 125 406 7.006 4.5 9 180 339 7.009 6.7 13.5 405 2212 7.012 8.4 18 720 1624 7.024 16.8 36 2,880 8.348 7.048 36 72 11,520 4.1

DC coil data - 0.2 W sensitive

Coil specifications

1 - Max. permitted coil voltage.2 - Min. pick-up voltage with coil at ambient temperature.

30 Series - Subminiature DIL relays 2 A

F 30 - Electrical life (AC1) v contact current (125 V)

Cyc

les

Contact specification

R 30 - DC coil operating range v ambient temperature

Note:The rated current of 2 A corresponds to the limiting continuous current.

3

X-20

13, w

ww

.find

erne

t.com

30SERIES

Plug

-in /

PCB

Rel

ays

Page 23: IX ANNEXOS
Page 24: IX ANNEXOS

IP+IP+

IP–IP–

IP

5GND

2

4

1

3ACS712

7

8+5 V

VIOUTVOUT

6FILTER

VCC

CBYP0.1 μF

CF1 nF

Application 1. The ACS712 outputs an analog signal, VOUT . that varies linearly with the uni- or bi-directional AC or DC primary sampled current, IP , within the range specified. CF is recommended for noise management, with values that depend on the application.

ACS712

DescriptionThe Allegro™ ACS712 provides economical and precise solutions for AC or DC current sensing in industrial, commercial, and communications systems. The device package allows for easy implementation by the customer. Typical applications include motor control, load detection and management, switch-mode power supplies, and overcurrent fault protection. The device is not intended for automotive applications.

The device consists of a precise, low-offset, linear Hall circuit with a copper conduction path located near the surface of the die. Applied current flowing through this copper conduction path generates a magnetic field which the Hall IC converts into a proportional voltage. Device accuracy is optimized through the close proximity of the magnetic signal to the Hall transducer. A precise, proportional voltage is provided by the low-offset, chopper-stabilized BiCMOS Hall IC, which is programmed for accuracy after packaging.

The output of the device has a positive slope (>VIOUT(Q)) when an increasing current flows through the primary copper conduction path (from pins 1 and 2, to pins 3 and 4), which is the path used for current sampling. The internal resistance of this conductive path is 1.2 mΩ typical, providing low power loss. The thickness of the copper conductor allows survival of

ACS712-DS, Rev. 15

Features and Benefits▪ Low-noise analog signal path▪ Device bandwidth is set via the new FILTER pin▪ 5 μs output rise time in response to step input current▪ 80 kHz bandwidth▪ Total output error 1.5% at TA = 25°C▪ Small footprint, low-profile SOIC8 package▪ 1.2 mΩ internal conductor resistance▪ 2.1 kVRMS minimum isolation voltage from pins 1-4 to pins 5-8▪ 5.0 V, single supply operation▪ 66 to 185 mV/A output sensitivity▪ Output voltage proportional to AC or DC currents▪ Factory-trimmed for accuracy▪ Extremely stable output offset voltage▪ Nearly zero magnetic hysteresis▪ Ratiometric output from supply voltage

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current Conductor

Continued on the next page…

Approximate Scale 1:1

Package: 8 Lead SOIC (suffix LC)

Typical Application

TÜV AmericaCertificate Number:U8V 06 05 54214 010

Page 25: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

2Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Absolute Maximum RatingsCharacteristic Symbol Notes Rating Units

Supply Voltage VCC 8 V

Reverse Supply Voltage VRCC –0.1 V

Output Voltage VIOUT 8 V

Reverse Output Voltage VRIOUT –0.1 V

Output Current Source IIOUT(Source) 3 mA

Output Current Sink IIOUT(Sink) 10 mA

Overcurrent Transient Tolerance IP 1 pulse, 100 ms 100 A

Nominal Operating Ambient Temperature TA Range E –40 to 85 ºC

Maximum Junction Temperature TJ(max) 165 ºC

Storage Temperature Tstg –65 to 170 ºC

Selection Guide

Part Number Packing* TA (°C)

Optimized Range, IP(A)

Sensitivity, Sens (Typ) (mV/A)

ACS712ELCTR-05B-T Tape and reel, 3000 pieces/reel –40 to 85 ±5 185

ACS712ELCTR-20A-T Tape and reel, 3000 pieces/reel –40 to 85 ±20 100

ACS712ELCTR-30A-T Tape and reel, 3000 pieces/reel –40 to 85 ±30 66

*Contact Allegro for additional packing options.

the device at up to 5× overcurrent conditions. The terminals of the conductive path are electrically isolated from the signal leads (pins 5 through 8). This allows the ACS712 to be used in applications requiring electrical isolation without the use of opto-isolators or other costly isolation techniques.

The ACS712 is provided in a small, surface mount SOIC8 package. The leadframe is plated with 100% matte tin, which is compatible with standard lead (Pb) free printed circuit board assembly processes. Internally, the device is Pb-free, except for flip-chip high-temperature Pb-based solder balls, currently exempt from RoHS. The device is fully calibrated prior to shipment from the factory.

Description (continued)

Parameter Specification

Fire and Electric ShockCAN/CSA-C22.2 No. 60950-1-03

UL 60950-1:2003EN 60950-1:2001

Isolation CharacteristicsCharacteristic Symbol Notes Rating Unit

Dielectric Strength Test Voltage* VISO Agency type-tested for 60 seconds per UL standard 60950-1, 1st Edition 2100 VAC

Working Voltage for Basic Isolation VWFSIFor basic (single) isolation per UL standard 60950-1, 1st Edition 354 VDC or Vpk

Working Voltage for Reinforced Isolation VWFRIFor reinforced (double) isolation per UL standard 60950-1, 1st Edition 184 VDC or Vpk

* Allegro does not conduct 60-second testing. It is done only during the UL certification process.

Page 26: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

3Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

VCC(Pin 8)

(Pin 7)VIOUT

RF(INT)

GND(Pin 5)

FILTER(Pin 6)

Dyn

amic

Offs

et

Can

cella

tion

IP+(Pin 1)

IP+(Pin 2)

IP−(Pin 3)

IP−(Pin 4)

SenseTrim

SignalRecovery

Sense TemperatureCoefficient Trim

0 AmpereOffset Adjust

Hall CurrentDrive

+5 V

IP+

IP+

IP–

IP–

VCC

VIOUT

FILTER

GND

1

2

3

4

8

7

6

5

Terminal List TableNumber Name Description

1 and 2 IP+ Terminals for current being sampled; fused internally

3 and 4 IP– Terminals for current being sampled; fused internally

5 GND Signal ground terminal

6 FILTER Terminal for external capacitor that sets bandwidth

7 VIOUT Analog output signal

8 VCC Device power supply terminal

Functional Block Diagram

Pin-out Diagram

Page 27: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

4Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

COMMON OPERATING CHARACTERISTICS1 over full range of TA , CF = 1 nF, and VCC = 5 V, unless otherwise specifiedCharacteristic Symbol Test Conditions Min. Typ. Max. Units

ELECTRICAL CHARACTERISTICSSupply Voltage VCC 4.5 5.0 5.5 VSupply Current ICC VCC = 5.0 V, output open – 10 13 mAOutput Capacitance Load CLOAD VIOUT to GND – – 10 nFOutput Resistive Load RLOAD VIOUT to GND 4.7 – – kΩPrimary Conductor Resistance RPRIMARY TA = 25°C – 1.2 – mΩRise Time tr IP = IP(max), TA = 25°C, COUT = open – 3.5 – μsFrequency Bandwidth f –3 dB, TA = 25°C; IP is 10 A peak-to-peak – 80 – kHzNonlinearity ELIN Over full range of IP – 1.5 – %Symmetry ESYM Over full range of IP 98 100 102 %

Zero Current Output Voltage VIOUT(Q) Bidirectional; IP = 0 A, TA = 25°C – VCC × 0.5 – V

Power-On Time tPOOutput reaches 90% of steady-state level, TJ = 25°C, 20 A present on leadframe – 35 – μs

Magnetic Coupling2 – 12 – G/AInternal Filter Resistance3 RF(INT) 1.7 kΩ1Device may be operated at higher primary current levels, IP, and ambient, TA , and internal leadframe temperatures, TA , provided that the Maximum Junction Temperature, TJ(max), is not exceeded.21G = 0.1 mT. 3RF(INT) forms an RC circuit via the FILTER pin.

COMMON THERMAL CHARACTERISTICS1

Min. Typ. Max. UnitsOperating Internal Leadframe Temperature TA E range –40 – 85 °C

Value UnitsJunction-to-Lead Thermal Resistance2 RθJL Mounted on the Allegro ASEK 712 evaluation board 5 °C/W

Junction-to-Ambient Thermal Resistance RθJAMounted on the Allegro 85-0322 evaluation board, includes the power con-sumed by the board 23 °C/W

1Additional thermal information is available on the Allegro website.2The Allegro evaluation board has 1500 mm2 of 2 oz. copper on each side, connected to pins 1 and 2, and to pins 3 and 4, with thermal vias connect-ing the layers. Performance values include the power consumed by the PCB. Further details on the board are available from the Frequently Asked Questions document on our website. Further information about board design and thermal performance also can be found in the Applications Informa-tion section of this datasheet.

Page 28: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

5Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

x05B PERFORMANCE CHARACTERISTICS1 TA = –40°C to 85°C, CF = 1 nF, and VCC = 5 V, unless otherwise specifiedCharacteristic Symbol Test Conditions Min. Typ. Max. Units

Optimized Accuracy Range IP –5 – 5 ASensitivity Sens Over full range of IP, TA = 25°C 180 185 190 mV/A

Noise VNOISE(PP)Peak-to-peak, TA = 25°C, 185 mV/A programmed Sensitivity, CF = 47 nF, COUT = open, 2 kHz bandwidth – 21 – mV

Zero Current Output Slope ∆VOUT(Q)TA = –40°C to 25°C – –0.26 – mV/°CTA = 25°C to 150°C – –0.08 – mV/°C

Sensitivity Slope ∆SensTA = –40°C to 25°C – 0.054 – mV/A/°CTA = 25°C to 150°C – –0.008 – mV/A/°C

Total Output Error2 ETOT IP =±5 A, TA = 25°C – ±1.5 – %1Device may be operated at higher primary current levels, IP, and ambient temperatures, TA, provided that the Maximum Junction Temperature, TJ(max), is not exceeded.2Percentage of IP, with IP = 5 A. Output filtered.

x20A PERFORMANCE CHARACTERISTICS1 TA = –40°C to 85°C, CF = 1 nF, and VCC = 5 V, unless otherwise specifiedCharacteristic Symbol Test Conditions Min. Typ. Max. Units

Optimized Accuracy Range IP –20 – 20 ASensitivity Sens Over full range of IP, TA = 25°C 96 100 104 mV/A

Noise VNOISE(PP)Peak-to-peak, TA = 25°C, 100 mV/A programmed Sensitivity, CF = 47 nF, COUT = open, 2 kHz bandwidth – 11 – mV

Zero Current Output Slope ∆VOUT(Q)TA = –40°C to 25°C – –0.34 – mV/°CTA = 25°C to 150°C – –0.07 – mV/°C

Sensitivity Slope ∆SensTA = –40°C to 25°C – 0.017 – mV/A/°CTA = 25°C to 150°C – –0.004 – mV/A/°C

Total Output Error2 ETOT IP =±20 A, TA = 25°C – ±1.5 – %1Device may be operated at higher primary current levels, IP, and ambient temperatures, TA, provided that the Maximum Junction Temperature, TJ(max), is not exceeded.2Percentage of IP, with IP = 20 A. Output filtered.

x30A PERFORMANCE CHARACTERISTICS1 TA = –40°C to 85°C, CF = 1 nF, and VCC = 5 V, unless otherwise specifiedCharacteristic Symbol Test Conditions Min. Typ. Max. Units

Optimized Accuracy Range IP –30 – 30 ASensitivity Sens Over full range of IP , TA = 25°C 63 66 69 mV/A

Noise VNOISE(PP)Peak-to-peak, TA = 25°C, 66 mV/A programmed Sensitivity, CF = 47 nF, COUT = open, 2 kHz bandwidth – 7 – mV

Zero Current Output Slope ∆VOUT(Q)TA = –40°C to 25°C – –0.35 – mV/°CTA = 25°C to 150°C – –0.08 – mV/°C

Sensitivity Slope ∆SensTA = –40°C to 25°C – 0.007 – mV/A/°CTA = 25°C to 150°C – –0.002 – mV/A/°C

Total Output Error2 ETOT IP = ±30 A , TA = 25°C – ±1.5 – %1Device may be operated at higher primary current levels, IP, and ambient temperatures, TA, provided that the Maximum Junction Temperature, TJ(max), is not exceeded.2Percentage of IP, with IP = 30 A. Output filtered.

Page 29: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

6Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

–402585

150

TA (°C)

–402585

150

TA (°C)

IP = 0 A IP = 0 A

VCC = 5 V

VCC = 5 V

VCC = 5 V; IP = 0 A,After excursion to 20 A

Mean Supply Current versus Ambient Temperature

Sensitivity versus Sensed Current200.00190.00180.00170.00160.00150.00140.00130.00120.00110.00100.00

Sens

(mV/

A)

186.5186.0185.5185.0184.5184.0183.5183.0182.5182.0181.5181.0

Sens

(mV/

A)

Ip (A)-6 -4 -2 0 2 4 6

TA (°C)

TA (°C) TA (°C)

Mea

n I C

C (m

A)

10.3010.2510.2010.1510.1010.0510.00

9.959.909.859.809.75

-50 -25 0 25 50 75 125100 150

I OM

(mA)

0–0.5–1.0–1.5–2.0–2.5–3.0–3.5–4.0–4.5–5.0

-50 -25 0 25 50 75 125100 150

Supply Current versus Supply Voltage10.9

10.8

10.7

10.6

10.5

10.4

10.3

10.2

10.1

10.04.5 4.6 4.84.7 4.9 5.0 5.35.1 5.2 5.4 5.5

VCC (V)

I CC (m

A)

TA (°C)

V IO

UT(Q

) (m

V)

2520

2515

2510

2505

2500

2495

2490

2485-50 -25 0 25 50 75 125100 150

TA (°C)

I OUT

(Q) (

A)

0.20

0.15

0.10

0.05

0

–0.05

–0.10

–0.15-50 -25 0 25 50 75 125100 150

Nonlinearity versus Ambient Temperature0.6

0.5

0.4

0.3

0.2

0.1

0–50 0–25 25 50 12575 100 150

E LIN

(%)

TA (°C)

Mean Total Output Error versus Ambient Temperature8

6

4

2

0

–2

–4

–6

–8–50 0–25 25 50 12575 100 150

E TO

T (%

)

TA (°C)

Sensitivity versus Ambient Temperature

–50 0–25 25 50 12575 100 150

IP (A)

Output Voltage versus Sensed Current4.0

3.5

3.0

2.5

2.0

1.5

1.0

0.5

0–7 –6 –5 –4 –3 –2 –1 0 1 2 3 4 5 6 7

V IO

UT

(V)

Magnetic Offset versus Ambient Temperature

VCC = 5 V

0 A Output Voltage versus Ambient Temperature 0 A Output Voltage Current versus Ambient Temperature

Characteristic PerformanceIP = 5 A, unless otherwise specified

Page 30: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

7Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

–402585

150

TA (°C)

–40

25–20

85125

TA (°C)

IP = 0 A IP = 0 A

VCC = 5 V

VCC = 5 V

VCC = 5 V; IP = 0 A,After excursion to 20 A

Mean Supply Current versus Ambient Temperature

Sensitivity versus Sensed Current110.00108.00106.00104.00102.00100.0098.0096.0094.0092.0090.00

Sens

(mV/

A)

Ip (A)

TA (°C)

TA (°C)

Mea

n I C

C (m

A)

9.7

9.6

9.5

9.4

9.3

9.2

9.1-50 -25 0 25 50 75 125100 150

Supply Current versus Supply Voltage10.4

10.2

10.0

9.8

9.6

9.4

9.2

9.0

VCC (V)

I CC (m

A)

Nonlinearity versus Ambient Temperature0.35

0.30

0.25

0.20

0.15

0.10

0.05

0–50 0–25 25 50 12575 100 150

E LIN

(%)

TA (°C)

Mean Total Output Error versus Ambient Temperature8

6

4

2

0

–2

–4

–6

–8–50 0–25 25 50 12575 100 150

E TO

T (%

)

IP (A)

Output Voltage versus Sensed Current5.04.54.03.53.02.52.01.51.00.5

0–25 –20 –15 –10 –5 0 5 10 15 20 25

V IO

UT

(V)

4.5 4.6 4.84.7 4.9 5.0 5.35.1 5.2 5.4 5.5

–25 –20 –15 –10 –5 0 5 10 15 20 25

100.8

100.6

100.4

100.2

100.0

99.8

99.6

99.4

99.2

99.0

Sens

(mV/

A)

TA (°C)

Sensitivity versus Ambient Temperature

–50 0–25 25 50 12575 100 150

TA (°C)

I OM

(mA)

0–0.5–1.0–1.5–2.0–2.5–3.0–3.5–4.0–4.5–5.0

-50 -25 0 25 50 75 125100 150

Magnetic Offset versus Ambient Temperature

0 A Output Voltage versus Ambient Temperature

TA (°C)

V IO

UT(Q

) (m

V)

2525

2520

2515

2510

2505

2500

2495

2490

2485-50 -25 0 25 50 75 125100 150

0 A Output Voltage Current versus Ambient Temperature

TA (°C)

I OUT

(Q) (

A)

0.25

0.20

0.15

0.10

0.05

0

–0.05

–0.10

–0.15-50 -25 0 25 50 75 125100 150

Characteristic PerformanceIP = 20 A, unless otherwise specified

Page 31: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

8Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Characteristic PerformanceIP = 30 A, unless otherwise specified

–402585

150

TA (°C)–40

25–20

85125

TA (°C)

IP = 0 A IP = 0 A

VCC = 5 V

VCC = 5 V

VCC = 5 V; IP = 0 A,After excursion to 20 A

VCC = 5 V

Mean Supply Current versus Ambient Temperature

Sensitivity versus Sensed Current70.0069.0068.0067.0066.0065.0064.0063.0062.0061.0060.00

Sens

(mV/

A)

Ip (A)

TA (°C)

TA (°C)

Mea

n I C

C (m

A)

9.6

9.5

9.4

9.3

9.2

9.1

9.0

8.9-50 -25 0 25 50 75 125100 150

Supply Current versus Supply Voltage10.2

10.0

9.8

9.6

9.4

9.2

9.0

VCC (V)

I CC (m

A)

Nonlinearity versus Ambient Temperature0.45

0.40

0.35

0.30

0.25

0.20

0.15

0.10

0.05

0–50 0–25 25 50 12575 100 150

E LIN

(%)

TA (°C)

Mean Total Output Error versus Ambient Temperature8

6

4

2

0

–2

–4

–6

–8–50 0–25 25 50 12575 100 150

E TO

T (%

)

IP (A)

Output Voltage versus Sensed Current5.04.54.03.53.02.52.01.51.00.5

0–30 –20 –10 0 10 20 30

V IO

UT

(V)

4.5 4.6 4.84.7 4.9 5.0 5.35.1 5.2 5.4 5.5

–30 –20 –10 0 10 20 30

66.6

66.5

66.4

66.3

66.2

66.1

66.0

65.9

65.8

65.7

Sens

(mV/

A)

TA (°C)

Sensitivity versus Ambient Temperature

–50 0–25 25 50 12575 100 150

TA (°C)

I OM

(mA)

0–0.5–1.0–1.5–2.0–2.5–3.0–3.5–4.0–4.5–5.0

-50 -25 0 25 50 75 125100 150

Magnetic Offset versus Ambient Temperature

TA (°C)

V IO

UT(Q

) (m

V)

25352530252525202515251025052500249524902485

-50 -25 0 25 50 75 125100 150TA (°C)

I OUT

(Q) (

A)

0.350.300.250.200.150.100.05

0–0.05–0.10–0.15

-50 -25 0 25 50 75 125100 150

0 A Output Voltage versus Ambient Temperature 0 A Output Voltage Current versus Ambient Temperature

Page 32: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

9Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Sensitivity (Sens). The change in device output in response to a 1 A change through the primary conductor. The sensitivity is the product of the magnetic circuit sensitivity (G / A) and the linear IC amplifier gain (mV/G). The linear IC amplifier gain is pro-grammed at the factory to optimize the sensitivity (mV/A) for the full-scale current of the device.

Noise (VNOISE). The product of the linear IC amplifier gain (mV/G) and the noise floor for the Allegro Hall effect linear IC (≈1 G). The noise floor is derived from the thermal and shot noise observed in Hall elements. Dividing the noise (mV) by the sensitivity (mV/A) provides the smallest current that the device is able to resolve.

Linearity (ELIN). The degree to which the voltage output from the IC varies in direct proportion to the primary current through its full-scale amplitude. Nonlinearity in the output can be attrib-uted to the saturation of the flux concentrator approaching the full-scale current. The following equation is used to derive the linearity:

where VIOUT_full-scale amperes = the output voltage (V) when the sampled current approximates full-scale ±IP .

Symmetry (ESYM). The degree to which the absolute voltage output from the IC varies in proportion to either a positive or negative full-scale primary current. The following formula is used to derive symmetry:

Quiescent output voltage (VIOUT(Q)). The output of the device when the primary current is zero. For a unipolar supply voltage, it nominally remains at VCC ⁄ 2. Thus, VCC = 5 V translates into VIOUT(Q) = 2.5 V. Variation in VIOUT(Q) can be attributed to the resolution of the Allegro linear IC quiescent voltage trim and thermal drift.

Electrical offset voltage (VOE). The deviation of the device out-put from its ideal quiescent value of VCC / 2 due to nonmagnetic causes. To convert this voltage to amperes, divide by the device sensitivity, Sens.

Accuracy (ETOT). The accuracy represents the maximum devia-tion of the actual output from its ideal value. This is also known as the total output error. The accuracy is illustrated graphically in the output voltage versus current chart at right.

Accuracy is divided into four areas:

0 A at 25°C. Accuracy at the zero current flow at 25°C, with-out the effects of temperature.

0 A over Δ temperature. Accuracy at the zero current flow including temperature effects.

Full-scale current at 25°C. Accuracy at the the full-scale current at 25°C, without the effects of temperature.

Full-scale current over Δ temperature. Accuracy at the full-scale current flow including temperature effects.

Ratiometry. The ratiometric feature means that its 0 A output, VIOUT(Q), (nominally equal to VCC/2) and sensitivity, Sens, are proportional to its supply voltage, VCC . The following formula is used to derive the ratiometric change in 0 A output voltage,VIOUT(Q)RAT (%).

The ratiometric change in sensitivity, SensRAT (%), is defined as:

Definitions of Accuracy Characteristics

100 1– [{ [ {VIOUT_full-scale amperes – VIOUT(Q)Δ gain × % sat ( )2 (VIOUT_half-scale amperes – VIOUT(Q) )

100VIOUT_+ full-scale amperes – VIOUT(Q)

VIOUT(Q) – VIOUT_–full-scale amperes

100VIOUT(Q)VCC / VIOUT(Q)5V

VCC / 5 V

100

SensVCC / Sens5V

VCC / 5 V‰ �Output Voltage versus Sampled Current

Accuracy at 0 A and at Full-Scale Current

Increasing VIOUT (V)

+IP (A)

Accuracy

Accuracy

Accuracy25°C Only

Accuracy25°C Only

Accuracy25°C Only

Accuracy

0 A

v rO e Temp erature

AverageVIOUT

–IP (A)

v rO e Temp erature

v rO e Temp erature

Decreasing VIOUT (V)

IP(min)

IP(max) Full Scale

Page 33: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

10Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Power on Time versus External Filter Capacitance

020406080

100120140160180200

0 10 20 30 40 50CF (nF)

CF (nF)

t PO

(μs)

IP = 5 A

IP = 0 A

Noise versus External Filter Capacitance

1

1000

10

100

10000

0.01 0.1 1 10 100 1000

Noi

se(p

-p) (

mA

)

Noise vs. Filter Cap

Rise Time versus External Filter Capacitance1200

1000

800

600

400

200

00.1 1 10 100 1000

t r(μs

)

CF (nF)

Rise Time versus External Filter Capacitance1801601401201008060402000.1 1 10 100

t r(μs

)

CF (nF)

Expanded in chart at right }Definitions of Dynamic Response Characteristics

Primary Current

Transducer Output

90

100

I (%)

Rise Time, trt

Rise time (tr). The time interval between a) when the device reaches 10% of its full scale value, and b) when it reaches 90% of its full scale value. The rise time to a step response is used to derive the bandwidth of the device, in which ƒ(–3 dB) = 0.35 / tr. Both tr and tRESPONSE are detrimentally affected by eddy current losses observed in the conductive IC ground plane.

Excitation Signal

Output (mV)

15 A

Step Response

TA=25°C

CF (nF) tr (μs)

Open 3.5 1 5.8 4.7 17.5 22 73.5 47 88.2

100 291.3 220 623 470 1120

Power-On Time (tPO). When the supply is ramped to its operat-ing voltage, the device requires a finite time to power its internal components before responding to an input magnetic field.Power-On Time, tPO , is defined as the time it takes for the output voltage to settle within ±10% of its steady state value under an applied magnetic field, after the power supply has reached its minimum specified operating voltage, VCC(min), as shown in the chart at right.

Page 34: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

11Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Chopper Stabilization is an innovative circuit technique that is used to minimize the offset voltage of a Hall element and an asso-ciated on-chip amplifier. Allegro patented a Chopper Stabiliza-tion technique that nearly eliminates Hall IC output drift induced by temperature or package stress effects. This offset reduction technique is based on a signal modulation-demodulation process. Modulation is used to separate the undesired DC offset signal from the magnetically induced signal in the frequency domain. Then, using a low-pass filter, the modulated DC offset is sup-pressed while the magnetically induced signal passes through

the filter. As a result of this chopper stabilization approach, the output voltage from the Hall IC is desensitized to the effects of temperature and mechanical stress. This technique produces devices that have an extremely stable Electrical Offset Voltage, are immune to thermal stress, and have precise recoverability after temperature cycling.

This technique is made possible through the use of a BiCMOS process that allows the use of low-offset and low-noise amplifiers in combination with high-density logic integration and sample and hold circuits.

Chopper Stabilization Technique

Amp

Regulator

Clock/Logic

Hall ElementS

ampl

e an

dH

old

Low-PassFilter

Concept of Chopper Stabilization Technique

Page 35: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

12Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

+

–IP+IP+

IP–IP–

IP

7

5

5

8

+5 V

U1LMV7235

VIOUTVOUT

GND

6

2

4

41

1

23

3

FILTER

VCC

ACS712

D11N914

R2100 kΩ

R133 kΩ

RPU100 kΩ

Fault

CBYP0.1 μF

CF1 nF

+

IP+IP+

IP–IP–

7

5

8

+5 V

U1LT1178

Q12N7002

VIOUTVOUT

VPEAK

VRESET

GND

6

2

4

1

3D11N914

VCC

ACS712

R410 kΩ

R11 MΩ

R233 kΩ

RF10 kΩ

R3330 kΩ

CBYP0.1 μF

C10.1 μF

COUT0.1 μF

CF1 nF

C20.1 μF

FILTER

IP

IP+IP+

IP–IP–

IP

7

5

8

+5 V

D11N4448W

VIOUTVOUT

GND

6

2

4

1

3 FILTER

VCC

ACS712 R110 kΩ

CBYP0.1 μF

RF2 kΩ

CF1 nF

C1

A-to-DConverter

Typical Applications

Application 5. 10 A Overcurrent Fault Latch. Fault threshold set by R1 and R2. This circuit latches an overcurrent fault and holds it until the 5 V rail is powered down.

Application 2. Peak Detecting Circuit

Application 4. Rectified Output. 3.3 V scaling and rectification application for A-to-D converters. Replaces current transformer solutions with simpler ACS circuit. C1 is a function of the load resistance and filtering desired. R1 can be omitted if the full range is desired.

+

–IP+IP+

IP–IP–

IP

7

5

58

+5 V

LM321

VIOUT

VOUT

GND

6

2

4

11 4

2

3

3

FILTER

VCC

ACS712

R2100 kΩ

R1100 kΩ

R33.3 kΩ

CBYP0.1 μF

CF0.01 μF

C11000 pF

RF1 kΩ

Application 3. This configuration increases gain to 610 mV/A (tested using the ACS712ELC-05A).

Page 36: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

13Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Improving Sensing System Accuracy Using the FILTER Pin

In low-frequency sensing applications, it is often advantageous to add a simple RC filter to the output of the device. Such a low-pass filter improves the signal-to-noise ratio, and therefore the resolution, of the device output signal. However, the addition of an RC filter to the output of a sensor IC can result in undesirable device output attenuation — even for DC signals.

Signal attenuation, ∆VATT , is a result of the resistive divider effect between the resistance of the external filter, RF (see Application 6), and the input impedance and resistance of the customer interface circuit, RINTFC. The transfer function of this resistive divider is given by:

Even if RF and RINTFC are designed to match, the two individual resistance values will most likely drift by different amounts over

temperature. Therefore, signal attenuation will vary as a function of temperature. Note that, in many cases, the input impedance, RINTFC , of a typical analog-to-digital converter (ADC) can be as low as 10 kΩ.

The ACS712 contains an internal resistor, a FILTER pin connec-tion to the printed circuit board, and an internal buffer amplifier. With this circuit architecture, users can implement a simple RC filter via the addition of a capacitor, CF (see Application 7) from the FILTER pin to ground. The buffer amplifier inside of the ACS712 (located after the internal resistor and FILTER pin connection) eliminates the attenuation caused by the resistive divider effect described in the equation for ∆VATT. Therefore, the ACS712 device is ideal for use in high-accuracy applications that cannot afford the signal attenuation associated with the use of an external RC low-pass filter.

=∆VATTRINTFC

RF + RINTFCVIOUT ⎟

⎞⎜⎜⎝

⎛ .

Application 6. When a low pass filter is constructed externally to a standard Hall effect device, a resistive divider may exist between the filter resistor, RF, and the resistance of the customer interface circuit, RINTFC. This resistive divider will cause excessive attenuation, as given by the transfer function for ∆VATT.

Application 7. Using the FILTER pin provided on the ACS712 eliminates the attenuation effects of the resistor divider between RF and RINTFC, shown in Appli-cation 6.

ApplicationInterface

Circuit

Resistive Divider

RINTFC

Low Pass Filter

RFAmp Out

VCC

+5 V

Pin 8

Pin 7VIOUT

Pin 6N.C.

Input

GNDPin 5

Filte

r

Dyn

amic

Offs

et

Can

cella

tion

IP+ IP+

0.1 F

Pin 1 Pin 2

IP– IP–Pin 3 Pin 4

Gain TemperatureCoefficient Offset

VoltageRegulator

Trim Control

To all subcircuits

Input

VCCPin 8

Pin 7VIOUT

GNDPin 5

FILTERPin 6

Dyn

amic

Offs

et

Can

cella

tion

IP+Pin 1

IP+Pin 2

IP–Pin 3

IP–Pin 4

SenseTrim

SignalRecovery

Sense TemperatureCoefficient Trim

0 AmpereOffset Adjust

Hall CurrentDrive

+5 V

ApplicationInterface

Circuit

Buffer Amplifier and Resistor

RINTFC

Allegro ACS712

Allegro ACS706

CF1 nF

CF1 nF

Page 37: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

14Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Package LC, 8-pin SOIC

CSEATINGPLANE

1.27 BSC

GAUGE PLANESEATING PLANE

A Terminal #1 mark area

B

Reference land pattern layout (reference IPC7351 SOIC127P600X175-8M); all pads a minimum of 0.20 mm from all adjacent pads; adjust as necessary to meet application process requirements and PCB layout tolerances

B

D

C

21

8

Branding scale and appearance at supplier discretion

CSEATINGPLANEC0.10

8X

0.25 BSC

1.04 REF

1.75 MAX

For Reference Only; not for tooling use (reference MS-012AA)Dimensions in millimetersDimensions exclusive of mold flash, gate burrs, and dambar protrusions Exact case and lead configuration at supplier discretion within limits shown

4.90 ±0.10

3.90 ±0.10 6.00 ±0.20

0.510.31 0.25

0.10

0.250.17

1.270.40

8°0°

N = Device part number T = Device temperature range P = Package Designator A = Amperage L = Lot number Belly Brand = Country of Origin

NNNNNNN

LLLLL

1

TPP-AAA

A

Standard Branding Reference View

21

8

PCB Layout Reference ViewC

0.65 1.27

5.60

1.75

Branded Face

Page 38: IX ANNEXOS

Fully Integrated, Hall Effect-Based Linear Current Sensor IC with 2.1 kVRMS Isolation and a Low-Resistance Current ConductorACS712

15Allegro MicroSystems, LLC115 Northeast CutoffWorcester, Massachusetts 01615-0036 U.S.A.1.508.853.5000; www.allegromicro.com

Copyright ©2006-2013, Allegro MicroSystems, LLC The products described herein are protected by U.S. patents: 5,621,319; 7,598,601; and 7,709,754. Allegro MicroSystems, LLC reserves the right to make, from time to time, such de par tures from the detail spec i fi ca tions as may be required to

permit improvements in the per for mance, reliability, or manufacturability of its products. Before placing an order, the user is cautioned to verify that the information being relied upon is current.

Allegro’s products are not to be used in life support devices or systems, if a failure of an Allegro product can reasonably be expected to cause the failure of that life support device or system, or to affect the safety or effectiveness of that device or system.

The in for ma tion in clud ed herein is believed to be ac cu rate and reliable. How ev er, Allegro MicroSystems, LLC assumes no re spon si bil i ty for its use; nor for any in fringe ment of patents or other rights of third parties which may result from its use.

For the latest version of this document, visit our website:www.allegromicro.com

Revision HistoryRevision Revision Date Description of Revision

Rev. 15 November 16, 2012 Update rise time and isolation, IOUT reference data, patents

Page 39: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

41

ANNEX B Codi complert (sketch)

#include < SPI.h>

#include < Ethernet.h>

#include < Wire .h>

#include "RTClib.h"

//Declaració de les direccions MAC e IP i del Port 80

byte mac[]={0x90,0xA2,0xdA,0x0F,0xa0,0x8C}; //MAC

IPAddress ip(192,168,1,125); //IP

EthernetServer servidor(80);

//Declaració de variables pel control de llums via web

int PIN_LED1=8; // LED blau

String estatLED1= "LOW";

String readString1;

int PIN_LED2=9; // LED verd

String estatLED2= "LOW";

String state1= "OFF" ; // estat del llum controlat

String state1anterior= "OFF" ;

String state2= "OFF" ; // estat del led

int ACSPin1=A1;

int ACSPin2=A3;

int interruptorManual=4; //pin que llegeix l'interruptor d'elecció de

mode automàtic o manual

int PinLedAutoManual = 6; //Pin que indica si està en mode automàtic o

manual

int AutoManual= 0;

//Declaració de variables per regular llum automàti cament

int LDRPin = 0; // Pin LDR entrada analògica

int min = 500; // Valor minimo obtenido por A0.

int max = 900; // Valor maximo obtenido por A0.

Page 40: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

42

int estat = 1;

long valorRele1 = 0;

long valor1;

String abans= "baixat" ;

//declaracio variables programació llums (RTC)

int hh;

int mm;

int hoff;

int moff;

//valors llegits de l'aplicació web

int hi;

int mi;

int hfi;

int mfi;

//variables per desar les hores de programació

int hhon=20;

int mmon=30;

int hhoff=23;

int mmoff=30;

RTC_DS1307 RTC; // Crea l’objecte RTC

//declaració de variables PIR

int ledPinPIR = 3; // led controlat per sensor PIR

int sensorPinPIR=2; // sensor PIR

int valPIR = 0; //lectura del sensor PIR

void setup ()

{

//per RTC

Wire . begin (); // Inicia el port I2C

RTC. begin (); // Inicia la comunicació amb RTC

Page 41: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

43

RTC. adjust ( DateTime(__DATE__, __TIME__)); // Estableix data i hora

//Inicialitzem comunicació ethernet

Ethernet. begin (mac, ip);

servidor. begin ();

//Inicialitzem pins

pinMode (PIN_LED1, OUTPUT);

//digitalWrite(PIN_LED1,LOW);

pinMode (PIN_LED2, OUTPUT);

//digitalWrite(PIN_LED2,LOW);

pinMode (5, OUTPUT);

digitalWrite (5, HIGH);

pinMode (7, OUTPUT);

digitalWrite (7, LOW);

pinMode (interruptorManual, INPUT);

pinMode (PinLedAutoManual, OUTPUT);

//digitalWrite (PinLedAutoManual, HIGH);

//perPIR

pinMode (ledPinPIR, OUTPUT);

pinMode (sensorPinPIR, INPUT);

}

void loop ()

{

EthernetClient cliente= servidor. available ();

AutoManual= digitalRead (interruptorManual);

if (AutoManual== HIGH){

digitalWrite (PinLedAutoManual, HIGH);}

else {

Page 42: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

44

digitalWrite (PinLedAutoManual, LOW);

valor1 = analogRead (LDRPin); // Leemos el valor de A0.

valor1 = constrain (valor1, min , max); //Normalitzem valor

valorRele1 = map(valor1, min , max, 0,100); //percentatge de potència

LED

delay (20);

if (valorRele1 <= 50 && estat !=1){ //si demana menys del 50% i està

la bombeta encesa, apàga-la

llumLDR(7,100,1);

}

if (valorRele1<=75 && valorRele1>50 && estat== 1){ //si demana més

del 50%, regula

llumLDR(7,1200,2);

abans= "pujat" ;

delay (20);

}

if (valorRele1<=75 && valorRele1>50 && estat== 3){ //si demana més

del 50%, regula

llumLDR(7,900,2);

abans= "baixat" ;

}

if (valorRele1>75 && estat== 1){ //si demana més del 50%, regula

llumLDR(7,100,3);

estat = 3;

}

if (valorRele1>75 && estat==2){ //si demana més del 50%, regula

if (abans== "baixat" ){

llumLDR(7,800,3);

Page 43: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

45

} else if (abans== "pujat" ){

llumLDR(7,1200,3);

}

abans= "pujat" ;

}

}

valPIR = digitalRead (sensorPinPIR); //llegim sensor

digitalWrite (ledPinPIR, valPIR); //segons sensor encenem llum o no

DateTime now = RTC. now(); // Obtenim data i hora de l'RTC

if (hhon!=0 && mmon!=0 && hhoff != 0 && mmoff != 0) {

if (hhon<=23 && mmon<=59 && hhoff<=23 && mmoff<=59)

{

hh = hhon;

mm = mmon;

hoff=hhoff;

moff=mmoff;

}

}

if ( now. hour () == hh && now. minute ()==mm)

{

digitalWrite (5, LOW);

delay (20);

}

if ( now. hour ()== hoff && now. minute ()== moff)

{

digitalWrite (5, HIGH);

delay (20);

}

Page 44: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

46

if (cliente)

{

boolean lineaenblanco= true ;

while (cliente. connected ()) //Client connectat

{

if (cliente. available ())

{

char c=cliente. read ();

readString1. concat (c); //Emmagatzema els caracters en la

variable readString

if (c== '\n' && lineaenblanco) //Si la petició HTTP ha finalitzat

{

int LED1 = readString1. indexOf ( "LED1=" );

int LED2 = readString1. indexOf ( "LED=" );

if (readString1. substring (LED1,LED1+6)== "LED1=T" )

{

if (estatLED1== "LOW"){

digitalWrite (PIN_LED1, HIGH);

estatLED1= "HIGH" ;

} else if (estatLED1== "HIGH" ){

digitalWrite (PIN_LED1, LOW);

estatLED1= "LOW";

}

}

if (readString1. substring (LED2,LED2+5)== "LED=T" )

{

if (estatLED2== "LOW"){

digitalWrite (PIN_LED2, HIGH);

estatLED2= "HIGH" ;

} else if (estatLED2== "HIGH" ){

digitalWrite (PIN_LED2, LOW);

Page 45: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

47

estatLED2= "LOW";

}

}

state1 = estat_del_llum (ACSPin1);

state2 = estat_del_llum (ACSPin2);

hi = readString1. indexOf ( "hi" );

mi = readString1. indexOf ( "mi" );

hfi = readString1. indexOf ( "hfi" );

mfi = readString1. indexOf ( "mfi" );

hhon = readString1. substring (hi+3,hi+5). toInt ();

mmon = readString1. substring (mi+3,mi+5). toInt ();

hhoff = readString1. substring (hfi+4,hfi+6). toInt ();

mmoff = readString1. substring (mfi+4,mfi+6). toInt ();

//Capçalera HTTP estandart

cliente. println ("HTTP/1.1 200 OK");

cliente. println ("Content-Type: text/html");

cliente. println ();

//Pàgina Web en HTML

cliente. println ( "<html>" );

cliente. println ("<head>");

cliente. println ("<title>PROJECTE ON/OFF</title>");

cliente. println ("</head>");

cliente. println ("<body width=100% height=100%>");

cliente. println ( "<center>" );

cliente. print ( "<br><br><br><br>" );

cliente. println ( "<input type=submit value=ON/OFF

style=width:100px;height:50px onClick=location.href ='./?LED1=T\'>" );

Page 46: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

48

cliente. print ( "<br><br>" );

cliente. print ( "Estat de la llum: " );

cliente. print (state1);

cliente. print ( "<br><br><br><br>" );

cliente. println ( "<input type=submit value=ON/OFF

style=width:100px;height:50px onClick=location.href ='./?LED=T\'>" );

cliente. print ( "<br><br>" );

cliente. print ( "Estat de la llum: " );

cliente. print (state2);

cliente. print ( "<br><br>" );

cliente. println ( "<input type=submit value=Actualitza

onClick=location.href='index'>" );

cliente. print ( "<br><br>" );

cliente. println ( "<form action'.' method=get>" );

cliente. println ( "<label>hora ON</label><input name= 'hi'

type='text' value='hh' size='2' maxlength='2'><labe l>minuts

ON</label><input name='mi' type='text' value='mm' s ize='2'

maxlength='2'>" );

cliente. println ( "<label>hora OFF</label><input name ='hfi'

type='text' value= 'hoff' size='2' maxlength='2'><l abel>minuts

ON</label><input name='mfi' type='text' value='moff ' size='2'

maxlength='2'>" );

cliente. println ( "<INPUT type='submit'

value='Enviar'onClick='location.reload();'>" );

cliente. print ( "<br>" );

cliente. println ( "</form>" );

cliente. print ( "<br>" );

cliente. print ( "Hora programada d'inici:" );

cliente. print (hh);

cliente. print ( ":" );

cliente. print (mm);

cliente. print ( " ; " );

cliente. print ( "Hora programada de fi:" );

cliente. print (hoff);

cliente. print ( ":" );

cliente. print (moff);

Page 47: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

49

cliente. println ( "</center>" );

cliente. println ( "</body>" );

cliente. println ( "</html>" );

cliente. stop (); //Tanco connexió amb el client

readString1= "" ;

}

}

}

}

}

void llumLDR ( int pin, int ms, int estad){

digitalWrite (pin, HIGH);

delay (ms);

digitalWrite (7, LOW);

estat = estad;

delay (20);

}

String estat_del_llum ( int pin){

float ACSValor_aux = 0;

float ACSValor = 0;

float correntValor = 0;

float Vdigital = 0.0048828125;

for ( int i=1000; i>0; i--)

{

ACSValor_aux = ( analogRead (pin) -511); // lectura del sensor de

corrent i ajustar la sortida a (1023/2) quan I=0

ACSValor += pow(ACSValor_aux,2); // sumar els quarats de les lectures

}

Page 48: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

50

ACSValor = ( sqrt (ACSValor/ 1000)) * Vdigital; // desfà el quadrat,

calcula la mitja i ajusta al valor dels volts

correntValor = (ACSValor/185)*1000; // calcular la intensitat segons

la sensibilitat (185 mV/A )

if (correntValor<0.2){

return "OFF" ;

}

if (correntValor>0.2){

return "ON" ;

}

}

Page 49: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

ANNEX C PROGRAMACIÓ TEMPORAL

51

PROGRAMACIÓ TEMPORAL

Figura C 1 Diagrama de Gantt

Page 50: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

52

Figura C 2. Diagrama de Gantt

Page 51: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

53

Taula C 1. Durada de les tasques

Taula C 2. Durada de les tasques

Page 52: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

54

ANNEX D GLOSSARI

ACS: Aigua calenta sanitària

API: Application Programming Interface

Conversor ADC: conversor analògic digital

DHCP: de l’anglès Dynamic Host Configutation Protocol, vol dir configuració

dinàmica de host. És un protocol de xarxa que permet als clients d’una IP

obtenir els seus paràmetres de configuració automàticament. Funciona amb el

protocol client/servidor on el servidor assigna IP als clients conforme es van

quedant lliures. Això permet tenir el coneixement de quin és el client que té una

determinada IP en tot moment.

FTDI: Future Devices International, és una empresa escocesa de dispositius

semiconductors especialitzada en tecnologia USB

GIPO: General Pupose Input/Output, Entrada/Sortida de Propòsit General. És

un pin genèric en un circuit integrat.

HTML: Hiper Text Markup Language, llenguatge de marques per a l’elaboració

de pàgines web.

HTTP: Hypertext Transfer Protocol, és el protocol que defineix la sintaxis i la

sistemàtica que utilitzen els elements de software de l’arquitectura web per

comunicar-se.

IP: Protocol d’Internet, es tracta d’un protocol de comunicació de dades digitals.

LAN: Xarxa d’àrea local

SBC: Single-Board Computer, placa computadora o ordinador monoplaca.

Page 53: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

55

SDK: Kit de desenvolupament de software, és un conjunt d’eines que permeten

al programador crear aplicacions per un sistema concret, per exemple certs

paquets de software, frameworks, plataformes de hardware, cpompuitadors,

sistemes operatius, etc.

Sistema d’aprofitament de la llum natural : és el conjunt de dispositius,

cablejat i components destinats a regular de forma automàtica el fluxe lluminós

d’una instal·lació d’il·luminació, en funció del fluxe lluminós aportat a la zona

per la llum natural, de tal manera que tots dos fluxes aportin un nivell

d’il·luminació fixat en un punt, on es trobaria el sensor de llum. Existeixen dos

tipus fonamentals de regulació:

a) regulació tot/res: la il·luminació s’encén o s’apaga per sota o per sobre d’un

nivell d’il·luminació prefixat.

b) regulació progressiva: la il·luminació es va ajustant progressivament segons

l’aportació de llum natural fins aconseguir el nivell d’il·luminació prefixat.

Sistema de control i regulació: conjunt de dispositius, cableja i components

destinats a controlar de manera automàtica o manial l’encès i apagat o el flux

lluminós d’una instal·lació d’il·luminació. Es distingeixen 4 tipus fonamentals:

a) regulació i control sota demanda de l’usuari, per interriptor manual, polsador,

ptenciòmetre o comandament a distància;

b) regulació d’il·luminació artificial segons aportació de llum natural per les

finestres, cristaleres o claraboies;

c) control d’encès i apagat segons presència de la zona;

d) regulació i control per sistema centralitzat de gestió.

Sistema de detecció de presència : conjunt de dispositius, cablejat i

components destinats a controlar de forma automàtica, l’encès i apagat d’una

instal·lació d’il·luminació en funció de presència o no de persones a la zona.

Existeixen 4 tipus fonamentals de detecció:

a) infrarrojos:

Page 54: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

56

b) acústics per ultrasò

c) per microones

d) híbrid dels anteriors

Sistema de temporització: conjunt de dispositius, cablejat i components

destinats a controlar de forma automàtica, l’apagat d’una instal·lació

d’il·luminació en funció d’un temps d’encès prefixat.

SPI: Serial Peripheral Interface: és un bus de comunicació a nivell de circuits

integrats. La transmissió de dades es realitza en sèrie, és a dir, un bit després

de l’altre.

URL: també identificador de recursos uniforme, és la seqüència de caràcters

que designa els recursos d’una xarxa. Existint una URL diferent per a cada

pàgina de cadascun dels documents de la World Wide Web.

USB: és el Bus Universal en Sèrie, és un bus estàndard industrial que defineiz

els cables, connectors i protocols utilitzats en un bus per connectar, comunicar i

proveir d’alimentació elèctrica entre computadors, perifèrics i dispositius

electrònics.

WAN: xarxa de gran cobertura en la qual es poden transmetre dades a llarga

distància, interconnectant facilitats de comunicació entre diferents localitats

d’un país. Comuntment, en aquestes xarxes es veuen implicades les

companyies telefòniques.

Page 55: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

57

ANNEX E GUIA D’ENTRADES I SORTIDES DEL

PROTOTIP

Taula E 1. I/O Digitals

PIN Funció Destí VALOR

D2 Entrada (INPUT)

Llegeix el Senyal del Sensor de presència (PIR)

HIGH= detecta presència LOW= no detecta presència

D3 Sortida

(OUTPUT) LED Blau que simula la llum del sistema detecció presència

HIGH= encén LED LOW= apaga LED

D4 Entrada (INPUT) Llegeix interruptor Auto/Manual

HIGH=Manual LOW=Automàtic

D5 Sortida

(OUTPUT) Relé activador del Endoll programable /ssp

LOW=encén HIGH=apaga (aquest relé està connectat com normalment tancat)

D6 Sortida

(OUTPUT) LED Verd (mode manual regulador)

HIHG=mode manual LOW=mode automàtic

D7 Sortida

(OUTPUT) Llum Regulable en funció de la llum natural

HIGH=manté activat el regulador LOW=desactiva el regulador

D8 Sortida

(OUTPUT) Llum 1 (controlada per Internet) HIHG=Encén LOW=Apaga

D9 Sortida

(OUTPUT) Llum 2 (controlada per Internet) HIHG=Encén LOW=Apaga

Taula E 2. I/O Analògiques

PIN Funció Destí VALOR

A0 Entrada (INPUT) Valor sensor llum LDR

Llegeix el valor de la fotoresistència

A1 Entrada (INPUT) Senyal Sensor corrent (llum 1)

Llegeix el valor de l’ACS712 per calcular la intensitat que circula i detectar l’estat del llum A3

Entrada (INPUT) Senyal Sensor corrent (llum 2)

A4 Entrada (INPUT) RealtTime Clock senyal SDA

A5 Entrada (INPUT) RealTimeClock senyal SLK

Page 56: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

58

ANNEX F ESTUDIS AMBIENTALS SIGNIFICATIUS

1. Introducció

La Comisió Europea va posar en marxa l’any 2000 un programa anomenat GreenLight l’objectiu del qual es reduir el consum en la il·luminación interior en edificis no residencial i en l’enllumenat públic. Tenint en compte aquest programa, la “Guía Técnica de iluminación eficiente. Sector Residencial y terciario” mostra resultats de la implementació d’aquest programa en diversos edificis. El resultat d’aquests estudis reforça la idea d’aquest projecte i dóna una orientació de l’estalvi energetic i económic que produiria la implementació real.

A continuació, s’explicaran els resultats obtinguts en els diferents estudis duts a terme pel programa.

2. Resultats dels estudis

� IDAE

L’edifici del IDAE (Instituto para la Diversificación y Ahorro de la Energía) va reformar el seu edifici tenint en compte el programa europeu GreenLight. El canvi que es va aplicar va ser:

- La substitució de les lluminàries per altres més eficients. - La diferenciació de les diferents zones de treball. - Ús de la il·luminació només en aquells moments en que sigui

estrictament necessària, no totes les llums funcionant a l’hora. - Aprofitament de la llum natural amb la instal·lació de fotosensors que

regulen la quantitat de llum necessària que ha d’utilitzar la làmpada. - Instal·lació de interruptors amb temporitzadors en zones d’escales i

serveis.

Page 57: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

59

Taula F 1.Comparativa Estudi IDAE

Taula F 2. Resultats Estudi IDAE

Supermercat Super U

Super U una cadena francesa de supermercats va canviar la seva idea d’il·luminació en els seus nous edificis. Els nous canvis que van aplicar van ser:

- Canvi del tipus de llumináries. - Reducció del nivell d’il·luminació. - Regulació de la il·luminació tenint en compte la quantitat de llum que es

necessita en cada moment.

Taula F 3. Resultats Estudi Super U

Page 58: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

60

Carrefour Italia

Els supermercats de Carrefour Italia també van modificar la seva forma d’il·luminació en els seus establiments. En aquest cas els canvis que es van realitzar van ser:

- Canvi de llumináries. Aquests noves llumináries permeten regular-se en funció de la llum natural que rep la nau.

- També permeten ser programades en funció de les hores d’ obertura i tancament.

Taula F 4. Resultats Estudi Carrefour Itàlia

TORRE AGBAR (Aigües de Barcelona)

La Torre Agbar es un dels edificis que millor aprofita la llum natural ja que tota la façana està envidriada. Tot i això, també té sistemes que ajuden a ser-lo molt eficient energeticamente parlant:

- Regulació de la il·luminació en funció de la llum natural. - Detectors de moviment. - Sistemes de control horari.

Si només es té en compte la regulació segons la llum natural s’estalvia un 42%, si a més, es regula amb els detectors de moviment l’estalvi ja puja al 50% i si per últim, si afegeix el control horari, l’estalvi ja és d’un 60%. I a més també s’ha de tenir en compte que hi ha una reducció en costos de manteniment i canvi de lámpades.

Page 59: IX ANNEXOS

Disseny d'un sistema de control domòtic, mitjançant la plataforma Arduino, que inclogui el control d'il·luminació des d'un dispositiu mòbil

61

Taula F 5. Resultats Estudi Torre Agbar

COLEGIS PÚBLICS

L’apliació de sistemes controlados de llum en les llumináries (regulen el flux lluminos en funció de la quantitat de llum existent en cada moment) permet reduir fins al 25% el consum eléctric de les làmpades i augmentar la seva vida útil.

Per exemple, un colegi on es col·loquen 25 controladors que gestionen 400 lluminàries, la inversió inicial es de 2.700€ pero l’estalvi es de 14000kWh/any (1.120€/any).

3. Reafirmació de l’aplicació del projecte

Aquests estuidis demostren que aplicar les mesures descrites assegura a aconseguir un estalvi energètic considerable. Per tant, malgrat no haver pogut fer un estudi comparatiu dels consums energètics abans i després de la instal·lació del prototip, de conformitat amb aquests estudis i les premises que s’exposen en l’estudi de sostenibilitat (veure el punt 2.8 de la memòria), el sistema suposa una millora energètica i, en conseqüència, també econòmica degut a que la facturació de l’energia disminueix també.