Gas station without pumps

2014 February 26

Fourteenth day of freshman design seminar

Filed under: freshman design seminar — gasstationwithoutpumps @ 21:39
Tags: ,

Today’s class went fairly well—I started by returning the students’ drafts of their design reports and taking general questions.  Most of the questions were about the format I was expecting for the final report (which is due 3 weeks from tomorrow).

We then broke into groups and and the group tutor and I circulated answering questions.  I had some time with each group.  With the incubator group, which had mentioned using transistors to control power to the heater, I discussed how to use nFETs and how to read some of the critical specifications.

With the centrifuge group, I talked with them about the need to keep the motor case from turning—the torque on the motor is the same as the torque on the rotor.  We also talked about how to measure the rotor speed, and the difficulty of printing large objects with a filament-style 3D printer (I suggested they look into buying a used cooking pot at the thrift store to make the case, rather than trying to 3D print it).

I only talked for a short while with PCR group, mainly about relay-based control vs. FET-based control (relays are simpler to design with, but can only do on/off control, not PWM for proportional control).

The students seemed to pretty excited about their projects, and stayed on topic for the full 70 minutes (80 minutes, actually, since we ran over by 10 minutes before anyone noticed).

Thirteenth day of freshman design seminar

Filed under: freshman design seminar — gasstationwithoutpumps @ 00:49
Tags: ,

I collected two of the three project report drafts on Monday (the other was turned in late, and I haven’t had a chance to pick it up yet).  The reports are looking better than the initial proposals—the groups are beginning to flesh out their initially vague ideas with some details (like calculating how much power is needed to heat the block in the PCR machine).  They have 3 weeks until their final report is due, so I expect that the drafts will continue to improve.  Of course, it is possible that the rate of improvement may be more or less than my expectations (more and their grades go up, less and their grades go down).

On Monday, we tried developing the control algorithm needed for thermal control for the incubator project and the PCR machine.  Because of the amounts of power needed, and the lack of electronics sophistication in the class, I recommended using a relay rather than transistor switches.  This limits them to on-off control, rather than proportional control or PWM control, but even developing the program for simple on-off control took us most of the hour—the idea of programming and the level of detail needed to communicate the idea to computers is still very new to them.

On Wednesday, I expect to break into groups, and the group tutor and I will visit each group trying to answer questions and help them work out the next steps in their design and try to figure out how to get some prototyping done.  Even a cardboard mockup would help them work out some of the problems.

Colorimeter design—almost working

Filed under: freshman design seminar — gasstationwithoutpumps @ 00:34
Tags: , , , ,

Since my freshman design students did not show much interest in designing their own colorimeters, and my son has just gotten to the colorimetry labs in his online AP chemistry class, I decided to prototype my own colorimeter design.  (His AP lab relies on eyeballing the light through two columns of fluid and adjusting the length of the light path through one until the intensities seem to match—that’s a very low tech approach, but it seems rather tedious.)

I had made a prototype colorimeter out of black foamcore,which I mentioned in Seventh day of freshman design seminar. I’d meant to blog about it earlier, but I got a bad virus infection of some sort and was out of action for a while.  The prototype I’d made earlier was not very functional—it fit the cuvette tightly, but did not provide an easy way to remove the cuvette from the colorimeter.  I went through two more prototypes today that would allow me to remove the cuvette, but they looked like they would have bad light leaks.  I finally settled on a 4th design, that uses a separate lid, rather than trying to make a hinged lid.  I’ve included a PDF file that has the design for this version: Colorimeter-draft4.

I constructed the colorimeter by spray-gluing the pattern I made to the black foam core, then carefully cutting it out with a razor knife.  The dashed lines are cut only through the top layer of paper and part way through the foam—bending the foam core then snaps the rest of the foam and leaves the paper on the back as a hinge.  I used black electrical tape to hold the colorimeter together, and to block light from coming through the backs of the phototransistor and the LED.

Top view of the colorimeter with the lid in place.

Top view of the colorimeter with the lid in place.

Top view of the colorimeter with the lid off and the wings open to allow grasping the sides of the cuvette.

Top view of the colorimeter with the lid off and the wings open to allow grasping the sides of the cuvette.

I connected the LED through a current-limiting resistor to the 3.3v supply on the Freedom KL25Z board, and the phototransistor with a current-to-voltage resistor to E22. I actually ended up doing two different circuits, using different LEDs:

    I started with the circuit on the left, using a deep red LED that has a peak wavelength of 700nm. Later I switched to a different LED, with a peak wavelength of 627nm. In both cases, I picked the current-to-voltage resistor so that I got near full-scale readings on a blank cuvette.

I started with the circuit on the left, using a deep red LED that has a peak wavelength of 700nm. Later I switched to a different LED, with a peak wavelength of 627nm. In both cases, I picked the current-to-voltage resistor so that I got near full-scale readings on a blank cuvette.

When the KL25Z is reset, the analog-to-digital measurement on E20 is recorded as the intensity for the blank cuvette.  Then the transmittance (measurement/blank) and absorbance (–log10(transmittance)) are reported 10 times a second on the USB serial line.

With the 700nm LED, I could measure from A=0 to A=1.8 (with an opaque piece of foam core blocking the light). Light leakage around the cuvette and from the outside prevented me from measuring higher absorbancy.

The first thing we tried measuring was a solution of blue food coloring (blue dye #1). My son made a stock solution of 1 drop in 10 ml, and we measured the absorbance (with the 700nm LED) at about 0.0028, which seemed rather low to us. He then made a very concentrated solution with 5 drops in 5ml, which looked almost black to us, and the colorimeter reported it as having an absorbance of 0.157, which seemed absurd—that’s almost clear! We tried looking at the sky through the solution and noticed that the sky looked deep red through the blue. This lead me to suspect that the dye was transparent in the near IR where much of the light from the LED was concentrated.

When I switched to a 627nm LED, I had to use a larger current-to-voltage conversion resistor, as the phototransistor is less sensitive to those wavelengths. This meant that the noise level from light level was increased, and so an opaque object read as absorbance around 1. The stock solution read as 1, as did a 2-fold and 4-fold dilution. We went to a 40-fold dilution (so equivalent to 1 drop in 40ml) and got a reading of 0.637. From there, we started 2-fold dilutions:

dilution Absorbance at 627nm
1/40 0.637
1/80 0.407
1/160 0.230
1/320 0.139
1/640 0.0679
water 0.0040
1/1280 0.0380

I was worried that cuvette was stained by the dye, but putting in distilled water after the 1/640 dilution showed that any residual staining could only be contributing a small error.

Here is a plot of one run of the colorimeter:

The colorimeter is reset with a blank cuvette (filled with distilled water).  After a few seconds the blank is removed and the test cuvette is inserted.  After waiting about 20 seconds, it is removed and the blank re-inserted.  The absorbance is fit on the flat part in the middle.  Note that the colorimeter did not return exactly to 0 on this run.

The colorimeter is reset with a blank cuvette (filled with distilled water). After a few seconds the blank is removed and the test cuvette is inserted. After waiting about 20 seconds, it is removed and the blank re-inserted. The absorbance is fit on the flat part in the middle. Note that the colorimeter did not return exactly to 0 on this run.

The data from the run did not fit the straight line of Beer's Law.  It did fit a power-law curve, but the exponent is too low.

The data from the run did not fit the straight line of Beer’s Law. It did fit a power-law curve, but the exponent is too low.

I’m now trying to figure out why we did not get a good fit for Beer’s Law. Here are some possibilities:

  • The dilutions were not done accurately.  That would explain random fluctuations, but seems unlikely to give such a clean, consistent deviation from theory.
  • Beer’s Law doesn’t apply to this example.  That seems really, really unlikely, since this is the canonical experiment done by 1000s of students a year.
  • The colorimeter is not linear.  I’m relying on the phototransistor providing a current proportional to light intensity, even though the voltage across the phototransistor varies.  I think that this is likely to be the problem.  To check it, we’d have to redo the experiment with a different circuit—probably a transimpedance amplifier to do the current-to-voltage conversion.

Unfortunately, my son did not keep all the serial dilutions, so to test a different colorimeter circuit I’d have to make a new series.  I might do that this weekend if I have time.  At least I know what stock concentration to start with—about one drop of food color in 25ml of distilled water.

I’m also interested in trying the colorimeter design with an RGB LED, so that we could try different wavelengths—perhaps doing a Beer’s Law test with yellow food coloring.

2014 February 23

Soldering headers on a Freedom board

Filed under: Circuits course — gasstationwithoutpumps @ 16:14
Tags: , , ,

Because I decided to switch to the Freedom KL25Z boards this year for the circuits class, rather than Arduino boards, I have a bit of a scheduling problem.  The KL25Z boards come without headers, but the students can’t do much with them until headers have been soldered on. That means that I need to teach the students to solder on the first day of lab, rather than halfway through the course.

Because students will need instruction, I’ve tried to put together a tutorial on soldering specifically for this purpose.  Because I don’t have a KL25Z board without headers, but do have a KL26Z board (which uses identical headers), I’ve taken pictures of soldering on the headers.

There are 4 female headers to assemble—here they are shown next to the holes they need to go through.  The headers themselves should go on the component side of the board.

There are 4 female headers to assemble—here they are shown next to the holes they need to go through. The headers themselves should go on the component side of the board.

Place the headers in the holes and flip the board over onto the bench.  Sometimes it is easier to put the headers pins-up on the bench and put the board down over them.  Make sure that all the headers are flat on the bench and that the board is level on the headers.  Using 2×n headers (rather than 1×n as the Arduino boards use) makes aligning the headers easy. Make sure that the board has the feet up, so that the headers are soldered on the correct side of the board.

Place the headers in the holes and flip the board over onto the bench. Sometimes it is easier to put the headers pins-up on the bench and put the board down over them.
Make sure that all the headers are flat on the bench and that the board is level on the headers. Using 2×n headers (rather than 1×n as the Arduino boards use) makes aligning the headers easy.
Make sure that the board has the feet up, so that the headers are soldered on the correct side of the board.

To solder a pin to the board, touch both the pin and the copper ring around the hole with the soldering iron for about 3 seconds to heat both.

To solder a pin to the board, touch both the pin and the copper ring around the hole with the soldering iron for about 3 seconds to heat both.

The touch the solder to the pin and the soldering iron and hold it there until the solder melts and flows onto the pin. Remove the solder but leave the iron in contact with the pin for another second.

The touch the solder to the pin and the soldering iron and hold it there until the solder melts and flows onto the pin. Remove the solder but leave the iron in contact with the pin for another second.

I find it best to tack down each of the headers by soldering one or two pins first, so that I don’t have to worry about the headers shifting around as I solder.

After every few solder points, it is a good idea to wipe off the tip of the iron on a wet sponge, to keep the tip clean. Otherwise burnt residue of the rosin flux builds up on the iron and makes good thermal contact difficult.

I should also warn the students not to touch the rubber feet with the soldering iron. Arranging the board so that the long edge is closest to the hand holding the soldering iron (rather than the short edge as shown here) probably makes this easier. Rotating the board to solder the other side, rather than reaching across, is also a good idea.

We will be using tin-lead solder (since it is easier to work with than lead-free solders), but the lead is not a serious hazard.  A bigger problem is the smoke from heating the rosin-core flux, as the electronics lab is not as well ventilated as it should be.  I can warn the students not to breathe the smoke, and to take a 5-minute break in another room after soldering.  If we were doing a lot of soldering, we’d have to get some fans with filter units to remove the smoke from the work area.

One common problem is a "solder bridge" where too much solder was applied and two adjacent pins are shorted.  Solder bridges can be fixed in two ways: 1) sometimes just reheating the solder with the iron will cause it to reflow onto the two pads separately. 2) If there is too much solder for reflow to fix the problem, the solder can be melted with the soldering iron and sucked away with a "solder sucker", or wicked away through capillary action with "solder wick".

One common problem is a “solder bridge” where too much solder was applied and two adjacent pins are shorted.
Solder bridges can be fixed in two ways:
1) sometimes just reheating the solder with the iron will cause it to reflow onto the two pads separately.
2) If there is too much solder for reflow to fix the problem, the solder can be melted with the soldering iron and sucked away with a “solder sucker”, or wicked away through capillary action with “solder wick”.

Sometimes there is not enough solder, and bare copper or voids can be seen.  In that case, reheat the pin, and add a tiny bit more solder.

Sometimes there is not enough solder, and bare copper or voids can be seen. In that case, reheat the pin, and add a tiny bit more solder.

Pin 1 (the rightmost pin in the top row) shows another soldering flaw—there is enough solder, but it hasn't flowed onto the pad completely.  Such "cold-solder" joints can be fixed by reheating the pin and pad, without adding more solder. Some of the other pins in this picture also show cold-solder joints, though less severely.  Whenever bare copper appears on the pad, the joint needs to be reheated.  (See pin 14 to the right of pin 16, for example.)

Pin 1 (the rightmost pin in the top row) shows another soldering flaw—there is enough solder, but it hasn’t flowed onto the pad completely. Such “cold-solder” joints can be fixed by reheating the pin and pad, without adding more solder.
Some of the other pins in this picture also show cold-solder joints, though less severely. Whenever bare copper appears on the pad, the joint needs to be reheated. (See pin 14 to the right of pin 16, for example.)

I’m a little worried about students’ first soldering projects being with a $13 KL25Z board, rather than the 50¢ hysteresis-oscillator board, and needing 64 solder points, rather than 42, but I think that they can handle it. The ease of putting the board face down on the headers and tacking them all down (compared to inserting varying size and shape headers, capacitors, DIP, and resistor on the hysteresis-oscillator board) may make the KL25Z a better choice as a first solder project.

2014 February 22

Diode-connected nFET characteristics

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 19:20
Tags: , , , ,
Test circuit for determining I-vs-V curves for a diode-connected nFET.  The shunt resistor R2 was chosen from 0.5Ω to 680kΩ, and R3 was selected to keep E23 above 0 (0.5Ω to 150Ω).

Test circuit for determining I-vs-V curves for a diode-connected nFET. The shunt resistor R2 was chosen from 0.5Ω to 680kΩ, and R3 was selected to keep E23 above 0 (0.5Ω to 150Ω).

In More mess in the the FET modeling lab, I showed I-vs-V plots for NTD5867NL nFETs, both with a fixed power supply and load resistor, and diode connected (Vgs=Vds).  But this year, the NTD5867NL FETs were not available from Digikey, so we are getting AOI518 nFETs instead.  I decided to try characterizing these with the KL25Z board.  If I power the test off the KL25Z board’s 3.3v supply, I can take fairly high currents, as the board uses a NCP1117ST33T3G LDO regulator, which can the spec sheet claims can deliver up to 1A (800mA, if we limit the dropout to 1.2v). I’m only limited by the USB current limit (500mA), to keep the laptop from shutting off the USB port.

I used essentially the same circuit for testing a diode-connected AOI518 nFET as I used for testing the Schottky diodes, but I did not put a capacitor across the FET.  (Well, initially I left the 4.7µF capacitor there, but I was noticing changing values that looked like RC charging when I was testing at small currents, so I removed the capacitor.)

Because the 3.3v supply droops if too much current is taken from it, I used the internal 1V bandgap reference to determine the scaling of the analog-to-digital converter on each reading.  The voltage VDS is (E20-E21)/(BANDGAP), and the current IDS is (E22-E23)/(R2*BANDGAP).

Voltage vs current for diode-connected nFET. The model that fits the data (above 1µA) is that of subthreshold conduction, even when the current is over 100mA. (click to embiggen)

Voltage vs current for diode-connected nFET. The model that fits the data (above 1µA) is that of subthreshold conduction, even when the current is over 100mA. (click to embiggen)

I get a very good fit to the data (above 1µA) with the subthreshold conduction model (essentially the same as a junction diode, but using n VT instead of VT, where n is determined by the size and shape of the FET).  The value of n for this FET seems to be around 830mV/26mV = 32. The circuit models I’ve seen on the web seem to claim that I should be using a saturation-current model for a diode-connected FET, but that model doesn’t fit the data at all.

There is a very clear thermal shift in the curve for the high-current tests.  As the transistor warms up the current increases for a given voltage.  This is equivalent to the threshold voltage Vthr dropping with temperature.  This is consistent with the data sheet, which shows a lower threshold voltage but higher on-resistance (at 10A) at 125° C than at 25° C.

I’m not seeing any evidence of the weird negative resistance that I saw on the NTD5867NL nFETs. (I tried checking the NTD5867NL nFET with the same testing setup as for the AOI518, and it definitely still shows weird behavior between 10 and 30 mA.)

Because large nFETs are often used to switch inductive loads (motors, loudspeakers, inductors in switching regulators, …), they incorporate a “flyback” diode in the FET.  Normally, this diode is back-biased and does not conduct, but if an inductive load needs a current and there are no transistors that are on to provide the current, the diode conducts and keeps the output voltage from going too far below ground.

nMOS and pMOS transistors with flyback diodes.  If both transistors are off, but the inductor L1 still wants current, it has to come through one of the flyback diodes D1 or D2.  They keep the output voltage from going too far outside the rails.

nMOS and pMOS transistors with flyback diodes. If both transistors are off, but the inductor L1 still wants current, it has to come through one of the flyback diodes D1 or D2. They keep the output voltage from going too far outside the rails.

I characterized the flyback diode on the AOI518 nFET the same way as before, now connecting the gate and the source to the higher voltage, and the drain to the lower voltage.

Below about 0.66 V, the flyback diode has a fairly normal exponential current with voltage, but above that it seems to have a linear relationship between current and voltage, with a dynamic resistance of about 128mΩ. click to embiggen

Below about 0.66 V, the flyback diode has a fairly normal exponential current with voltage, but above that it seems to have a linear relationship between current and voltage, with a dynamic resistance of about 180mΩ.
click to embiggen

The red points with the 0.5Ω shunt go up to an amp, which warms the FET enough to change its characteristics—the lower set of points are the warmer set.

I can also use the measurements of the flyback diode with the ½Ω shunt to characterize the LDO voltage regulator on the Freedom KL25Z board:

For currents up to 400mA, the LDO voltage regulator behaves like a 3.332 V source in series with a 55mΩ resistor.  click to embiggen

For currents up to 400mA, the LDO voltage regulator behaves like a 3.332 V source in series with a 55mΩ resistor.
click to embiggen

The data sheet claims that there should only be a 10mV drop in voltage for an 800mA current, and I’m seeing a 290mV drop.  The extra drop is not from the LDO misbehaving, but from the USB voltage dropping—one is only supposed to take up to 500mA from a USB supply and the MacBook Pro apparently has a soft knee at 500mA, rather than an abrupt shutoff.  I suspect that if I took the full amp for very long, the laptop would shut down the USB port, as it does if the USB 5V is accidentally shorted.

Next Page »

Create a free website or blog at WordPress.com.

%d bloggers like this: