brock

Wednesday, January 29, 2014

ATmega168 Development Stick

ATmega168 Development Stick is a very compact development stick equipped with USB port for direct connectivity with latest laptops and PCs. It is also USB powered and does not need additional power supply when connected to PC or Laptop. Board comes with pre-installed bootloader and can be programmed directly from PC via USB connection with AVRdude software. All the IO ports are available on berg connectors for extended connectivity and use.

It also has LCD connections at Port-B with contrast adjustment potentiometer and back-light on-off control. Designed to correctly align with 16x2 LCD (LCD size 80mm x 36mm).

Features
  • Compact size : 100mm x 36mm
  • No need for additional programmer
  • No need for separate power supply (when used with USB support)
  • Pre-installed bootloader, works with AVRdude
  • Onboard USB to Serial converter
  • Total 22 I/Os (inclusive of 8 Analog I/Os)
  • Default powered with USB supply and supports upto 100mA
  • 10 pin ISP terminal available for programming the board with external programmer, if needed
  • Double sided, steardy yet compact and light-weight design
  • Provision for external power supply

Saturday, November 24, 2012

CAN a Brief Tutorial


The CAN transport (Controller Area Networking) was described in the late 1980 by Bosch, at first for utilization in automotive provisions. It has been recognized to be truly convenient in a wide mixture disseminated mechanical frameworks as it has the taking after qualities: 
  • Uses  a single terminated twisted pair cable
  • Is multi master
  • Maximum Signal frequency used is 1 Mbit/sec
  • Length is typically 40M at 1Mbit/sec up to 10KM at 5Kbits/sec
  • Has high reliability with extensive error checking
  • Typical maximum data rate achievable is 40KBytes/sec
  • Maximum latency of high priority message <120 1mbit="1mbit" at="at" li="li" sec="sec">
CAN is bizarre in that the elements on the arrangement, called junctions, are not given particular locations. Rather, it is the memos themselves that have an identifier which additionally certifies the posts' necessity. Junctions then hinging on their role transmit particular wires and search for particular inform. Hence there is no speculative point of confinement to the number of junctions admitting that in polish it is ~64. 

Two determinations are in utilization: 

  • 2.0A sometimes known as Basic or Standard CAN with 11 bit message identifiers which was originally specified to  operated at a maximum frequency of 250Kbit/sec - ISO11519.
  • 2.0B known as Full CAN or extended frame CAN with 29 bit message identifier which can be used at up to 1Mbit/sec - ISO 11898.
A third regarded as CAN-FD is in infrastructure (March 2012)--it gives quicker information rates of 15Mbits/sec and more vast information payloads of 64 bytes. For additional parts and how it will interwork with "Full CAN" see CAN with Flexible Data Rate 

Nuts and Bolts

From the frameworks and outline viewpoint the point by point administration of sending and gaining CAN wires could ordinarily be finished by committed fittings, on or off chip, (e.g. SJA1000) yet an outline of these roles can be helpful so as to outline, setup and control a CAN framework. 

Signal Characteristics

CAN may be enabled over various physical media so extended as the drivers are open-authority and every junction can catch itself and others while transmitting (this is indispensible for it is inform necessity and mistake taking care of mechanisms). The most regular media is a contorted match 5v differential sign which will permit operations in towering uproar dominions and with the right drivers will work regardless of the fact that one of the wires is open circuit. Various transceiver chips are ready the most mainstream without a doubt being the Philips 82C251 and also the TJA1040. 

When running Full CAN (ISO 11898-2) at it is higher rates it is vital to terminate the transport at both closes with 120 Ohms. The resistors are not just there to counteract reflections but likewise to unload the open authority transceiver drivers. We propose that you terminate the transport rightly in all situations. 

Message formats



The CAN methodology utilizes an altered form of the Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) method utilized on Ethernet. May as well two wires establish that they are both attempting to send meanwhile then in place of both sponsorship off and re-attempting later as is finished with Ethernet, in the CAN plan, the transmitters catch which inform has the most noteworthy necessity and just the easier necessity inform works toward getting deferred. This methods that an elevated necessity inform is positive of traversing. 

Data Frames

The CAN order utilizes a changed form of the Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA) procedure utilized on Ethernet. Might as well two wires establish that they are both attempting to seThese are the typical inform casings formerly would convey information. They hold the taking after fields--this is a streamlined depiction as the controller deals with the part which is just of investment to those outlining controllers (who might as well counsel the spec) 

Begin of casing (SOF) 

Inform Identifier (MID) the Lower the worth the Higher the necessity of the note 

it is length is either 11 or 29 bits extended hinging on the standard being utilized 

Remote Transmission Request (RTR) = 0-----see "Remote Frames" para underneath for non zero esteem 

Control field (CONTROL) this defines the number of bytes of information to accompany (0-8) 

Information Field (DATA) length 0 to 8 bytes 

CRC field holding a fifteen spot cyclic excess check code 

Recognize field (ACK) a vacant opening which could be filled by any and each junction that accepts the edge 

it makes a point not to state that the junction you expected the information for got it, simply that no less than one junction on the entire system got it. 

Close of Frame (EOF) 

The course in which inform crash is kept away from is that every junction as it transmits it is MID looks on the transport to see what every thinking individual else is seeing. In the event that it is in clash with a higher necessity inform identifier (unified with an easier number) then the higher necessity wires touch will keep the sign down (a zero touch is declared to be prevailing) and the easier necessity junction will quit transmitting. 

In the event that you are composing demonstrative code and wish to not "exist" on the grid as a junction, unequivocally to spy on what is event, then you will guarantee that the interface you utilize could be set to a mode where it tries not to mechanically set the ACK touch. ThePeak interfaces and their Explorer indicative bundle might be set into quite a mode. 

nd in the meantime then in place of both support off and re-attempting later as is finished with Ethernet, in the CAN plan, the transmitters recognize which inform has the most noteworthy necessity and just the easier necessity inform works toward getting deferred. This methods that a heightened necessity inform is certain of getting past. Remote Frames
These are frames that are used to request that a particular message be put on the network - of course a node somewhere on the network has to be set up to recognise the request, get the data and put out a Message frame. This mechanism is used in polled networks.  The fields are ....
Start of frame   (SOF)
Message Identifier  (MID)  either 11 or 29 bits long depending on the chosen mode.
Remote Transmission Request (RTR)  = 1
Control field  (CTRL)  this specifies the number of bytes of data expected to be returned (0-8).
CRC field  containing a fifteen bit cyclic redundancy check code.
Acknowledge field  (ACK)   an empty slot which will be filled by any and every node that receives the frame
                  it does NOT say that the node you intended the data for got it, just that at least one node on the whole network got it.
End of Frame   (EOF)

Error checking

CAN is a quite reliable framework with numerous lapse checks 

Stuffing blunder-a transmitting junction embeds a towering after five back to back level bits (and a level after five successive towering). An appropriating junction that locates violation will banner a touch stuffing lapse. 

Chomped lapse-A transmitting junction consistently peruses back the note as it is sending. In the event that it recognizes a distinctive spot esteem on the transport than the one it sent, and the touch is not part of the discretion field or in the recognition field, a failure is identified. 

Checksum failure-every appropriating junction checks CAN wires for checksum mistakes. 

Outline failure-There are sure predefined touch qualities that should be transmitted at certain indicates within any CAN Message Frame. Assuming that a recipient identifies an invalid touch in one of these positions a Form Error (some of the time in addition regarded as a Format Error) can be hailed. 

Affirmation Error-If a transmitter discovers that a note has not been ACKnowledged then an ACK Error is hailed.  

Variants

By determining just the physical and information connection levels of the OSI correspondences model the CAN detail has ended up being the premise for a wide number of industry and fabricate particular variants (and the origin of much tumult as every last trace of the clients will tell you they are utilizing CAN). Provided that you are attempting to elucidate a CAN frameworks status the first thing to figure out is the transceivers in utilization-the most regular "ordinary 5v" CAN utilizes the Philips 82C251 or the TJA1040. 

TJA 1054 is a level power, level speed physical layer that is basically utilized as a part of automotive provisions. It utilizes the PCA82C252, TJA1053 or TJA1054 transceivers. 

AU5790 moreover regarded as "Single Wire CAN" is a flat power, flat speed physical layer that is utilized within automotive requisitions and an expanding number of mechanical provisions. It utilizes the AU5790 transceiver. 

DeviceNet-Developed for utilization in streamlined process control it is dependent upon the standard Full CAN-ISO 11898-2 5v transport. Then again DeviceNet meticulously characterizes the physical interconnect, has a more prohibitive transceiver detail, 11 digit identifiers just, permits 125, 250 and 500KBaud operation just and controls the memo substance so as to effectively underpin interoperability of distinctive makers units. 

CANopen-Also outlined considering control provisions, it is a programming standard dependent upon the standard Full CAN-ISO 11898-2 5v transport. It restricts the number of junctions to 127 and apportions them IDs. Profiles are specified for every sort of unit by CiA to re-order utilizing comparative units (eg engine drives) from distinctive producers. Some standard system summons are characterized that permit modules to be mechanically distinguished and assigned a junction ID. The spec moreover characterizes a route to handle synchronised information peruses and composes and additionally furnishing a standard course in which imposing hinders of information could be perused and composed. We can supply CANopen symptomatic and system administration programming, Embedded drivers and I/O modules. 

TTCAN-Time Triggered CAN-The Time-Triggered Protocol has junctions reporting in predefined time windows that need to be arranged and synchronised but which then guarantee that an over-burden on the transport is not plausible even in a most exceedingly awful case scenario. 

J1939-An entire group of industry particular models (horticulture, marine, truck & transport and so on) are extended the fundamental correspondence utilities of the J1939 order particular ( itself dependent upon Full CAN-ISO 11898-2) with industry-particular reports demarcating the specific blending of layers for that industry. PEAK give a full database of J1939 mental helpers with their J1939 alternative to PCAN-Explorer 

B10011S is the Transceiver utilized within a quite confined form of CAN (ISO 11992-1) that has just two junctions regularly a truck and it is trailer-not to be confounded with....... 

FMS is a memo order subset of J1939 characterized for the Bus and Truck/Trailer business sector. For a programming bundles that knows the significance of every last trace of the FMS wires and can test/emulate and showcase them in an astronomical way see our FMS Toolkit. 

MilCAN-is outlined for utilization in military arrive vehicles where a deterministic order is need. It sets up certain controls for utilization and a programming layer on top of an ordinary CAN arrangement. A Pseudo Hardware Sync is made by one junction "the SyncMaster" that sends Sync CAN Frames with a "sync opening number". 

MilCAN A utilization 29 spot Identifiers. It permits both occasional and occasion driven information to be transmitted through the transport. 

MilCAN B utilizes 11 touch identifiers. It permits just occasional information to be transmitted by means of the transport 
 Standard Common NameBaud Rate Max nodesMax LengthAdapter for
PCAN interfaces
ISO 11783ISOBUS250 KBit/s 3040mNone required
ISO 11898-2 High speed-CANmax. 1 MBit/s110 6500 mNone required
ISO 11898-3 Fault Tolerant CANmax. 125 KBit/s 32 500 mPCAN TJA1054
ISO 11992Truck/Trailer CANmax. 125 KBit/s
2  (Point to Point)
40 mPCAN-BD10011S
ISO 15765Diagnostics On CANmax 1 MBit/s110PCAN-OBD connector
SAE J1939
J1939250 KBit/s30 ECUs40mJ1939 option to PCAN-Explorer
SAE J2284max. 1 MBit/s 110None required

SAE J2411
Single Wire CAN33,3 KBit/s
83,3KBit/s in HSMode
32PCAN-AU5790

LIN

Nearby Interconnect Network is more straightforward than CAN and is regularly utilized within automotive "form capacities"-eg windows, where exhibition is not basic but cost is. CAN is then frequently in previous times would mix the operation of different LIN sub arrangements. LIN is a solitary ace, numerous slave framework that utilizes a 12V single wire physical layer and a UART/SDI with expert driven self synchronisation. It is equipped for of running at information rates of up to 20Kbits for each second over a greatest separation of 40 Meters. We can supply a USB to LIN interface and a LIN to CAN portal which re-order improving LIN and jumbled CAN/LIN frameworks. 
Interface between CAN and PCs
We can supply various distinctive interfaces to permit a PC to banter with CAN. The most ubiquitous is the PCAN-USB interface but we additionally have the countless structure components of PCI incorporating PC/104 and PCMCIA and in addition ISA and RS232. See our reach. The proposed are then all underpinned by broad ...... 
Software
Installed CAN chip producers will give cases of how to drive their chips, as a rule composed in constructing agent or C. PC programming to drive the USB, PCI or different interfaces to CAN can moreover be supplied by the interface producer. Top give both level drivers for Windows and a unlimited API for their interfaces to permit CAN and LIN to be determined from an extent of provision dialects on the PC. In addition good to go are CAN analyser bundles from the unlimited straightforward but moving PCAN-perspective to the modern PCAN-Explorer which furnishes information plotting with strip outlines, client demarcated inform names and information transformations for simplicity of investigation and additionally broad macro and script underpin for information accumulation and control. Include bundles incorporate J1939 back, a GUI interface that might be utilized for both show and control and a replay office for Simulation. A particular programming bundle is good to go to blanket the FMS Bus and Truck standard so it might be effectively utilized by architects not acquainted with CAN. 

A Windows standard API has been improved for imparting between C code on PCs and CAN-it is called RP1210 and a driver for it is good to go for the PCAN extend of interfaces with the goal that they might be utilized with requisitions supporting that standard. 

CAN-Open is indispensably more perplexing but we can supply both PC based CANopen symptomatic and system administration programming and installed drivers. 



Thursday, November 22, 2012

Automatic Human Detection and Energy Saving System based on Zigbee Communication



The Automatic detection of human and Energy saving design is divided in to two sub systems (1) Transmitting section and (2) Receiving section.
The transmitting area comprises of (1) Zigbee transmitter (2) LPC2148 (ARM7) Microcontroller, (3) Temperature Sensor (LM35) (4) IR Transmitter-Receiver (5) PIR Sensor(D203B) .The appropriating segment comprises of (1) LPC2148 (ARM7) Microcontroller (2) Zigbee receiver(3) Consumer electronic apparatuses. Fig.1 shows the Block graph of the Automatic recognition of human and Energy saving system utilizing zigbee



The IR sign and PIR sensor signs are associated with the transmitter side arm7 microcontroller I/O ports to P1.16 and P1.17 separately. Measured temperature esteem and Light intensity  esteem are given to ADC1.1& ADC1.2 individually. Zigbee transmitter is joined with pin 19 of arm7 microcontroller on TX side. 

Light and fan are joined with the receiver side arm7 microcontroller I/O ports to P0.11 and P01.12 separately. Zigbee recipient is associated with pin 17 of arm7 microcontroller on Rx side. 

When an individual enters in the room, the IR sign instantly emulated by PIR signal is created. Then number ought to be augmented. When no individual is put forth in the room (i.e., count=0) then send commands to recipient to switch off light and fan. 

When individual is exhibit (i.e., count>0), 

a. Depending on if esteem of temperature >50 then send command to Rx to switch ON fan else switch off the fan. b..If light power is dull then send command to Rx to switch ON light else switch off the light. 

Individual passageway is recognized by PIR indicate promptly accompanied by IR indicate. Then decrement number. The charges are sent to beneficiary as accompanies. To start with from M1 to Zigbee TX and afterward to Zigbee Rx then afterward to M2.The units are worked utilizing P0.11 and P0.12 qualities as a part of M2. 
fig2

fig3
fig4
fig5
fig6
Algorithm:
Step1: Start

Step2: Initiate microcontrollers M1, M2.

Step 3: Check for IR interrupt signal. If it is followed by PIR signal, then increment count. Step4: When count >0 do the following:
1. If temperature >50 then send a command to receiver to switch ON fan else send a command to receiver to switch OFF fan

2. If room intensity is dark then send a command to receiver to switch ON light else send a command to receiver to switch OFF light.

3. Check for PIR signal. If it is followed by IR interrupt signal. Then decrement count. Step 5: When count<0 s="s" span="span" style="letter-spacing: -.05pt;">end command to receiver to switch OFF fan and light.
Step 6: Repeat the steps 3, 4 and 5 in parallel.