Let's Make Robots!

Arduino based Logic Analyzer

Samples logic signals to help you debug your stuff

To analyze the pulse train sent from a remote control, a Logic Analyzer (LA) can be very handy. Unfortunately such a beast can be rather expensive as well.

With an Arduino at hand there is a cheap alternative. Turn your Arduino into a 5 channel Logic Analyzer. You will need two pieces of software, a sketch for the Arduino and a Java program for your PC.

The code for the Arduino can be found here: https://github.com/gillham/logic_analyzer Download the ZIP file and open it. It consists of a few files, basically you only need two of them. logic_analyzer.ino is the sketch which goes into the Arduino IDE. The files ols.profile-agla.cfg and ols.profile-aglam.cfg are configurations for the Java program. We will install one of them in a few moments. (just dont delete the zip file yet)

With the sketch in the Arduino IDE go on and upload it to your Arduino. And a successful upload you will be able to test the program. Open the serial monitor and select baud rate 115200. Then send a 1 or a 2. The program should respond with some status txt. This proves that your program is running!

Now you can close the Arduino IDE application if you please, we won't be needing it any longer for this guide. (ok, make a short mental note on which serial port you used to communicate with the Arduino, we will be needing that later on)

Next thing is to install the Java application. Download it from here: http://www.lxtreme.nl/ols/ I simply picked newest zip file and unpacked it on my computer, same on Linux and Windows. No real installation process, just a bunch of files.

Now its the time to configure the OLS application to use an Arduino as it's sampling probe. Remember the two .cfg files that came along with the Arduino sketch. Depending f you got a normal or a mega Arduino you will have to pick the right one not. Guess what, the m-file is for the mega!

I picked the ols.profile-agla.cfg for my Duemilanove and copied it to the plugin directory under the OLS installation. With the configuraton file in place, I had to change two values in there. I set device.open.portdelay = 1500 and device.samples.reverseOrder = true Simply open the file with a texteditor, modify and then save again.

Now you are ready to launch the OLS application. In the installation directory there are two run files, a run.bat for the windows users and a run.sh for the Linux gang. Click on it and it should start the application.

Click Capture -> Begin Capture and configure the Connection tab as I did here. You will have to select the port your Arduino connects to.

Now you are ready to run. Click Capture. Of cause this wont capture anything intresting, we have not connected any signals to the Arduino. I used this small circuit to capture IR signals from an old remote I had laying around.

It feeds raw IR receiption to pin8 and a demodulated IR signal to pin9.

To get something intresting we have to change a bunch of additional parameters in two other tabs when capturing:

Now hit capture again, press a button on your remote, and if you are lucky you will get:

Line 0 shows the raw IR and line 1 the demodulated signal.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

the circuit drawing, can you specify parts for this ?

I really don't remember which specific components I used. It's a long time ago.

Thank you! I've been looking for something like this for awhile now. I'm curious about the settings applied under Triggers thou, what do the values and the checkboxes mean?

First, since the Arduino LSA code only supports 5 channels, only column 4 to 0 is used. The LSA application supports larger system too where you have more channels.

The mask row simply enables the trigger on that pin and the value row defines if a high or low on a enabled pin should fire the trigger.

In the example I show I have put a positive trigger on bit 0 which is on Arduino pin 8. So, the LSA waits until pin8 goes high and then start sampling.

Now the in example the slider at the top shows that I keep 5% of the samples BEFORE the trigger fires. This is often an nifty feature as well.

Thank you! Just what I need to know.

That is cool. Collected.