The Analog Devices AD1888 sound chip has the ability to sample DC voltages. Experimentally it has been found out that the range is fairly linear, however the range that it can sample is restricted to 0.3V - 1.9V, with all the internal gains turned to the minimum.
The XO hardware has been designed to facilitate measurement of DC voltages by the addition of an electronic switch that can be controlled via a setting on the Alsamixer called 'Analog Input' . The high-pass filter can also be turned on/off by a setting 'High Pass Filter' in Alsamixer. The ability to control V_REFOUT (bias voltage) is also available and is done by the control 'V_REFOUT' in Alsamixer.
All the above settings are being handled in the activity by using an os.system("amixer <control name> <mute/unmute>")
* WARNING: ELECTRICITY CAN KILL. RISK OF ELECTROCUTION: DO NOT, UNDER ANY CIRCUMSTANCES, APPLY AC LINE VOLTAGES FROM A WALL OUTLET OR MOTOR-GENERATOR OR OTHER POWER SUPPLY (E.G. CONVERTER OR INVERTER) INTO THE MICROPHONE INPUT, THE SPEAKER OUTPUT, OR ANY USB PORT.
- There is a risk of electric shock resulting in death if the XO is used to measure mains voltage by direct connection. The audio input components are not designed for this. Dangerous voltages applied to the audio input may also be emitted on audio output, USB connectors, or the DC power input jack.
* CAUTION: RISK OF EQUIPMENT DAMAGE. DO NOT, UNDER ANY CIRCUMSTANCES, EXCEED THE INPUT AND OUTPUT SPECIFICATIONS; DAMAGE OR DESTRUCTION OF THE EQUIPMENT WILL RESULT
- * -0.5 to +5.0 volts ABSOLUTE MAXIMUM input voltage.
- * DO NOT REVERSE VOLTAGE: EVEN 1.5 volt BATTERY VOLTAGE IMPROPERLY APPLIED MAY DAMAGE LAPTOP
- * The extent of the damage is not easily predictable.
* CAUTION: RISK OF EQUIPMENT DAMAGE AND/OR DEGRADED EQUIPMENT PERFORMANCE. DO NOT EXCEED THE OUTPUT-CURRENT SPECIFICATIONS OF THE USB PORTS. The extent of the damage is not easily predictable.
The following specifications are based on terminal measurements of a G1G1 laptop and examination of the AD1888's specification sheet. Please correct them where necessary:
Specifications: Microphone input (red, standard audio jack):
- Monaural only: 3.5mm (1/8 inch) audio jack input (Note 0) (white jack of a stereo splitter)
- Insertion of the audio jack routes external input to the A-to-D converter and disables the OLPC's speakers
- Red jack of stereo splitter is open-circuited (i.e. not connected) [??]
- Absolute maximum input voltages: -0.5 volts, +5.0 volts (CAUTION: Exceeding these voltages will damage the laptop. See Note 1)
- Input impedance with BIAS OFF: approx 1100 ohms (Note 2)
- Input-DC offset voltage: (Note 3) +1.178 +/- ?? volts
- Range of DC amplification: TBD
- Range of AC amplification: TBD
Note 0: A solderable connector is the Radio Shack 274-286 "Mono 1/8" Phone Plug" with solder terminals and screw-on housing. A possible stereo connector is the similar Radio Shack 274-284 1/" Stereo Phone Plug" with solder terminals and screw-on housing. Only 1 of the two input-terminals of the stereo connector is available for input. The cost of the Radio Shack Mono plug is $2.99 US for quantity two plugs; cost of the Stereo plug is $3.99 US for quantity two plugs (neither are gold-plated). Other sources for resistors, wire, solder, naked USB and audio jack-connectors, "ball clips" (probes) etc can be found at www.mouser.com and www.digikey.com. Quantity pricing (e.g. Kobiconn plugs, 3.5mm MONO Mouser Part Number 171-PA-3191-1-E) is much reduced compared to the Radio Shack pricing (e.g. $0.71 USD single unit, $0.45 USD at quantity 100).
- Use insulated wire. To reduce electrical noise twist the attached wires approximately 1 twist per inch (1 twist per 2.5 cm).
Note 1: Measured between the center conductor and the shield (ground, i.e. +0 volts). When an input voltage is greater than +5.0 volts or less than -0.5 volts the input-protection circuitry draws currents greater than 100 milliamperes and will damage the laptop. Also, the AD1888 codec's absolute maximum voltage (given a 5.0 volts supply) is -0.3 volts to +6.3 volts.
- You must use input protection resistors and voltage divider if voltages greater than +5 volts will be applied. Resistors and a fast-blow fuse are recommended. Resistors should be present in both the ground circuit and the signal circuit, and this may introduce noise. A better circuit is a high-impedance differential-input amplifier. Recommended circuit TBD: see Note 3.
Note 2: With BIAS ON, measurements indicate a back-bias of +0.785 volts exists at the input. With BIAS OFF +0.020 volts (20mv) is present at the input. The BIAS voltage's effective source impedance seems to be approx 790 ohms. Any circuit that is to drive into the input (see Note 3) should do so with the BIAS OFF and have low-enough source impedance to sink and source into the 1100 ohm input adequately.
Note 3: This is the DC injection-voltage necessary to move the trace from the botton to into the center screen.
- A recommended protection circuit would be a differential amplifier (e.g. a single-operational-amplifier circuit that uses one half of an LM224 amplifier can process ground +0 volts as a possible input. Reversals of 1.5 volt cell battery voltages etc can then displayed. With a proper design ( e.g. a potentiometer-adjustable input-offset derived from a +1.25 volt bandgap reference and the second operational amplifier configured as a 2:1 amplifier) the input between the differential amplifier's inputs would match the AD1888's input range of +0 volts to +2.83 volts (2.83 volts peak-to-peak). +5 volts can be derived from the nearby USB port as described below. A naked USB connector-plug can be found at www.mouser.com (stock number 154-UAW16-E) at $0.68 USD. USB connectors with wires attached ("pigtails", "blunt end") can also be found at Mouser, Digikey, etc. for about $1.50 to $2.00 USD.
USB 2.0 plug mechanical and electrical details
+5 volt power can be taken from a USB port (1.0 amp maximum). The following shows how to build an adapter rather than to cut up a USB cord -- the cordage is expensive and, with a braid and shield -- difficult to work. Other manufacturers besides Kobiconn offer "naked" USB plugs -- e.g. consult the websites at suppliers www.mouser.com and www.digi-key.com.
This assembly will require a very fine-tip soldering iron and small-diameter solder, and some finesse. Be sure that little strands of wire do not "escape" and touch the other terminals.