LapTop BreadBoarding

Analog Breadboarding on a laptop costs almost nothing, 

at least on a MacBook Pro. (Should be better for PCs)


LapTopHow2/firstwave.jpg




Three things make laptop breadboarding convenient.


1)A USB port is designed to provide 5volts at up to 500mA.

2)Sound recording inside PCs is becoming commonplace.  

3)A lot of free software is available online.


These three items together with a little interface development 

can turn a laptop into a full audio bread-board lab  environment. 

Outside of the breadboard, the full interface needed is shown below.   


<< THIS IS NOT A NOVICE PROJECT >>

LapTopHow2/theinterface.jpg


The MacBook provides a line-input stereo audio port 

in addition to its internal microphones. 

It looks like this port can only handle signals 

at the standard audio levels.


USB devices tend to become an open circuit right at the plug interface. 

The wires in this USB plug were wired to the  correct color code. 

The 5V wire was red and the ground  as black. 

Apparently a 100mA load is a unit load for USB. 

A 100 Ohm series resistor was added to the 5V line for safety reasons.


 << THIS IS NOT A NOVICE PROJECT >>


LapTopHow2/jumpers.jpg

If the breadboard looks a little strange, 

it is because some stack-able jumper-leads were made up 

to make hooking up everything much easier. (Optional) 


Outside of the interface, everything else that is needed 

is either already inside a MacBook Pro 

or can be downloaded off the web for free.


One excellent program for a Mac is Macspice. 

This program is completely free and seems to be continually supported.  

A simple simulation of the breadboard will show what should be expected.  


LapTopHow2/macspice.jpg


A simple triangle/square wave oscillator shown below

will be the laptop's first circuit. 

A low supply current RRIO OpAmp was used in the breadboard. 

(In this case a LM6132). 

The output at node "OUT1" will go very close from zero to 5V. 

But since the audio input port for a MacBook 

only accepts audio level inputs, 

R5 and R6 are needed to reduce the signal level. 

Op Amp OPA2 buffers the triangle wave and it needs to be attenuated too. 



FIRST_LAP_TOP_0

*

*  ^  5V

* /_\                      R3

*  |   10k            10k

*  |_/\  /\  /\_____/\  /\  /\_

*   R1 \/  \/   |     \/  \/   |

*               |              |

*          R2   |              |

*   _/\  /\  /\_|INP1 |\       |   100k  R5

*  |   \/  \/   |_____|+\ OUT1 |                 ___

* _|_   10k           |  \_____|___/\  /\  /\___|CH1|

* ///            INN1 |  /   |       \/  \/   | |___|

*      C1   __________|-/    |                |

*         _|_   |     |/ OPA1|           R6   |

*         ___   |            |    _/\  /\  /\_|

*          |    |    R4 10k  |    |  \/  \/

*         _|_   |_/\  /\  /\_|    |    1k

*         ///   |   \/  \/       _|_

*               |                ///

*               |INP2|\

*               |____|+\ OUT2       100k R7      ___

*                    |  \__________/\  /\  /\___|CH2|

*               INN2 |  /     |      \/  \/   | |___|

*                ____|-/      |               |

*               |    |/ OPA2  |          R8   |

*               |             |   _/\  /\  /\_|

*               |_____________|   |  \/  \/

*                                 |    1k

*                                _|_

*                                ///

*

The full simulation code is shown below and yields the following graphs.


VCC     VCC  0    DC 5

R1      VCC  INP1 10K

R2      INP1 0    10K

BOPA1   OUT1 0    v = 2.5*tanh((v(INP1)-v(INN1))*1000) +2.5

R3      INP1 OUT1 10K

R4      INN1 OUT1 10K

R5      OUT1 CH1  100K

R6      CH1  0    1K

C1      INN1 0    .022u IC=1

BOPA2   OUT2 0    v =v(INN1)

R7      OUT2 CH2  100K

R8      CH2  0    1K

.tran   3u   5m   3u  UIC

     

.control 

set    pensize = 2 

run 

plot  v(ch1) v(ch2)

plot  v(ch1) v(ch2) xlimit 2m 2.5m ylimit -50m 50m

.endc 

.end


LapTopHow2/firstsim.jpg


The next great free program is called MacCRO X. 

This is alpha version of a simulated oscilloscope, 

so everything is not perfect. 

But when the breadboard is powered up from the USB port 

and clip leads connect analog signal to the audio input port, 

the behavior of the breadboard can be viewed real time.  


LapTopHow2/maccro.jpg



The present version of MacCRO X allows some adjustments 

in both time and voltage magnitude. 

The trigger feature does not appear to be working well. 

But there is a button to freeze the scope trace.  


LapTopHow2/oscill.jpg




This is a dual trace oscilloscope which is powerful. 


LapTopHow2/xy.jpg


For those of us who believe in trusting nothing, 

now its possible to sanity check real time analog waveforms 

with simulations on the same laptop, all at the same time. 



LapTopHow2/fullwindow.jpg




The present version of MacCRO X appears to neither trigger well 

nor store waveforms in a convenient manner. 

That is where another great free program comes in. 


While there are many programs that can record audio signals, 

Audacity appears to be the best. 


LapTopHow2/audacity.jpg



Having the ability to capture a large amount of dual trace data 

is very powerful when it come to debugging any hardware. 

The dual trace feature makes it much easier 

to hunt down cause and effect relationships.
 

While MacCRO X lacks the triggering power of a oscilloscope,

Audacity can capture and display a large amount of data 

which can then be looked over to find a particular event. 


LapTopHow2/audacityWave.jpg




If one wants to get into things a little deeper, 

Audacity allows trimming of captured signal 

which can be exported to aiff format. 

It appears that the following is the default export setting. 


LapTopHow2/exportfile.jpg


While the aiff format is binary, 

it is not too hard to write a little C++ program on the Mac 

to translate the binary format into text format. 

The compiled Mac translation program is called aiff2txt.
The source is included here.


After exporting a wave shape to .aiff format, 

this file needs to be in the same directory as the aiff2txt program.

Open up a terminal. 

Cd to the directory containing both files 

and type in the program name and audio file name as follows... 

 


don-sauers-macbook-pro:Oscilloscope donsauer$ ./aiff2txt fileName.aiff

fileName.aiff       file size is 910 

ADDR  TYPE          VALUE   

0     IFF_HEADER    FORM 

4     FILE_SIZE     902 

8     TYPE_AIFF     AIFF 

12    COMMON_CHUNK  COMM 

16    CHUNK_SIZE    18 

20    NUMB_CHAN     2 

22    NUMB_FRAM     214 

26    SAMP_SIZE     16 

28    SAMP_RATE     96000 

38    SSND_CHUNK    SSND 

42    CHUNK_SIZE    864 

46    OFFSET        0 

50    BLOCK_SIZE    0 

Output is stored in <converted_aiff.txt> 



The text output is called converted_aiff.txt 

and will contain the following data. 

 


filename = fileName.aiff  

file size = 910 

ADDR  TYPE          VALUE   

0     IFF_HEADER    FORM 

4     FILE_SIZE     902 

8     TYPE_AIFF     AIFF 

12    COMMON_CHUNK  COMM 

16    CHUNK_SIZE    18 

20    NUMB_CHAN     2 

22    NUMB_FRAM     214 

26    SAMP_SIZE     16 

28    SAMP_RATE     96000 

38    SSND_CHUNK    SSND 

42    CHUNK_SIZE    864 

46    OFFSET        0 

50    BLOCK_SIZE    0 

0  -7348  372 

1.04167e-05  -7263  303 

2.08333e-05  -7196  247 

3.125e-05  -7218  187 

4.16667e-05  -7271  117 

5.20833e-05  -7274  41 

6.25e-05  -7230  -32 

7.29167e-05  -7189  -98 

8.33333e-05  -7194  -163 

9.375e-05  -7215  -229 

0.000104167  -7224  -296 

0.000114583  -7201  -357 

0.000125  -7174  -415 

0.000135417  -7169  -475 

0.000145833  -7187  -544 

0.00015625  -7205  -616 

0.000166667  -7193  -683 

0.000177083  -7160  -736 

0.0001875  -7149  -777 

0.000197917  -7171  -819 

0.000208333  -7206  -868 

0.00021875  -7191  -931 

0.000229167  -7134  -1002 

0.000239583  -7095  -1075 

0.00025  -7140  -1140    

...


The Stereo audio output lists time, then channel one, then channel two. 

This format can be copied into a spreadsheet and displayed as so. 

And it could also be translated into a format that can run on spice.



LapTopHow2/spreadsheet.jpg



Given the present state of both the hardware and software 

available on a MacBook Pro, 

it looks like getting some hands-on analog experience 

might be getting much easier in the future. 

On a 17 inch MacBook, 

there is a convenient place to scotch tape the breadboard to the laptop 

where it is stable and out of the way. 

The use of stack-able jumpers 

make hook up far faster and easier compared to a soldering iron. 

It is not obvious things could not get even easier. 


4/8/9 dsauersanjose@aol.com