Sunday, June 28, 2015

Digital Temperature Indicator

The circuit given here is of digital temperature indicator with LED 7-segment display using the ICL7107. It measures temperature from 00.0 C to 99.9 C. ICL7107 is a 3 1/2 digit A/D converters with LED 7-Segment Driver. We convert 99.9mV Voltmeter into a Temperature indicator first we design 99.9mV Voltmeter.

The Intersil ICL7106 and ICL7107 are high performance, low power, 31/2 digit A/D converters. Included are seven segment decoders, display drivers, a reference, and a clock. The ICL7106 is designed to interface with a liquid crystal display (LCD) and includes a multiplexed backplane drive; the ICL7107 will directly drive an instrument size light emitting diode (LED) display. The ICL7106 and ICL7107 bring together a combination of high accuracy, versatility, and true economy. It features autozero to less than 10μV, zero drift of less than 1μV/oC, input  bias current of 10pA (Max), and rollover error of less than one count. True differential inputs and reference are useful in all systems, but give the designer an uncommon advantage when measuring load cells, strain gauges and other bridge type transducers. Finally, the true economy of single power supply operation (ICL7106), enables a high performance panel meter to be built with the addition of only 10 passive components and a display.




Working:
We have designed basic 99.9mV DC Voltmeter using design steps given in data sheets. It displays 3 digits i.e. 99.9mV maximum. Actually ICL7107 have 3 and 1/2 Display we are not
using 1/2(half) display. Reference voltage of 100mV is generated using 1.2 V Zener and Variable resistor forms a voltage divider. Input is divided by 10K and 1.1KOhm resistor (divide by 10) to get proportional temperature scale. Block diagram gives clear idea about how it works.


 How to ? 
Components Value Selection:
Integrating Resistor:
Both the buffer amplifier and the integrator have a class A output stage with 100μA of quiescent current. They can supply 4μA of drive current with negligible nonlinearity. The integrating resistor should be large enough to remain in this very linear region over the input voltage range, but small enough that undue leakage requirements are not placed on the PC board. For 2V full scale, 470kΩ is near optimum and similarly a 47kΩ for a 200mV scale. Select 47KΩ (Resistor Connected at Pin 28) Vbuf

Integrating Capacitor:
The integrating capacitor should be selected to give the maximum voltage swing that ensures tolerance buildup will not saturate the integrator swing (approximately. 0.3V from either supply). In the ICL7106 or the ICL7107, when the analog COMMON is used as a reference, a nominal +2V fullscale integrator swing is fine. For the ICL7107 with +5V supplies and analog COMMON tied to supply ground, a ±3.5V to +4V swing is nominal. For three readings/second (48kHz clock) nominal values for ClNT are 0.22μF and 0.10μF, respectively. Of course, if different oscillator frequencies are used, these values should be changed in inverse proportion to maintain the same output swing. An additional requirement of the integrating capacitor is that it must have a low dielectric absorption to prevent roll-over errors. While other types of capacitors are adequate for this application, polypropylene capacitors give undetectable errors at reasonable cost. (Capacitor Connected at Pin 27 Select 0.22uF)

Auto-Zero Capacitor (Pin 29):
The size of the auto-zero capacitor has some influence on the noise of the system. For 200mV full scale where noise is very important, a 0.47μF capacitor is recommended. On the 2V scale, a 0.047μF capacitor increases the speed of recovery from overload and is adequate for noise on this
scale.

Reference Capacitor: (Pin 34, 33):
A 0.1μF capacitor gives good results in most applications. However, where a large common mode voltage exists (i.e., the REF LO pin is not at analog COMMON) and a 200mV scale is used, a larger value is required to prevent roll-over error. Generally 1μF will hold the roll-over error to 0.5 count in this instance.

Oscillator Components:
For all ranges of frequency a 100kΩ resistor is recommended and the capacitor is selected from the equation:

Reference Voltage:
The analog input required to generate full scale output (2000 counts) is: VlN = 2VREF. Thus, for the 200mV and 2V scale, VREF should equal 100mV and 1V, respectively.

Development of PCB:
Step 1: Circuit Diagram and Components required
1. 7-Segment Display Common Anode Qty. 3
2. ICL7107, and IC Base 40 Pin
3. LM35 Temperature Sensor
4. LM7805
5. 1N4007
6. Other Capacitors and Resistors

Download PDF Circuit Diagram

Step 2: PCB Layout 
Download PCB Layout pdf
Download Component Placement Diagram pdf



Step 3: Assemble Components and Test the circuit
1. Comment if you have any questions.
2. Like, Share, Follow us on Google+


Saturday, June 27, 2015

Object Counter Circuit

Aim of this project is very simple it counts Objects or Pulses from IR proximity detector. Maximum count is 999. It can be reset at any point and pulses for counting can be given from various sensors, such as IR sensor or LDR circuit.

In this project we are using CD4033 consists of a 5 stage Johnson decade counter and an output decoder which converts the Johnson code to a 7 segment decoded output for driving one stage in a numerical
display. This device is particularly advantageous in display applications where low power dissipation and/or low package count is important. A high RESET signal clears the decade counter to its zero count. The counter is advanced one count at the positive clock signal transition if the CLOCK INHIBIT signal is low. Counter advancement via the clock line is inhibited when the CLOCK INHIBIT signal is high. The CLOCK INHIBIT signal can be used as a negative-edge clock if the clock line is held high. Antilock gating is provided on the JOHNSON counter, thus assuring proper counting sequence. The CARRY-OUT (Cout) signal completes one cycle every ten CLOCK INPUT cycles and is used to clock the succeeding decade directly in a multi-decade counting chain. The seven decoded outputs (a, b, c, d, e, f, g) illuminate the
proper segments in a seven segment display device used for representing the decimal numbers 0 to 9. The 7 segment outputs go high on selection.


Step 1: Components Required
1. 7-Segment Display Common Cathode Qty. 3
2. CD4033 Qty. 3
3. 16-Pin IC base for the IC
4. Resistor 10K
5. Switches or any pulse input that can be given to input pins

Step 2: PCB Development
Download pdf Circuit Diagram (1:1 Scale)

Circuit Diagram:
Object Counter Circuit Diagram
PCB Layout:

Object Counter PCB Layout

Step 3: Test The Circuit
1. Circuit Works on +5V.
2. Connect +5V Supply
3. Press Clock Switch and observe that count gets incremented
4. Press Reset Switch to reset the count
5. Connect proximity sensor to clock in. You can connect any sensor that gives TTL level pulses.
6. Follow us on Google+, Facebook
7. If you have any questions please comment. If you want any new circuit comment it.




Tuesday, June 23, 2015

Oscillator Design

CMOS Oscillators Design Fundamental:
This tutorial describes several square wave oscillators that can be built using CMOS logic elements. These circuits offer the following advantages:
• Guaranteed startability
• Relatively good stability with respect to power supply variations
• Operation over a wide supply voltage range (3V to 15V)
• Operation over a wide frequency range from less than 1 Hz to about 15 MHz
• Low power consumption
• Easy interface to other logic families and elements including TTL

Several RC oscillators and two crystal controlled oscillators are described. The stability of the RC oscillator will be sufficient for the bulk of applications; however, some applications will probably require the stability of a crystal. Some applications that require a lot of stability are:

1. Timekeeping over a long interval. A good deal of stability is required to duplicate the performance of an ordinary wrist watch (about 12 ppm). This is, of course, obtainable with a crystal. However, if the time interval is short and/or the resolution of the timekeeping device is relatively large, an RC oscillator may be adequate. For example: if a stopwatch is built with a resolution of tenths of seconds and the longest interval of interest is two minutes, then an accuracy of 1 part in 1200 (2 minutes x 60 seconds/minute x 10 tenth/second) may be acceptable since any error is less than the resolution of the device.

2. When logic elements are operated near their specified limits. It may be necessary to maintain clock frequency accuracy within very tight limits in order to avoid exceeding the limits of the logic family being used, or in which the timing relationships of clock signals in dynamic MOS memory or shift register systems must be preserved. 

3. Baud rate generators for communications equipment.

4. Any system that must interface with other tightly specified systems. Particularly those that use a “handshake” technique in which Request or Acknowledge pulses must be of specific widths.

LOGICAL OSCILLATORS
Before describing any specific circuits, a few words about logical oscillators may clear up some recurring confusion. Any odd number of inverting logic gates will oscillate if they are tied together in a ring as shown in Figure 1. Many beginning logic designers have discovered this (to their chagrin) by inadvertently providing such a path in their designs. However, some people are confused by the circuit in Figure 1 because they are accustomed to seeing sinewave oscillators implemented with positive feedback, or amplifiers withnon-inverting gain. Since the concept of phase shift becomes a little strained when the inverters remain in their linear region for such a short period, it is far more straightforward to analyze the circuit from the standpoint of ideal switches with finite propagation delays rather than as amplifiers with 180° phase shift. It then becomes obvious that a “1” chases itself around the ring and the network oscillates.
The frequency of oscillation will be determined by the total propagation delay through the ring and is given by the following equation.
Where:
f = frequency of oscillation
Tp = Propagation delay per gate
n = number of gates

This is not a practical oscillator, of course, but it does illustrate the maximum frequency at which such an oscillator will run. All that must be done to make this a useful oscillator is to slow it down to the desired frequency. Methods of doing this are described later. To determine the frequency of oscillation, it is necessary to examine the propagation delay of the inverters. CMOS propagation delay depends on supply voltage and load capacitance. Several curves for propagation delay for Fairchild’s 74C line of CMOS gates are reproduced in Figure 3. From these, the natural frequency of oscillation of an odd number of gates can be determined. An example may be instructive. Assume the supply voltage is 10V. Since only one input is
driven by each inverter, the load capacitance on each inverter is at most about 8 pF. Examine the curve in Figure 3c that is drawn for VCC = 10V and extrapolate it down to 8 pF. We see that the curve predicts a propagation delay of about 17 ns. We can then calculate the frequency of oscillation for three inverters using the expression mentioned above.

STABLE RC OSCILLATOR:
Figure 2 illustrates a useful oscillator made with three inverters. Actually, any inverting CMOS gate or combination of gates could be used. This means left over portions of gate packages can be often used. The duty cycle will be close to 50% and will oscillate at a frequency that is given by the following expression.

The following three special cases may be useful.


A SINGLE SCHMITT TRIGGER MAKES AN OSCILLATOR:
Figure 6 illustrates an oscillator made from a single Schmitt trigger. Since the MM74C14 is a hex Schmitt trigger, this oscillator consumes only one sixth of a package. The remaining 5 gates can be used either as ordinary inverters like the MM74C04 or their Schmitt trigger characteristics can be used to advantage in the normal manner. Assuming these five inverters can be used elsewhere in the system, Figure 6 must represent the ultimate in low gate count oscillators.
If these thresholds were constant percentages of VCC over the supply voltage range, the oscillator would be insensitive to variations in VCC. However, this is not the case. The thresholds of the Schmitt trigger vary enough to make the oscillator exhibit a good deal of sensitivity to VCC.

ICL7107 Digital Voltmeter

The circuit given here is of digital voltmeter with LED 7-segment display using the ICL7107. It measures voltage from 0.00V to 99.9V. ICL7107 is a 3 1/2 digit A/D converters with LED 7-Segment Driver.

The Intersil ICL7106 and ICL7107 are high performance, low power, 31/2 digit A/D converters. Included are seven segment decoders, display drivers, a reference, and a clock. The ICL7106 is designed to interface with a liquid crystal display (LCD) and includes a multiplexed backplane drive; the ICL7107 will directly drive an instrument size light emitting diode (LED) display. The ICL7106 and ICL7107 bring together a combination of high accuracy, versatility, and true economy. It features autozero to less than 10μV, zero drift of less than 1μV/oC, input  bias current of 10pA (Max), and rollover error of less than one count. True differential inputs and reference are useful in all systems, but give the designer an uncommon advantage when measuring load cells, strain gauges and other bridge type transducers. Finally, the true economy of single power supply operation (ICL7106), enables a high performance panel meter to be built with the addition of only 10 passive components and a display.


ICL7107 Circuit Diagram


Working:
We have designed basic 100V DC Voltmeter using design steps given in data sheets. It displays 3 digits i.e. 99.9V maximum. Actually ICL7107 have 3 and 1/2 Display we are not
using 1/2(half) display. Reference voltage of 100mV is generated using 1.2 V Zener and Variable resistor forms a voltage divider. Input is divided by 100K and 100Ohm resistor to get 200mV in-proportion. 

How to ? 
Components Value Selection:
Integrating Resistor:
Both the buffer amplifier and the integrator have a class A output stage with 100μA of quiescent current. They can supply 4μA of drive current with negligible nonlinearity. The integrating resistor should be large enough to remain in this very linear region over the input voltage range, but small enough that undue leakage requirements are not placed on the PC board. For 2V full scale, 470kΩ is near optimum and similarly a 47kΩ for a 200mV scale. Select 47KΩ (Resistor Connected at Pin 28) Vbuf

Integrating Capacitor:
The integrating capacitor should be selected to give the maximum voltage swing that ensures tolerance buildup will not saturate the integrator swing (approximately. 0.3V from either supply). In the ICL7106 or the ICL7107, when the analog COMMON is used as a reference, a nominal +2V fullscale integrator swing is fine. For the ICL7107 with +5V supplies and analog COMMON tied to supply ground, a ±3.5V to +4V swing is nominal. For three readings/second (48kHz clock) nominal values for ClNT are 0.22μF and 0.10μF, respectively. Of course, if different oscillator frequencies are used, these values should be changed in inverse proportion to maintain the same output swing. An additional requirement of the integrating capacitor is that it must have a low dielectric absorption to prevent roll-over errors. While other types of capacitors are adequate for this application, polypropylene capacitors give undetectable errors at reasonable cost. (Capacitor Connected at Pin 27 Select 0.22uF)

Auto-Zero Capacitor (Pin 29):
The size of the auto-zero capacitor has some influence on the noise of the system. For 200mV full scale where noise is very important, a 0.47μF capacitor is recommended. On the 2V scale, a 0.047μF capacitor increases the speed of recovery from overload and is adequate for noise on this
scale.

Reference Capacitor: (Pin 34, 33):
A 0.1μF capacitor gives good results in most applications. However, where a large common mode voltage exists (i.e., the REF LO pin is not at analog COMMON) and a 200mV scale is used, a larger value is required to prevent roll-over error. Generally 1μF will hold the roll-over error to 0.5 count in this instance.

Oscillator Components:
For all ranges of frequency a 100kΩ resistor is recommended and the capacitor is selected from the equation:

Reference Voltage:
The analog input required to generate full scale output (2000 counts) is: VlN = 2VREF. Thus, for the 200mV and 2V scale, VREF should equal 100mV and 1V, respectively.

Development of PCB:
Step 1: Circuit Diagram and Components required
1. 7-Segment Display Common Anode Qty. 3
2. ICL7107, and IC Base 40 Pin
3. LM7805
4. 1N4007
5. Other Capacitors and Resistors
Download PDF File
ICL7107 DC Voltmeter Circuit

Step 2: PCB Layout 
Download PCB Layout pdf
Download Component Placement Diagram pdf
ICL7107 DC Voltmeter PCB Layout

Step 3: Assemble Components and Test the circuit
1. Comment if you have any questions.
2. Like, Share, Follow us on Google+







Sunday, June 14, 2015

pH sensor arduino

In this project, step by step tutorial we are discussing about how to interface pH sensor with Arduino.
pH Sensor Arduino Interfacing

In chemistry, pH is the negative log of the activity of the hydrogen ion in an aqueous solution. Solutions with a pH less than 7 are said to be acidic and solutions with a pH greater than 7 are basic or alkaline. Pure water has a pH of 7. Contrary to popular belief, this value can extend past 0 or 14 for sufficiently concentrated acids and bases, however it is difficult to measure precisely.
The pH scale is traceable to a set of standard solutions whose pH is established by international agreement. Primary pH standard values are determined using a concentration cell with transference, by measuring the potential difference between a hydrogen electrode and a standard electrode such as the silver chloride electrode. Measurement of pH for aqueous solutions can be done with a glass electrode and a pH meter, or using indicators.
pH measurements are important in medicine, biology, chemistry, agriculture, forestry, food science, environmental science, oceanography, civil engineering, chemical engineering, nutrition, water treatment & water purification, and many other applications.
Mathematically, pH is the negative logarithm of the activity of the (solvated) hydronium ion, more often (albeit somewhat inaccurately) expressed as the measure of the hydronium ion concentration.
Step 1: Components Requires
1. Arduino Uno
2. pH Sensor ( Atlas Scientific ) 
3. Connecting wires
4. pH Sensor Circuit

Step 2: Connections and Circuit
Make connections as Shown
Warnning: DO NOT SOLDER pH CIRCUIT, IT WILL DAMAGE IT, IT IS HAVING VERY HIGH IMPEDANCE, soldering is not good for it, use jumper wires/headers, Do not cut the pH sensor probe to extend length or change its BNC connector.
pH Sensor interfacing with Arduino
Step 3: Programming the Arduino
Code:

//blog.circuits4you.com 
//pH Measurement using Atlas Scientific pH Sensor

#include <SoftwareSerial.h> //We are using Software serial to free the hardware serial port
#define rx 2                //define what pin rx is going to be
#define tx 3                //define what pin tx is going to be

SoftwareSerial myserial(rx,tx); //define how the software serial port is going to work

char ph_data[20];    //20 byte char array to hold incoming data from pH
char computerdata[20]; //20 byte char array to hold incoming data from PC
byte received_from_computer=0; //how many characters recived
byte received_from_sensor=0; 
byte arduino_only=0; //if you would like to operate the pH Circuit with the Arduino only and
                     //not use the serial monitor to send it commands set this to 1.

byte startup=0;    //Used to make sure the Arduino rakes over control of the pH Circuit properly
float ph=0;        //used to hold a floating point number that is the pH
byte string_received=0;  //used to identify when we have received a string from the pH circuit

void setup() {
  Serial.begin(38400);   //enable the hardware serial at BAUD: 38400
  myserial.begin(38400); //enalble the software serial
   
}

void serialEvent(){    //this interrupt will trigger when the data coming from
                       //the serial monitor(pc/mac/other) is received.
  
  if(arduino_only!=1){ //if Arduino_only does not equal 1 this function will be bypassed.    
    received_from_computer=Serial.readBytesUntil(13,computerdata,20);  //we read the data sent from the serial monitor
                                                                       //(pc/mac/other) until we see a <CR>. We also count
                                                                       //how many characters have been received.
    computerdata[received_from_computer]=0;        //we add a 0 to the spot in the array just after the last
                                                   //character we received.. This will stop us from
                                                   //transmitting incorrect data that may have been left
                                                    //in the buffer. 
    myserial.print(computerdata);        //we transmit the data received from the serial monitor
                                         //(pc/mac/other) through the soft serial port to the
                                         //pH Circuit.   
    myserial.print('\r');               //all data sent to the pH Circuit must end with a <CR>.
  }
}

void loop() {                           //if we see that the pH Circuit has sent a character.
  if(myserial.available() > 0){
      received_from_sensor=myserial.readBytesUntil(13,ph_data,20); //we read the data sent from pH Circuit until we see
                                                                    //a <CR>. We also count how many character have
                                                                    //been received.
      ph_data[received_from_sensor]=0;     //we add a 0 to the spot in the array just after the last
                                           //character we received. This will stop us from
                                           //transmitting incorrect data that may have been left
                                           //in the buffer.
      string_received=1;                   //a flag used when the Arduino is controlling the
                                          //pH Circuit to let us know that a complete string
                                          //has been received.
      Serial.println(ph_data);            //lets transmit that data received from the pH Circuit
                                          //to the serial monitor.
    }
  if(arduino_only==1){Arduino_Control();} //If the var arduino_only is set to one we will call this
                                          //function. Letting the Arduino take over control of the
                                          //pH Circuit
}

void Arduino_Control(){
    if(startup==0){        //if the Arduino just booted up, we need to set some things up first.
        myserial.print("e\r");   //take the pH Circuit out of continues mode.
        delay(50);              //on start up sometimes the first command is missed.
        myserial.print("e\r");  //so, let’s send it twice.
        delay(50);       //a short delay after the pH Circuit was taken out of continues mode is used to make sure we don’t
                         //over load it with commands.
        startup=1;       //startup is completed, let's not do this again during normal operation.
    }
    delay(800);     //we will take a reading ever 800ms. You can make this much longer or shorter if you like.
    myserial.print("R\r");    //send it the command to take a single reading.
    if(string_received==1){   //did we get data back from the ph Circuit?
      ph=atof(ph_data);         //many people ask us "how do I convert a sting into a float?" This is how...
      if(ph>=7.5){Serial.println("high\r");}   //This is the proof that it has been converted into a float.
      if(ph<7.5){Serial.println("low\r");}     //This is the proof that it has been converted into a float.
      string_received=0;                      //reset the string received flag.  
    }
}

Step 4: Testing and Debugging
 1. Start the serial monitor and observe the reading 
 2.  For more information on pH sensor Commands Download Manual pdf




Arduino flow measurement

Ever wanted to measure liquid flowing through a pipe / container? Wanted to create a control system based on the water flow rate or quantity ? For example while gardening, to measure the amount of water used to water your plants , to prevent wastage , etc.  If yes, then this very easy DIY project is for you. Here, step by step instructions are given on how to measure water flow rate and quantity using an arduino flow rate sensor.

A flow sensor is a device for sensing the rate of fluid flow. Typically a flow sensor is the sensing element used in a flow meter, or flow logger, to record the flow of fluids.

Step 1: Components Requires
1. Arduino Uno
2. Flow Sensor
3. Connecting wires
4. LCD Display
5. 1K Ohm Resistor

Step 2: Circuit and Its Connections
Flow sensor Yellow Wire is output and it gives pulses in proportion with flow


Connect Flow Sensor and LCD as shown above, You may skip the connection of LCD display if you want to take readings on computer. Reading also displayed in serial monitor.

Step 3: Programming the Arduino

Code:

/*
This tutorial Demonstrates the use of Flow Sensor
 Web: blog.circuits4you.com
  The circuit:
Flow Sensor Connections
Yellow --- Pin 6
Red    --- +5V
Black  --- GND     
      
LCD Connections      
 * LCD RS pin to digital pin 12
 * LCD Enable pin to digital pin 11
 * LCD D4 pin to digital pin 6
 * LCD D5 pin to digital pin 5
 * LCD D6 pin to digital pin 4
 * LCD D7 pin to digital pin 3
 * LCD R/W pin to ground
 * 1K resistor:
 * One end to ground
 * Another end to LCD VO pin (pin 3)
 
 This example code is in the public domain.
 */

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 6, 5, 4, 3);

volatile int FlowPulse; //measuring the rising edges of the signal
int Calc;                               
int flowsensor = 2;    //The pin location of the sensor


void setup() {
     
   pinMode(flowsensor, INPUT); //initializes digital pin 2 as an input
   Serial.begin(9600);         //This is the setup function where the serial port is initialised,
   attachInterrupt(0, rpm, RISING); //and the interrupt is attached
   
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.setCursor(0, 1);
  lcd.print("Flow Meter");
}

void loop() {
     
 FlowPulse = 0;      //Set NbTops to 0 ready for calculations
 sei();            //Enables interrupts
 delay (1000);      //Wait 1 second
 cli();            //Disable interrupts
 Calc = (FlowPulse * 60 / 7.5); //(Pulse frequency x 60) / 7.5Q, = flow rate in L/hour 
 Serial.print (Calc, DEC); //Prints the number calculated above
 Serial.print (" L/hour\r\n"); //Prints "L/hour" and returns a  new line
  
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 2);
  lcd.print(Calc,DEC);   // print the Flow Rate
  lcd.print(" L/hour");
}

void rpm ()     //This is the function that the interupt calls 
{ 
  FlowPulse++;  //This function measures the rising and falling edge of the hall effect sensors signal
} 

Step 4: Testing and Results
1. Blow air or allow water flow through the sensor
2. Observe the reading on LCD or Serial Monitor
3. Readings get updated at every 1 Sec



Saturday, June 13, 2015

TV Based Oscilloscope

This single project turns your TV into a digital storage oscilloscope with a sampling rate 160 Ksps. As a bonus, five voltages on the five analog inputs can be monitored.

No additional video-controller and video-RAM are required. Main goal of this project is an implementation of a high-resolution (512x240 pixels) video generator inside the ARM microcontroller, LPC2138. This video generator operates in the background mode, with a low CPU loading that allows the other high-intensive tasks (such as the data collection and visualization) be run. 

Both of standards, American NTSC and Europe PAL are supported.

There are many solutions, as a sound card, as USB standalone devices based that turns you PC into digital oscilloscope. All of them have a significant disadvantage – when you use PC simultaneously for measurement and for other needs, you are compelled to click a mouse again and again to switch between applications. Of course, you may put a dedicated notebook, but the other disadvantages such as a continuous operating system loading and control by the mouse are remain.

Those devices require the PC with all peripherals, my device just the TV. It’s ready to be used immediately after the powering on. Note that the implementation of scope was not my main task, it was just a good way to demonstrate the operation of video-controller that has been implemented using the capabilities of the Philips’ chip LPC2138.



Step 1: Circuit Diagram and Connections
Step 2: Download Required Files
Download Code
Download Working Details



LPC2148 based water quality monitoring system

This project is based on LPC2148 ARM 7 Microcontroller, It measures pH, Flow, and temperature of water. It logs data on computer and shows real time readings on 16x2 LCD, It uses BlueBoard-LPC2148
BlueBoard-LPC214x






BlueBoard is a cost effective prototyping and solutions using the versatile LPC214x series of microcontrollers. It is a ready-to-run development platform with code snippets to demonstrate applications for every feature supported on the board. The BlueBoard offers ubiquitous interfaces making it the best board available for the offered price.
The LPC2148 microcontroller has 512KB of internal flash and 32+8K RAM, can be clocked up to 60Mhz. LPC2148 features include USB 2.0 device, 2xUARTs, RTC, 2x10bit ADCs each ADC has multiple channels, 1xDAC, 6XPWM, 2xI2C, 1xSPI, 1XSSP, 2x32-bit TIMERS, FAST I/0 support and WDT. LPC2148 also supports In System Programming (ISP)VB6 Software for Data logging

Step 1: Circuit Diagram and Connections
1. Flow sensor connections goes to EINT1 (Pin 45 of LPC2148).
2. Temperature Sensor to ADC Channel (AD0.3 Pin 15 of LPC2148).
3. pH sensor RX, TX lines are connected to USART1 (TTL Rx Tx).
4. UART0 is used for sending data to PC for data logging.

Step 2: Download Required Files
In this project we are directly connecting these sensor to blueboard so no need of separate PCB or Circuit Diagram
1. Circuit Diagram of Blueboard
2. pH Sensor Protocol and Details

Step 3: Download Source Code
1. Download VB6 Software for DataLogging
2. Download LPC2148 Project Code File

Kiel ARM  Code (main.c):


/* blog.circuits4you.com */

#include <stdio.h>
#include <LPC214x.H>                       /* LPC214x definitions */
#include "lcd.h"
#include "adc.h"
#include "uart.h"
#include "irq.h"

extern char pH[5];
int volatile EINT2   =   0;
void ExtInt_Serve2(void)__irq;
void ExtInt_Init2(void);
int Flow;

/*******************************************************************
  Function Name : wait()
  Description :This function suspends the tasks for specified ticks. 
  Input :  ticks:no of ticks in multiple of 1 usec
            task: task to be suspended
*******************************************************************/

void wait(int count)
{
  int j=0,i=0;

  for(j=0;j<count;j++)
  {
    /* At 60Mhz, the below loop introduces
    delay of 10 us */
    for(i=0;i<35;i++);
  }
}

/******************************************************************
 Function Name : process_adc()
 Description :
Reads ADC data LM35, then displays it on LCD
******************************************************************/
void process_adc(void)
{
 unsigned short adc_value = 0;
   unsigned char buf[16] = {0};


  lcd_putstring(LINE1,"pH:");

  lcd_putchar(pH[0]);lcd_putchar(pH[1]);  
  lcd_putchar(pH[2]);lcd_putchar(pH[3]);lcd_putchar(pH[4]);

  adc_value = adc_read(ADC0, CHANNEL_3); 
  adc_value=adc_value/3.1;
  sprintf((char *)buf, " T:%02d ", adc_value);
  //lcd_putstring(LINE2, (char *)buf);  
  lcd_putchar(buf[0]);
  lcd_putchar(buf[1]);
  lcd_putchar(buf[2]);
  lcd_putchar(buf[3]);
  lcd_putchar(buf[4]);
  lcd_putchar(0xDF);
  lcd_putchar('C');
 sprintf((char *)buf, "Flow:%d ", Flow); 
 lcd_putstring(LINE2, (char *)buf);
 lcd_putchar('L');lcd_putchar('/');lcd_putchar('H');lcd_putchar('r');

//Send data to PC through uart0
  uart0_putc('(');
  uart0_putc(pH[0]);uart0_putc(pH[1]);  
  uart0_putc(pH[2]);uart0_putc(pH[3]);uart0_putc(pH[4]);
  uart0_putc(',');

  sprintf((char *)buf, "%04d", Flow);  
  uart0_puts((char *)buf);
  uart0_putc(',');
  sprintf((char *)buf, "%02d",adc_value);
  uart0_puts((char *)buf);
  uart0_putc(')');
}

/*******************************************************
 Function Name : main()
*********************************************************/
int main (void) 
{
  init_adc0();      // Initialize ADC
  init_lcd();      // Initialize LCD
  wait(100000);

 init_VIC();      //Interrupt enable
 ExtInt_Init2();     //Enable Flow Sensor Intterupt 
    UARTInit1(38400);    //UART1 init
 UARTInit(38400);    //UART0 init

 wait(100000);
 
 uart1_puts("C");    //pH Sensor Command "C+CR" to continuously send pH data 
 uart1_putc(13);     //at baud rate of 38400
 

  lcd_clear();      // clear display
  while(1)
  {
    process_adc();     // Raed ADC value and display it on first line of LCD
    wait(50000);
 //Measure Flow
 EINT2 = 0;                      //Set NbTops to 0 ready for calculations
  VICIntEnable |= 1<<16;           //Enables interrupts
  wait(100000);                    //Wait 1 second
  VICIntEnable &= ~(1<<16);           //Disable interrupts
  Flow = ((EINT2 * 60) / 7.5);       //(Pulse frequency x 60) / 7.5Q = flow rate in L/hour 
  }
}

void ExtInt_Serve2(void)__irq 
{    
 EINT2++;    
 EXTINT |= 4;    
 VICVectAddr = 0; 
}

void ExtInt_Init2(void) 
{      
 EXTMODE |= 4;         //Edge sensitive mode on EINT2    
 EXTPOLAR = 0;           //Falling Edge Sensitive    
 PINSEL0 |= 0x80000000; //Enable EINT2 on P0.15    
 VICVectCntl1 = 0x20 | 16; // 16 is index of EINT2    
 VICVectAddr1 = (unsigned int) ExtInt_Serve2;    
// VICIntEnable |= 1<<16;   //Enable EINT2   
} 


Step 4: Testing and Debuging
1. Give power supply to respective sensors from BlueBoard, LPC2148 is +5V Compatible.
2. Flow Sensor is common hall effect type sensor, gives pulses as output
3. Temperature Sensor is LM35
4. Follow us on Google+, Facebook
5. Comment if you find any difficulty.