Showing posts with label Controller. Show all posts
Showing posts with label Controller. Show all posts

4/28/2013

Microcontroller Advanced Kit - MIDI Controller 6N137



This project shows you how the hardware of a MIDI interface works and goes through some simple examples to show how the controller can be used in MIDI systems. First we will start by explaining the details of the hardware interface. Then we will look at the MIDI protocol and see how simple it is to write custom software for this MIDI controller.

There are only a couple parts needed to build the MIDI connections. A few resistors, a diode, and a small 8 pin IC and that is it. The controller part of the system is a 2051 microcontroller (a 20 pin version of the popular 8051). The MIDI interface connects to the serial port of the 2051 (pins 2 and 3). The 2051 also has a reset circuit (the 10 uF capacitor and the 8.2k resistor) and an oscillator circuit (the 24 MHz crystal and the two 33 pF capacitors). For more information on the 2051, The only thing not shown is the 5 volt power supply that creates Vcc (5 Volts DC) for the circuit. An LM7805 and 220 uF capacitor is included with the kit to create 5 Volts DC from a 9 to 12 Volt DC source.


The 6N137 isolates one electrical system from another. There is no electrical connection between devices connected by MIDI. When a current flows through the internal LED connected between pins 2 and 3, the LED transmits light to a light detecting diode. The diode is activated and the Output at pin 6 is pulled low by the internal transistor. If no current flows then the Output floats. Rather than let it float, we connect an 8.2k resistor to pin 6 to lightly pull the voltage at the Output to 5 Volts when the circuit in not active.


The microcontroller sends signals through the MIDI port by controlling the voltage at its pin 3. The current is provided by the 5 volts (Vcc) connected to pin 4 of the MIDI Out port. When the MIDI Out port is connected to a MIDI In port of another system the following circuit is created.




AD8016ARB TMS320F2812PGFA     PCF8584T  SN75176BP PCM1801U
PCI9080-3 MAX211ECAI MAX708CSA MAX1922ESA LM339D
MAX3185CWP LM2903N  MC34119P IR2110       LM2575T-5.0
IR2153       MAX1617MEE        MAX813LCSA MAX797CSE LM358D







4/12/2013

Pump Controller For Solar Hot Water System LM335Z




This circuit optimises the operation of a solar hot water system. When the water in the solar collector is hotter than the storage tank, the pump runs. The circuit comprises two LM335Z temperature sensors, a comparator and Mosfet. Sensor 1 connects to the solar collector panel while Sensor 2 connects to the hot water panel. Each sensor includes a trimpot to allow adjustment of the output level. In practice, VR1 and VR2 are adjusted so that both Sensor 1 and Sensor 2 have the same output voltage when they are at the same temperature. The Sensor outputs are monitored using comparator IC1.

When Sensor 1 produces a higher voltage than Sensor 2, which means that sensor 1 is at a higher temperature, pin 1 of IC1 goes high and drives the gate of Mosfet Q1. This in turn drives the pump motor. IC1 includes hysteresis so that the output does not oscillate when both sensors are producing a similar voltage. Hysteresis comprises the 1MO feedback resistor between output pin 1 and non-inverting input pin 3 and the input 1kO resistor. This provides a nominal 12mV hysteresis so that voltage at Sensor 1 or Sensor 2 must differ by 12mV for changes in the comparator output to occur.

Since the outputs of Sensor 1 and Sensor 2 change by about 10mV/°C, we could say that there is a degree of hysteresis in the comparator. Note that IC1 is a dual comparator with the second unit unused. Its inputs are tied to ground and pin 2 of IC1 respectively. This sets the pin 7 output high. Since the output is an open collector, it will be at a high impedance. Mosfet Q1 is rated at 60A and 60V and is suitable for driving inductive loads due to its avalanche suppression capability. This clamps any inductively induced voltages exceeding the voltage rating of the Mosfet.

The sensors are adjusted initially with both measuring the same temperature. This can be done at room temperature; adjust the trimpots so that the voltage between ground and the positive terminal reads the same for both sensors. If you wish, the sensors can be set to 10mV/°C change with the output referred to the Kelvin scale which is 273K at 0°C. So at 25°C, the sensor output should be set to (273 + 25 = 298) x 10mV or 2.98V.



Note:

The sensors will produce incorrect outputs if their leads are exposed to moisture and they should be protected with some neutral cure silicone sealant. The sensors can be mounted by clamping them directly to the outside surface of the solar collector and on an uninsulated section of the storage tank. The thermostat housing is usually a good position on the storage tank.


LM335Z circuit