* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Presentation 2
Flip-flop (electronics) wikipedia , lookup
Stray voltage wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Power inverter wikipedia , lookup
Alternating current wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Voltage optimisation wikipedia , lookup
Variable-frequency drive wikipedia , lookup
Mains electricity wikipedia , lookup
Integrating ADC wikipedia , lookup
Power electronics wikipedia , lookup
Voltage regulator wikipedia , lookup
Analog-to-digital converter wikipedia , lookup
Schmitt trigger wikipedia , lookup
Buck converter wikipedia , lookup
Switched-mode power supply wikipedia , lookup
216.382 Microcontroller Application – Group A Project: Water flow meter Presentation Introduction: Group A’s project is to design a ‘Water Flow Meter’ for a rain water system. The water flow meter is an important aspect of the system as it can be used to monitor the influx of rain water into the system when attached to the input pipe, or ensure faultless supply of the water when attached to the outflow pipe of the system. Design Overview: The design focus for this project was the relationship that DC voltage output is proportional to the speed of rotation of the generator. E= Blv Where: E is the induced e.m.f B is the flux density (T) l is the length of the conductor in the magnetic field (m) v is the velocity (m/s) The varying DC voltage with speed could then be used as the analogue input into the microcontroller and converted into a digital signal to drive a seven segment display. Block Diagram: Analogue Input First Motor Second Motor (Turbine) (DC generator) Filter & Protection Power Supply 10V Group Member: Mantang KE, Dan, Jia Xu MICRO ADC seven segment display µPC78L05J 5V Regulator Page 1 of 7 216.382 Microcontroller Application – Group A Project: Water flow meter Presentation Hardware Design: Lab Tests: The DC Generator Output The picture below shows the DC generator output before any signal conditioning circuitry is added. The oscilloscope shows an inverted full-wave rectified output; note the amount of noise evident in the waveform. Further testing showed the DC content of the waveform increased as the RPM of the generator increased. Group Member: Mantang KE, Dan, Jia Xu Page 2 of 7 216.382 Microcontroller Application – Group A Project: Water flow meter Presentation Analogue Input Circuitry: The actual system uses a turbine as a mechanical transducer, converting the movement of the water into mechanical energy; this in turn drives a small DC generator (DC motor working in reverse). In order to replicate the turbine an additional small DC motor is used to provide the mechanical energy to drive the DC generator. Upon measuring the output of this signal with the oscilloscope, we found that it was necessary to add the following signal conditioning components: 1. Cnoise - 0.01µF noise suppression cap (see microcontroller). 2. D1diode - Back EMF protection diode. This is used in case the turbine suddenly stops due to a foreign object in the water supply, thus causing an instant collapse of the magnetic field of the generator inducing a high voltage reverse polarity spike (V= -L di/dt) potentially damaging the microcontroller. 3. Cfilter - reservoir capacitor. To smooth the full-wave rectified voltage output from the DC generator. This capacitor value was found via experimentation in the lab using range of capacitor values. The 470µF capacitor gave the required smooth DC output voltage. (Xc = 1/2πfC) as capacitance increases capacitor reactance decreases thus filtering the ripple frequency. Also the formulae for voltage in a capacitor V=Q/C, where Q is charge loss, shows as the capacitance increases the voltage reduction decreases. Working voltage of the capacitor should be ≥ 10V 4. D4diode & D5diode - Input protection circuit Protection for the A/D converter and the HC08QY4 microcontroller (a clamp system), consisting of two diodes- it clamps the voltage input range to approximately 0V – 5V. If the analogue input increases to 5.6V the upper diode will conduct clamping the input to the +5Vsupply rail, if the input drops below 0V to -0.6V then the lower diode conducts clamping the input to ground potential. (Note all diodes rated at 7A insures that they will adequately handle any high currents) Group Member: Mantang KE, Dan, Jia Xu Page 3 of 7 216.382 Microcontroller Application – Group A Project: Water flow meter Presentation Schematic Diagram of analogue input Group Member: Mantang KE, Dan, Jia Xu Page 4 of 7 216.382 Microcontroller Application – Group A Project: Water flow meter Presentation HC08QY4 Microcontroller: The conditioned analogue signal of this generator must be measured by the HC08QY4 microcontroller and display it on a 7 segment display. This can be done by using one of the six ADC converter channels and using one of the output ports to drive the display The output pins of the microcontroller are limited to about 20mA sourcing & sinking current (possibly a little more with sinking) 1. Pin 12 is used as the analogue input on the microcontroller as according to the data sheet this pin has a priority for Analogue to Digital conversion. The rest of the functions of this pin will be disabled by the software program i.e. keyboard interrupt etc.(pg 20 of data sheet) 2. According to the datasheet (p46), a 0.01uF capacitor can be used to improve the performance of ADC by reducing noise; it needs to be placed as close as possible to the package pins. Since the microcontroller board is already populated, the cap was placed at the source of the noise i.e. at the DC generator. 3. The analogue input voltage to the microcontroller must lie between VDD and VSS in order to give an accurate conversion; hence the clamping helps insure this (pg 37). The analogue to digital conversion will be done in the 8-bit mode, since we only have a 7 bit output to the display. 4. Port B (B0-B7) will be configured as an output via the DDR data direction register and used to drive the display with B7 used to switch between the two seven segment displays, since B7 is just the decimal place LED. 5. The power supply for the micro is provided by the µPC78L05J 5V regulator; this nominally works of a 10V supply according to its data sheet. It is vital to put a 0.1µF across VDD and VSS pins of the microcontroller (this is provided by the board design already). The following caps and diodes may be required to protect against the power supply used with the project. Group Member: Mantang KE, Dan, Jia Xu Page 5 of 7 216.382 Microcontroller Application – Group A Project: Water flow meter Presentation 6. All unused pins of the microcontroller will be made an input and internally held high by the pull up enable registers, as unused pins must never be connected directly to the supply rail or ground.(pg 20 of data sheet) Group Member: Mantang KE, Dan, Jia Xu Page 6 of 7 216.382 Microcontroller Application – Group A Project: Water flow meter Presentation Display Output: Schematic Diagram Seven segment display output Components Chosen R0 to R6 are all have the same value; they are used to protect the microcontroller output by limiting the output current to less than 20mA. Typically 10mA into each LED branch in the 7-segment display (Internet source) so in this case we will use 10mA. R V 5 1.2 0.2 360 I 0.01 So, Ro, R1, R2, R3, R4, R5 and R6 are 360 ohms. BC327 is a genetic PNP type transistor. It has absolute maximum Ic of 800mA, at saturation Ib=-50mA and Ic=-500mA R V 5 100 I 0.05 So, Rb =100 Ohm. Since total current from 7-segment pass through transistor is 7x10mA=70mA, Rc or the load resistor is not required as the current is limited at the microcontroller end. Group Member: Mantang KE, Dan, Jia Xu Page 7 of 7