Fortunately there are lots of schematics and discussions around. MIDI is simply serial communication at a baud rate so the Arduino should be able to read it using a serial Rx pin. The MIDI standard requires the devices to be electrically isolated so an optocoupler is usually used on the receiving end. An often quoted resource is this post to the Arduino forum. The hand-drawn schematic is pretty charming and it makes it all seem easy enough.
|Published (Last):||28 July 2014|
|PDF File Size:||20.74 Mb|
|ePub File Size:||8.94 Mb|
|Price:||Free* [*Free Regsitration Required]|
Diodes, Transistors and Optocouplers: what they are, some theory and simple usages examples with Arduino Last updated on Sun, Originally submitted by fabio on Diodes: driving current only in one way Well, the title says it all. A diode is a two terminals electronic component that conducts electric current only in one direction. Thus, the diode can be thought of as an electronic version of a check valve.
This unidirectional behavior is called rectification, and is used to convert alternating current to direct current, and to extract modulation from radio signals in radio receivers. A simple Arduino based circuit using a diode We can build this simple circuit to show how diodes works: Once assembled on the Arduino board, the circuit will looks like: What does this circuit do? Well, nothing complex or useful actually. But we can understand how diodes works with it.
Cool, uh? You can see a demo in the video below. Transistors A transistor is a semiconductor device which can be used to amplify or switch electronic signals.
In the simple Arduino based circuits transistors are usually used as switch for electronic signals. Transistors usually have 3 connectors called collector, base and emitter. In normal state the collector and emitter are disconnected but, when a current is applied to the base connector, the transistor change its state and the collector and emitter get connected thus current can flows between them. This behaviour make the transistor the perfect component for interface two different circuits operating at different voltages.
For example one circuit could be the one powered by Arduino: small current and low voltages. The other circuit could be the one operating a DC motor which needs a lot of voltage and current.
Connecting the two circuits could be painful but with the transistor we could drive the second circuit by changing the state of the transistor trough the first circuit connected to the Arduino. Cool stuff. They differs from the building technique which results in different specifics.
For all the details have a look at the detailed specifics linked above but they mostly work the same way: they only differ in the amount of current they are capable of deliver.
For bigger currents eg powering motors the MOS Irf will be perfect. The BC is not capable of delivering lot of current so use it with care. A simple Arduino based circuit using transistors We will use a transistor controlled by the Arduino board to act as a switch on an external circuit.
The transitor base will be connected to an Arduino output pin. This is the circuit: Once plugged into the Arduino board it will looks like: Note that the circuit coming from Vin 9V is actually completely separated from the one coming from the Arduino board. They are two indipendent circuit. Only the transistor let them interact. We will now use the Hello World program with a simple modification: we will use pin 2 as output in the helloworld program we used pin To get the code refer to the Hello World blog post.
What does the circuit we created do? As you can see each time the output on pin 2 is HIGH our transistor will get a voltage on its base connector resulting in the collector and the emittor getting connected. A similar result could have been achieved using the MOS Irf transistor.
Basically, the circuit explained above only works reliably when the microcontroller actively drives the pin high or low. Optocouplers An optocoupler, also called opto-isolator, optical isolator, optical coupling device, photocoupler, or photoMOS, is an electronic device that usually contains both an infrared light-emitting diode LED and a photodetector and use them to transfer an electronic signal between element of circuits maintaining them electrically isolated.
When a voltage is applied to the LED, the LED lights and illuminate the photodetector which produces an output current on the photodetector: basically this means that now the photodetector circuit is now connected and current can flow in it.
This little component has 6 legs each of them having a different usage. We then have leg 4, 5, 6 respecly emitter, collector and base. We already know these terms from the transistor introduction above.
They do exactly the same of the legs of a transistor. The difference here is that we can leave the base unconnected and just use the LED legs 1 and 2 to connect the collector and the base. Here it is: The circuit above once created using the Arduino board will looks like: We can use the same program used for the transistor example above. So, it basically do the same of the transistor example above but this time we are using an optocoupler. Not bad, uh? Conclusions Now, I know how to use three new electronic components: diodes, transistors and optocouplers.
The simple circuits I built will be used as base for more complex stuff. Looking forward to it!
4N32M: 6-Pin DIP General Purpose Photodarlington Optocoupler
Diodes, Transistors and Optocouplers: what they are, some theory and simple usages examples with Arduino Last updated on Sun, Originally submitted by fabio on Diodes: driving current only in one way Well, the title says it all. A diode is a two terminals electronic component that conducts electric current only in one direction. Thus, the diode can be thought of as an electronic version of a check valve. This unidirectional behavior is called rectification, and is used to convert alternating current to direct current, and to extract modulation from radio signals in radio receivers.
Subscribe to RSS
4N32M: 6-Pin DIP General Purpose Photodarlington Optocoupler