Gas station without pumps

2022 October 27

LED board schematic

Filed under: Uncategorized — gasstationwithoutpumps @ 12:40
Tags: , , ,

I did a series of posts about the LED boards that I designed for lighting and strobes (starting with Summer project in 2014), but I just realized in going over the posts that I never posted the schematic nor explained how the board worked. I had to dig out the Eagle files on my old laptop to find the schematic, then redo it in Scheme-It to make it look reasonable.

Schematic for the LED board. This design is version 8, and is the one I actually had made.

The resistor R1 is a current-sensing resistor, measuring the current through the nFET Q2 and the LED. When the current is high enough, the voltage on the base of Q1 becomes large enough to turn on the NPN transistor Q1, lowering the gate voltage on Q2 and starting to turn the nFET off.  When the current is low, Q1 is off and the resistor R2 pulls the gate voltage for Q2 up, turning on the nFET more strongly. The Schottky diode D1 is just there to protect the LED from large reverse voltages if the board is hooked up backwards.

Power is dissipated in 4 places: the LED itself, Q2, R1, and D1. Based on the measurements in LED board I-vs-V curve,  the current is limited to about 118mA, so the voltage on the base is about 0.555 V when Q1 starts to turn on and R1 dissipates about 65mW. There is some current going through R2 and Q1 that doesn’t go through the LED (probably about 1–2mA), depending on the voltage applied to the whole board, but it is only about 1% of the total current, so I’ll ignore it—we may have another 30mW dissipated in R2.

I probably should measure the voltages across R1, on the base of Q1, on the gate of Q2, on the drain of Q2,  and across D1 to get detailed information about where the power is really being dissipated.  I think that the voltage across the LED should be about 6V when the board is fully on, and the voltage drop across the Schottky diode should be small (maybe 0.1V for 12mW).  For board voltages before the current limitation cuts in, almost all the power goes to the LED.  At higher voltages, the extra voltage drop and power dissipation is all in Q2, with around 700mW dissipated in Q2 when the board voltage is 6V higher than where the current limitation starts and 700mW delivered to the LED. That’s about as high as I’d be willing to go for continuous lighting, even with a heat-sink on the board.

I should be able to make the measurements fairly easily with the Analog Discovery 2, and I might do so later this week. One thing I’m curious about is whether the drop in current with higher board temperature is due to changes in the characteristics of the NPN transistor or the nFET.  The nFET is dissipating most of the power, so its junction temperature is probably changing much more, though the LED and the nFET together warm up the whole board, so the NPN transistor is getting warm also.

2018 July 19

Dropping old LED lighting project

Filed under: Uncategorized — gasstationwithoutpumps @ 14:28
Tags: , , , , ,

About 4 years ago, I started a project to replace the breakfast room ceiling fan (which my wife has always hated) with an LED fixture of my own design.  In order to do this, I designed some custom LED boards that could work over a range of voltages with PWM control of the brightness and I made some desk and table lamps using the boards, as well as a stroboscope (Summer project, LED board I-vs-V curve, Summer project 2, Desk lamp, Newer dimmer software, LED strobe using dimmer boardHalloween 2016, … ).

Although I have had the electronics done for the breakfast room fixture for about 3 years, I’ve not been able to come up with a mechanical design that I think will look good.  Also, the task of cutting the conduit in the attic to install an outlet for the wall-wart power supply did not appeal to me, so I kept putting off the project.

Last weekend, my wife, my son, and I went to the local Habitat for Humanity ReStore, ostensibly to look for cabinet handles and doors, but mainly just to browse. While there, we saw a used drum light ceiling fixture that was on sale for only about $16 (it is one that normally sells for around $120 new from Home Depot).  Since I had pretty much given up on coming up with a design using my LED boards that would look good, and my wife liked the drum fixture, we bought it and my son helped me install it.

The hardest part of the installation was probably pulling new wire through the conduit, since I did not want to use the old cloth-covered solid copper wire that was there.  I also added a grounding screw to the junction box for the lamp, since the old ceiling lamp had no ground connection.

Here is the “new” ceiling lamp in daylight.

Here is the ceiling lamp with 3 2700K LED bulbs.

Lining up the screw holes of the fixture with the screw holes of the junction box was also a bit tricky—my son’s holding the fixture while I fussed with that was a big help.

The whole project cost under $30: $16 for the fixture, <$3 for screws and wire, $7.50 for 3 LED bulbs. The new lamp is not dimmable (because of the cheap bulbs I chose), but that feature was not really needed for the breakfast room anyway.

So I now have a lot of spare LED boards that I need to find a project for—I’ve used a few of the boards for the desk lamp and stroboscope projects, but I don’t really need another desk lamp or stroboscope.  Anyone have any ideas?

2017 January 8

Applying for Mini Maker Faire 2017

Filed under: Uncategorized — gasstationwithoutpumps @ 17:41
Tags: , , , ,

I’m submitting an application for the Santa Cruz Mini Maker Faire 2017 (2017 April 29), since last year’s Mini-Maker Faire went well (see Santa Cruz Mini Maker Faire went well).  This year I’m getting my application in early, rather than dithering about it for months as I did last year.  I have less free time to prepare the display this year, but I have a better notion what I want to do, so it should not take long to get ready.

Last year's banner, which I can reuse this year. I might also make a shorter one that will fit on the front of the table.

Last year’s banner, which I can reuse this year. I might also make a shorter one that will fit on the front of the table.

The “non-public” description of my display is straightforward:

I’ll bring a tabletop full of electronics projects, as last year (see https://gasstationwithoutpumps.wordpress.com/2016/04/16/santa-cruz-mini-maker-faire-went-well/ ).

Laptops demonstrating free software to turn cheap microprocessor boards into data-acquisition systems suitable for home labs and science-fair projects.
Homemade LED desk lamp and stroboscope.

Several of the projects will be interactive (an optical pulse-rate monitor, oscillators that can be adjusted to change Lissajous figures on an oscilloscope, …).

A few changes from last year: a more reliable pulse-monitor design and a new USB oscilloscope.

The public blurb is similar to last year’s:

See your pulse on a home-made optical pulse monitor!
Record air pressure waveforms using free PteroDAQ data acquisition software!
Play with a bright custom-design LED stroboscope!
Control fancy Lissajous patterns on an oscilloscope!

I removed mention of an EKG, because I decided that it was too much trouble to tether myself with EKG leads all day.

My “Maker bio” is a bit boring, :

Kevin Karplus has been an engineering faculty member at UCSC since 1986, but has done hobbyist electronics on-and-off since the 1960s. For the past few years he has been working on a low-cost textbook to make hands-on analog electronics accessible to a wider range of students.  Several of the projects on display are from the textbook.

2016 April 16

Santa Cruz Mini Maker Faire went well

The first Santa Cruz Mini Maker Faire seemed to go well.  I did not get to see much of it, since I was busy at my booth most of the day, though I did get a break for lunch while my assistant Henry manned the booth, and I made a quick tour of the exhibits during that break, to see what was there, though with no time to chat with other exhibitors.

I understand that about 1800 people bought tickets to the Mini Maker Faire, which probably means there were over 2000 people on-site, including volunteers and makers.  I hope the food vendors did OK—I ate at the Ate3One truck, since I never have before, but my opinion afterwards was that CruzNGourmet and Zameen have better food (both of those trucks are frequently on campus, and I’ve eat at each several times).

My day went pretty well, though I had one annoying problem, having to do with my pulse monitor display. When I set up the booth Friday evening, the pulse monitor was not working, and I thought that the phototransistor had somehow been broken in the rough ride in the bike trailer, so I brought the pulse monitor home, replaced the phototransistor and tested in thoroughly.  Everything worked great, so I packed it more carefully for transport in the morning.

When I got everything set up Saturday morning, I found I had no electricity, though the electricity had worked fine the night before.  After I finally tracked down a staff member with the authority to do anything about it, he suggested unplugging the other stuff plugged in and switching outlets.  I turned out that the only problem was that the outlets were so old and worn out that they no longer gripped plugs properly—taping the extension cord to the outlet box so that the weight of the cord didn’t pull out the plug fixed the power problem.

Once I had power, I tested the pulse monitor, and it failed again!  I used the oscilloscope to debug the problem, and found that the first stage transimpedance amplifier was saturating—there was too much light in the room, and even shading the pulse monitor didn’t help. By then, my assistant for the day (and my group tutor for the class on campus), Henry, had arrived and gotten the parking permit on his car, so I raced home on my bike to get resistors, capacitors, op amp chips, multimeters, hookup wire,and clip leads to try to rebuild the pulse monitor from scratch on the bread board.

When I got back to Gateway School, I tried a simple fix before rebuilding everything—I added a pair of clip leads to the board so that I could add a smaller resistor in parallel with the feedback resistor in the transimpedance amplifier, reducing the gain by a factor of about 30.  This reduced gain kept the first stage from saturating, and the pulse monitor worked fine.  Rather than rebuild the amplifier, I just left the pair of clip leads and the resistor in place all day—they caused no problem despite many people trying out the pulse monitor.

I think that I want to redesign the pulse monitor with a logarithmic first stage, so that it will be insensitive to ambient light over several decades of light.  That should be an easy fix, but I’ll have to test it to make sure it works. I don’t think I’ll have time this weekend or next to do that, but I’ll add it to my to-do list.

I’ll need to think about whether to include having a logarithmic response in the textbook—that is certainly more advanced than what I currently include (just a transimpedance amplifier), which is already pushing students a bit.  A transimpedance amplifier is a pretty common component in bioelectronics, so I really want to leave one in the course.  I’m not sure a logarithmic amplifier is important enough or simple enough to include at this level (I don’t currently cover the non-linearity of diodes).

 

Here is the booth display with my assistant, Henry. I was permitted to use painter's tape to attach the banner to the whiteboard.

Here is the booth display with my assistant, Henry. I was permitted to use painter’s tape to attach the banner to the whiteboard.

The magenta laptop on right (which my family refers to as the “Barbie laptop”) was a used Windows laptop that I bought for testing out PteroDAQ installation on Windows. It was set up with PteroDAQ running all day, recording a voltage from a pressure sensor and a frequency from a hysteresis oscillator (as a capacitance touch center).

Just to the left of that was a fairly bright stroboscope, using 20 of my constant-current LED boards. To its left is my laptop, displaying the current draft of my book. Behind (and above) the laptop is my desk lamp, which uses the same electronic hardware as the stroboscope, though with only 6 LED boards, not 20.

In front of the laptop is the pulse monitor, which includes a TFT display in an improvised foamcore stand. I used just a half block for the pulse sensor, relying on ambient light (sunlight and the desk lamp) for illuminating the finger.

To the left of the pulse monitor was a stack of business cards for my book and sheets of paper with my email address and URLs for this blog and the book.  I should have included the PteroDAQ URL as well, but I had forgotten to do so. I did tell a lot of people how to find PteroDAQ from the navigation bar of my blog, but putting it on the handout would have been better. Ah well, something to fix next year (if Gateway is crazy enough to do another Mini Maker Faire, which I hope they are).

I also had all my bare PC boards that I had designed and not populated, plus my two Hexmotor H-bridge boards, behind the business cards. One of the amplifier prototyping boards was displaying in the Panavise that I use for soldering.

On the far left of the table is my Kikusui oscilloscope and two function generators, set up to generate Lissajous figures.  I let kids play with the frequencies of the function generators, take their pulse with the pulse monitor, and play with the pressure sensor and the capacitive touch sensor.

My booth was not the most popular of the Faire by any means (certainly the R2 Makers Club in the next booth was more popular), but I was kept busy all day and I talked with a lot of people who seemed genuinely interested in what I was doing, both with the UCSC course and as a hobbyist.

2016 March 30

Class topic not what was planned

Filed under: Circuits course — gasstationwithoutpumps @ 21:27
Tags: , , , ,

In my Applied Electronics for Bioengineers course, I had planned to spend the lecture time today talking about sampling and aliasing, but that is not what ended up happening.

I am making it a point to answer student questions (unless they are irrelevant) first, before doing whatever I prepared. The point of the lectures is to help students understand the reading and do the design work for the labs, and anything I have prepared is just a best guess at what the students need. Their questions address more directly what they perceive as their need.  Most of the prepared lecture material is in the book (I wrote the book based on what I have covered in lectures), so answering questions from students who have read the book and are still confused is going to be better than my repeating what is in the book.

Today students had some logistic questions about what to write up for Lab 1 (not much, it was just soldering headers onto the Teensy boards and setting up PteroDAQ—I just asked for a description of what they did, whether anything went wrong, and what they did to fix the problem) and about prelab homework for Lab 2 (do it, but don’t turn it in, it is just setting up gnuplot so that they can use it for the lab).  Those only took a couple of minutes.

The big question that diverted the entire flow of the lecture was a request for an explanation of the high-pass filter in Lab 2 that is used for recentering the function generator output at 1.65V. This lead to several things:

  • Description of block diagrams as functional blocks connected by interfaces, and why this was an important concept in engineering. Frequency and voltage information was put on the block diagram  connections.
  • Capacitor symbol and DC-blocking property of capacitors.
  • Resistor to Vref and why that would cause the output to become Vref, if there was no current through the output.
  • Back to the block diagram to add the constraint that the analog-to-digital converter on the Teensy board couldn’t take any current from its input.
  • Definition of “gain” as \frac{dV_{out}}{dV_{in}}.
  • Showing the high-pass filter Bode plot as two lines meeting at the corner frequency, and giving the corner frequency as \frac{1}{2\pi R C}, without derivation.  I promised the students that we would derive that result in a few weeks, once we’ve had complex impedance.
  • Replacing the resistor to Vref with a pair of resistors to 3.3V and Gnd.
  • Introduction of the triangular ground symbol, and rejection of the chassis ground and earth ground symbols as not relevant for the class.
  • Derivation of the voltage-divider formula from Ohm’s Law, using the important constraint that no current is taken from the output node of the voltage divider, so that the two resistors have identical currents. I had the students help with this, in order to elicit the most common mistake
  • Assertion, without derivation or explanation, that the RC time constant for the high-pass filter should treat the two resistors as being “2R” rather than “R”.

For the last couple of minutes of class, I finally got to do the demo with the homemade stroboscope and pendulum of aliasing, but it was not very effective. Even with the lights off in the classroom, there was enough light through the windows to wash out the strobe. I could not easily keep the pendulum swinging with one hand and adjust the strobe with the other.  If I do this again next year, I should make a panel with about 20 of the LED boards, for around 2.35A during the flash.  At 1.64ms for the longest flash, that’s 3.85mC, which would drain 8.2V from the 470µF capacitor, if the power supply weren’t capable of delivering that much current (but I have a 6A 9V supply, so there should be no problem delivering full power).  Hmm, maybe I should make up that panel for the Mini Maker Faire, instead of the wimpy 4-LED strobe I now have.

I’m actually pleased that I didn’t give the lecture I had planned—my book, which was based on my lectures, already covers the material adequately, and I’d much rather spend precious class time explaining the things that aren’t clear in the book.  The only way I can know what the students need to hear is for them to ask for clarification where they are confused.

Next Page »