Category: Uncategorized

I generated several libraries for Altium (or Circuit Studio) using Database Libraries which I then exported to IntLibs.

I realize you can get many of these parts from Altium or other third parties. I wanted to figure out on my own how I could scrape data from Digi-Key and (almost) automatically create part libraries.

Altium Designer has a powerful feature called Database Libraries which take an external database and link entries to a schematic symbol and physical footprint. The database can take many forms such as an Excel spreadsheet, Microsoft Access database, or in theory any SQL or ODBC source.

I’ll start here by giving you the libraries I generated and I’ll make another post about how I generated them.

There are 6,029 resistors, all are Panasonic ERJ series. The resistors are split up into 6 different IntLibs according to package size: 0201, 0402, 0603, 0805, 1206, 2512. I scraped the data from Digi-Key to create these libraries and thus they contain a significant number of parameters that you can use for your BOM generation.

The capacitor libraries are similar. There are 4,739 capacitors in 6 different libraries split up according to package size: 0201, 0402, 0603, 0805, 1206, 1210. They all contain similar parameters as the resistors. All capacitors are Murata – because it was easier to scrape one manufacturer without getting thousands of duplicate value parts.

I was looking for a way of reading a PT100 temperature sensor with a Raspberry Pi. I couldn’t find an inexpensive way of accomplishing this on a hobbyist budget. And to be honest I like to build things so this was how I did it.

Amazon and eBay are full of things like this now. This is a $10 PT100 temperature sensor. I wouldn’t use this for a commercial application but it works just fine and I personally trust it for my beer brewing application.

It’s a three terminal sensor. A PT100 thermistor is just a resistor that varies with temperature. The resistance goes up when the temperature goes up. For a chart, see the wikipedia page.

There are three ways to hook up a thermistor.

Typically you have somewhat long, thin, wires so the resistance is not negligible.

The resistance of a PT100 varies at about 0.38 ohms per degree celsius, so if your wires measure a total of 0.5 ohms, you’re off by over 1 degree. And the thermal coefficient of copper is significant (3.8 Ohm/Ohm/K) so your wire resistance cannot be linearly calibrated out.

The first way is to use two wires.

R1 and R2 represent the two wires leading to the thermistor.

The thermistor (R3) is sensed by measuring the voltage V = V1 – V2

And you calculate R3 by using Ohm’s law, R = V / I

R2 and R1 can be measured but like I talked about, you can’t just calibrate these.

Nobody does this except when the leads are very short. For example if your thermistor is on the PCB with the ADC.

On to method #2:

Three wire thermistor sensing

The 1mA current flows from the positive supply through the wire (R2) through the thermistor (R3) and through the final wire (R1) before reaching the current sink (I1) (and on to ground)

Here I added another wire represented by R4 and terminated at the node V3.

Almost no current will be flowing in or out of V3 – we’re just using it to measure the voltage on the other side of R1.

We can use this extra wire (V3) to measure the voltage drop across resistor R1 because we also know the voltage V2. The voltage drop across R1 is:

V(R1) = (V3-V2)

which also happens to be the same as the voltage drop across R2. The wires are the same size and length (approximately)

V(R2) ≈ (V3-V2)

Now that we have a third wire (V3) we should use this in place of V2 to measure the thermistor. Consider the value (V1-V3). This eliminates the voltage drop due to R1 but it still has the voltage drop due to the 1mA current flowing through R2. Since we already calculated the voltage drop V(R2) we can simply subtract it, giving the voltage across the thermistor Vtherm:

Vtherm = (V1-V3) - V(R2)
or
Vtherm = (V1-V3)-(V3-V2)

Four wire sensing

Four wire sensing is the easiest but nobody uses it. You need an extra wire.

I added a wire represented by R5 and terminated into node V4 in the above schematic. Measuring the thermistor would be really simple if you have a four wire setup: you just measure V4 and V3 with a voltmeter (or differential ADC). The voltage across the thermistor is (V4-V3).

On to the PCB!

The following board that I’m sharing is free-for-all. It’s not perfect but it worked for me the first time around and I was incredibly surprised. As an engineer you come to expect your designs to be nearly FUBAR on the first try. Actually – I’m being modest; they often work reasonably well. I just stopped being modest. I’m sorry.

Here’s the schematic. Click the image to see a larger view:

This board has two current sinks. Each sinks 1.0mA with a reasonably wide compliance range (TBD).

The current sinks are connected between the EX+ and EX- pins. The ADC inputs are connected across SENSE+ and SENSE-.

The current sink is fixed at 1mA.

The ADC is the Microchip MCP3427. It is a 16 bit I2C converter with an onboard 2.048v reference. It also has a programmable gain amplifier (PGA) that can multiply the analog input by 2, 4, or 8. This allows you to achieve higher dynamic range in the digital domain. The analog inputs are differential so you can measure a differential voltage without adding external op-amps, which is perfect for this application.

Let’s say you want to measure between -50 Celsius and +200 Celsius using a PT100 with a 1 mA current sink. The Wikipedia chart shows that the resistance varies between about 80 and 176 ohms and thus the voltage is 80 mV to 176 mV. Enabling the x8 PGA will multiply these values by 8, giving 640 mV minimum to 1.408 volts maximum.

The voltage is then converted by the 16 bit ADC with 2.048v reference. This gives

0.64 / 2.048 * 2^16 = 20480 LSB for -50 Celsius

and

1.408 / 2.048 * 2^16 = 45056 LSB for +200 Celsius

This is 24576 LSB over 250 degrees, or about 98 LSB per degree. Or (about) 0.01 degrees per bit. This is completely neglecting linearization issues. I’m just showing you the dynamic range of the signal path.

This design is not ideal for three wire PT100 sensors, but it does work just fine if you don’t have long lead wires. You could use the second ADC channel as the wire compensation channel. Just subtract the wire voltage drop from the primary channel reading.

If you don’t care about the static offset due to one of the PT100 sensor wires, you can use this board as a two-channel device. Just hook up the single red wire to both the EX+ and SENSE+ lines and hook up one blue wire to EX- and the other blue wire to SENSE-.

(The colors could be anything, but there will be one of color ‘A’ and two of color ‘B’)

I made the decision to leave the terminals independent so that you can easily attach a different type of sensor to the ADC.

The MMBT5179 is a cheap NPN bipolar junction transistor designed for radio frequency applications. I designed this super simple 1″ square board to test the performance of this transistor.

I personally intend to use this part in the HF range from 10 – 30 MHz. Due to this being a two layer board I was unable to make the trace impedance 50 ohms. The traces would need to be >100 mils wide. However, the traces are extremely short with this being such a small PCB.

As configured, the bias current should be about 11 mA. Intended supply voltage is 5.

Recently at work I was tasked with determining the frequency modulation of a laser beam. I designed and tested the above circuit in a couple hours.

I tested the circuit first with no photodiode in place using my DG8SAQ vector network analyzer — a very low cost network analyzer based on the highly respected (by me) AD9852 DDS chip.

The circuit showed >+20dB gain from about 4 MHz to the cutoff frequency of the RLP-137. Hooray for small victories!

For the photodiode, I had no choice because I just had one laying around here that I could find the part number for: a Melles Griot 13DSI001. This particular part has a responsivity of 0.45 Amps/Watt at 830nm, breakdown voltage of 60, and 10pF capacitance.

A photodiode is typically reverse biased as you see above, with a positive voltage on the cathode. In my case I don’t care very much about what voltage I’m using as long as I do not exceed the breakdown voltage (more about that coming up.)

As light becomes incident on the diode junction, carriers are created that allow current to flow from the high potential to the low potential. This holds true for high frequencies; a high frequency alternating current is allowed through the device.

When a current source is terminated into a resistor we get a voltage source having an impedance of the resistor value. The photodiode is terminated into a 50 ohm resistor, hence we have a fairly decent 50 ohm source that is converting light modulation into RF of a convenient impedance. The maximum frequency (as I understand) is limited by the 10pF intrinsic capacitance of D1, combined with the load resistance, R3. This gives a cutoff frequency of 1/(2*Pi*RC) of about 300 MHz. I may not have needed the lowpass filter (RLP-137), however with my shoddy perf-board construction I was worried about the GALI-74 potentially oscillating in the GHz range.

The 1k resistor R1 is to limit the maximum current that can pass through the photodiode. Combined with C3, this provides filtering from feedback or noise that could come through VCC.

I’d be happy to see your comments below if you have corrections or advice.

I’m writing a Linux device driver for the PCI/PCIe cards 5i25 and 6i25 available from MESA electronics[1]

I’ve never written a device driver before. Currently my driver does nothing except enable the PCI device, map the BAR0 to system address space, and check the “magic value” available in BAR0 + 0x100.

It then prints out all of the probed module descriptors that correspond to available hardware functionality.

The magic value is an arbitrary number to test that your driver is accessing the PCI device correctly.

The next step is to accept module load-time parameters and configure the board as desired. Mesa has made a very capable board with the HOSTMOT2 firmware[4]. It has many options and many configuration registers.

Beyond configuration, the driver will have to accept IOCTL calls from user programs and drive the 6i25.

So you’re on Windows and want to use Dropbox or Google Drive with it’s own drive letter?

Step 1:
First figure out where your Dropbox or Google Drive folder is stored. Go to ‘Computer’ and right click on Dropbox or Google Drive and copy the whole path name that is in the text field labeled Target. Mine happens to be:
“E:\googledrive\Google Drive”

But yours is probably something like:
“C:\Users\Martin\Google Drive”

Make sure you copy the quotes too.

Step 2:
Run notepad and put one line in the new file. Replace the path with the one you found in step 1.

Now, save this file on your Desktop as a file named: drive letter.bat

Close notepad.

Step 3:
Double-click the file you just saved. You should have a new drive called G:
If not, you did something wrong.

I’ve managed to get all 3 axes running. The second picture is the machine drawing a sample picture with a marker.

As you might notice, I have some serious hacks going on in my “design” thus far.

I plan on fixing these issues as I go along. I was so excited to get the machine running that I couldn’t wait to get the proper materials for motor brackets.

It does move on it’s own. The cheapo 3 axis stepper driver I bought from a Chinese vendor on eBay runs from a parallel port interface. I don’t have a working parallel port on my newer desktop PC so I’m using my old Thinkpad T43 which happens to have a parallel port.

The software that comes with the board will probably be useless for pick & place operations, but it is interesting to think of the possibilities that this machine might have for possibly routing parts from delrin. I’m sure it doesn’t have the rigidity to mill any metals.