A hybrid power connector

2.1mmBarrelPlug

You love screw terminals.You love barrel jacks.

These things seem so standard to you, so convenient, and you dream of their lovechild, a sweet hybrid of convenience, solder-free terminals coupled with that 2.1mm silver power plug that powers myriad devices (e.g. Arduinos and most of the boards we sell).

Believe or not – this slightly monstrous adapter lives!  Soldering standard barrel plugs onto wall-adapter and battery-pack wires is not rocket science, but there are two principle challenges:

  1. You have to put the barrel plug insulator onto the wires, in the correct direction, BEFORE you solder the wires.
    This simple act, is cunningly easy to forget and evades me a fair percentage of the time I solder plugs on wall warts and guitar cords. So I end up with a perfect solder joint on the connector, and the insulating sleeve is lying on the bench, and I have to do it all twice.
  2. The other challenge is soldering well enough, and making tidy enough solder joints, so that the sleeve will slide down over the wires and screw on. This never bothers me anymore, but it often taxes my student’s soldering abilities.

This screw-terminal power plug eliminates both problems, perhaps at the expense of aesthetics. Also you don’t really have much strain relief with this jack, but it could easily be added with hot glue or epoxy putty. Perhaps at the further expense of aesthetics.

This also a great way to reuse all those power adapters in your junk box.

We have a short tutorial on using the plug below.

2.1mmBarrelPlug

 

Unscrew the terminals,

Tin the wall-adapter or battery-holder wires, Tinning the wires is not strictly necessary but is a good idea.

Insert the wires into the adapter. The marked “+” terminal is positive. This is way more standard than center-negative but center-negative adapters do exist, but not in Arduino land. Double check your specs and the polarity.

redwire

And screw the terminal back down again.

hands-screwing

If you’re seeking permanence, the wires can be soldered in place, though it takes a while. (this iron is off, use a hot one for best results).

soldered

 

It’s ready to go in the shop here! It’s never too early for nerd gifts for the holidays.

By Noah on September 30, 2014.

Creating a script to set your color palettes in Eagle.

Screen shot 2014-09-26 at 10.17.26 PM

A beautiful palette in Eagle. It’s still a work in progress.

This is tutorial to make a script that will set your color palettes in Eagle. Eagle has horrible (and limited) default colors and users have been complaining about them, and the lack of color palette functionality for the last 15 years, with absolutely no response. According to the managers at CadSoft the next revision is slated to fix some of the multitude of interface issues that are wrong with Eagle. (Don’t get me going again…)  If you agree with me, you might wander over to the Eagle support forums at Element 14, and speak up about fixing the color palette, as well as storing color palettes in files.

Anyway here’s how to make a groovy script that will set your favorite palette colors. One use for a script of this type is to reset your colors if they should ever become compromised, but you can also move color palettes between computers, and include them with files that you send to others, so that they can see your beautiful work in the colors in which it was created. To set the color palettes in Eagle, just run the script.

(Sorry these are the mac instructions – windows shouldn’t be that much different. I think the file name for .eaglerc might be different. Feel free to mod my instructions for Windows  and repost.)

• The first step is to edit one of the Eagle palettes to your taste and add some better colors. Don’t forget that the colors are arranged in vertical pairs in the palette. When you choose the top color in the pair in which to have a layer displayed, when the layer is selected, Eagle will use the bottom color of the pair to display the selected/active item in the layer.. If you choose the bottom color in the pair for the layer, elements do not change color when selected. So colors directly above each other in pairs should usually have a great deal in common. I usually make the selected color brighter (more saturated to you artists out there), and more opaque, assuming that when you select an item, you generally want it to pop out at you.

• Once you have finished your masterpiece palette,  quit Eagle. This is important because Eagle has some bizarre ideas of when to write files, so lots of information is stored and then written out when you quit. If the program crashes, well, you lose :)

• Open the Terminal and type the command “cd ~” (no quotes) That will get you to your home folder just in case the terminal
doesn’t open with your home folder as the current directory

• Next type the command “ls -la” (no quotes)
That will list all the files including invisible files – which .eaglerc is, since it begins with a period.

• Look for a line similar to this
-rw-r–r–     1 userName  admin      29110 Sep 26 20:29 .eaglerc

If you find .eaglerc all should be well.

• issue the terminal command “less .eaglerc”

• When the file opens in the terminal, use the arrow keys to scroll through the file (it takes a while!) until you find
a line like this:
Palette.0.0 = “0xFF000000″

These are the palette entries.
Palette.0.x entries are the black background
Palette.1.x entries are the background
Palette.2.x entries are the grey or colored background

You can copy any of the palettes for your script, or just one. I only use the white background, so I just copied the 1.x entries etc.
One strategy if you didn’t want to change the black and white palette default colors would be to change the colored background.

Copy the palette/s you want. Paste it into a text editor.  At this point you can exit the terminal if you want.

• Next you need to use the text editor of your choice to search and replace commands to change the text from the form

“Palette.1.1 = “0xB43232C8″

to the form
“set palette 1 0xB43232C8;”

If you have any practice at all searching and replacing, this should only take four or five steps of search/”replace all”, to whip the text into the correct form.

next append the entries:
“set palette black;”     before the black palette entries
“set palette white;”     before the white palette entries
“set palette colored;”   before the colored palette entries

you can add blank lines if you want for formatting – they are ignored.
comments may be added with a # sign beginning the line and ending with a semicolon

•    Here’s the head of my file for an example.

# MyDefaultColors.scr;
# Set the default colors in Eagle Cad;
# colors are stored in .eaglesrc in your home directory;
# open that file and copy the current colors;
# Then edit in a text editor to the proper format;

set palette white;
# you can’t change index 0 in the white palette;
set palette 1 0xB41CC2FE;
set palette 2 0xB4002400;
set palette 3 0xB4008080;
set palette 4 0x96CE0029;
set palette 5 0xB4800080;
.
.
.

• That’s it – save your file as “MyDefaultEagleColors.scr” or anything you wish, just be sure to use a “.scr” extension.

If you get an error in Eagle when you run the script with Run Script  you probably just have a formatting error. You can get an example of a working script from the  “defaultcolors.scr” script in the Eagle/scr folder, to get the syntax right.

Happy palette making. This will give you a way of transporting your colors between computers and sending to others to view your Eagle files as you created them.

Remember you don’t have to get the palette right the first time, you can repeat the process any time, although it is a little tedious. In the meantime, you might speak up in the Eagle  Forums at Element 14 and ask for a load and save button in the set palette window, which would make this tutorial blissfully obsolete.

By Paul Badger on September 26, 2014.

Motion Plug / Breakout board for the MPU9250

motion_plug

 

Modern MEMS (microelectromechanical systems) are amazing. This chip, the MPU9250 from Invensense, is a 3 axis accelerometer, 3 axis gyro, and 3 axis compass, all in one tiny package. It has an onboard processor for sensor fusion and looks perfect for a quadcopter, home spacecraft, or body sensing. The interface to JeeNodes makes wireless sensing with this board a snap.
The MPU9250 is 3.3V only, so be careful connecting it to a 5V board.

Possible Applications:

  • Tilt-free compass sensor
  • Heading determination
  • Improving GPS accuracy
  • Quadcopter
  • Heading sensing for art projects

In any case, they’re in the shop, and we’re giving away 6 of them with orders over $20. Use coupon code MPU9250

By Paul Badger on September 25, 2014.

Cold Fusion, LENR and NASA

Screen shot 2014-09-07 at 5.06.35 PM

 

LENR is now the preferred name for the research that grew out of what is still called “cold fusion.” Cold fusion and LENR are used somewhat interchangeably now, although people realize that “cold fusion” is now a pejorative. This may change back (be changing back now?)  if/when LENR reactions are confirmed. Then scientists may begin to own the (vernacular) term, even though it may eventually be proven not to completely and accurately describe the phenomenon.

After lots of reading about cold fusion (mostly for fun), including experiments, scientific papers and conference reports, my (completely unqualified – because I don’t have a degree in physics) take on the cold fusion / LENR field is summarized below.

  • The effect is real, having been confirmed by qualified, conservative academic researchers hundreds of times.
  • The phenomenon is new science and so is not going to be explained by the standard model,
    although this is controversial, as no theory now convincingly explains all of the experimental evidence that cold fusion researchers have uncovered.
  • Researching the LENR phenomenon is still verboten in academic physics departments, and graduate students are not yet encouraged or allowed to pursue the field, although:
  • Things are starting to change as,  MIT has run a short course on cold fusion in the winter break, for two years running now. You’ll note from the link that the sponsors are Electrical Engineering and Computer Science, and not the Physics Department. Some members of the MIT Physics Department were responsible for spiking claims about cold fusion back when it was originally announced in 1989, and there is still lots of bad blood between the groups of scientists. The Physics Department also has some large grants from the government to study hot fusion, a field that continues to make very slow progress, at the cost of billions of dollars spent.
  • Some LENR researchers have claims of commercial scale power generation (e.g. 1 megaWatt),
  • Which has attracted venture capital, although;
  • Rock solid technical confirmation of the technology is yet to be made public.
  • Patents and proprietary efforts are heating up including one by STMicroelectronics, a name that I expect a fair amount of people who are reading this blog will recognize, as they make sensors for Iphones, and motor drivers among lots of other interesting chips.
  • On the downside, the field attracts some cranks and wishful thinkers, as one might expect with a technology that has been repressed, but also promises many social benefits such as the generation of a fair amount of energy from common materials without a lot of polluting or toxic downside.
  • NASA apparently also believes that there is something to LENR and is putting a bit of money into research, and including it in plans for possible future spacecraft. NASA is all about the future and also all about contingency planning so this may not be saying too much.

Anyway I’ll skip the links and leave you to the “tender mercies of your own Internet Research” as my undergraduate mathematics professor might have said, had the Internet been invented yet. Google LENR and you too can be confused and rewarded.

By Paul Badger on September 7, 2014.

4 x 16 LCD character display

4x16_LCD

This is a very high quality 4 x 16 character display removed from new equipment. We bought them on a lark for their ABS boxes, and eventually we will spin up some products for the boxes. In the meantime they are taking up space in the shop and we’d like to move a few out. $5.00.

There are a couple more pictures on the product page.  We found that it works great both with the Arduino LCD library and with our LCD117 Serial LCD drivers.

Specifications:

  • Overall: 3.44″ x 2.37″             87.4mm x 60.2mm
  • Bezel: 3.15″ x 1.57″           81.7mm x 39.8mm
  • Display Area:   2.41″ x .982″   61.3mm x 24.9mm
  • Blue-Black letters on gray-green screen
  • There is no backlight.

In the shop here.

By Paul Badger on August 6, 2014.

A Stereo Audio Amplifier

stereo_amp_p

 

 

 

The Modern Device Stereo Amplifier breakout board is a minimal Stereo Amp designed to amplify small projects, such as amplifying the Fluxamasynth Shield, or an Adafruit Wave Shield for personal use in fairly quiet spaces. It is probably not loud enough for a good dorm-room dance party. It is also great for increasing the volume level of your Arduino or other micro-controller when used for musical projects.

A few words about the demo. We are using the Arduino just for a convenient source of 5 volts to power the amp. The output is directed to two  of our 8 ohm loud-speakers inserted into coffee cups for better amplification. We specifically bought a size that could be used with a coffee cup as a speaker enclosure. This was a trick I didn’t originate but picked up from one of my resourceful students.  For this project, we found that cutting a hole in the back of the cup produces a warmer sound, as opposed to leaving it covered. The left and right potentiometers control the volume of the left and right channels as you would expect.

As in the mono version of this amplifier, we have used real analog volume controls to make adjustment of volume easy. While it can be useful to have software control over output volume, it can also be useful in many situations, to have physical control over output volume. The example I sited in my post on the mono amp is still the first and best one that comes to mind. You have a piece installed in an art gallery and you want it to be heard during the opening of the exhibit. Typically art galleries are very crowded during openings, people have been drinking and the volume is loud. Afterwards there are typically between 8 and 0 people in the gallery, with much lower sound levels. Being able to physically tweak the volume is an easy way to set appropriate volume is very useful. Many other situations exist, even with digital sound, where a simple potentiometer is more effective than two buttons with some kind of “up-down” digital interface.

The Modern Device Stereo audio amplifier breakout board uses the LM4992, one of National Semiconductor’s “Boomer” amps. It uses what in the industry is referred to as a “bridge-tied load”. This is an efficient system that increases the total amount of power available to the speaker with low-voltage systems. It also eliminates the need for an output capacitor, (like in the LM386) which tends to be bulky and can limit the low-end response. It has a shutdown pin to put the chip to sleep, just in case you’re trying to build a super low-power microcontroller application that spends most of its time sleeping.

All this in a really small package.  Here are some specs with a 1khz signal.

Power Out VCC THD & noise Load (speaker ohms)
1W 5 volts  .1% 8 Ω
.4W  3.3 volts .1% 8 Ω

This is not quite CD quality sound, since this chip was designed for cell phones, but then neither are most of your other electronic appliances (such as phones and mp3 players) these days. Pop music still seems to be doing fine.

Ships with a two terminal blocks,  a 4 pin male header, and two 200K pot which all not soldered onto the board. All other parts are assembled and tested and ready to go.  It’s in the shop here.

By Britton on July 28, 2014.

Rev P Wind Sensor Data

Pitot_tube
The Modern Device wind tunnel outfitted with a pitot tube and temperature sensor.

We wanted some more “objective” methods to confirm the numbers on our growing collection of anemometers, so we naturally thought about pitot tubes. This is the way that aircraft tell their airspeed. I don’t know how much they get used anymore, but the great virtue of a pitot tube is that it can be entirely mechanical, although that would of course depend on the gauge that is used to translate the pitot tube’s pressure into a number.

The pitot tube actually has two connections. The “high side” connection is exposed to the oncoming air and generates a positive pressure. The “ambient” connection, takes into account any static pressure in the system. The two lines are then read differentially, similar to a differential connections for an op-amp, so that the output is the high side pressure minus the ambient pressure.

 

Magnahelic

Isn’t this a wonderful looking set of gauges? These are called “Magnehelic” by Dwyer instruments. They are totally analog (although an electronic one is on top) and are hooked up to the pitot tube with small rubber tubes.

Here is some raw data from the Rev P Wind Sensor at 4 different temperature points.

RawData

It would be very nice if static pressure was just proportional to wind speed, but few things in life or in physics are so simple. The pressure generated is dependent on the density of the air, which makes sense if you think about it. The density in turn, is dependent on barometric pressure, temperature and humidity.

Here’s a graph that shows the temperature dependency.

Velocity vs Temp.png001

So I implemented the math to correct for temperature and barometric pressure. One little hiccup was that “Absolute Temperature” was denominated in the little-used Rankine scale (F + 460). Once I entered the correct values for temperature, some wind speeds that looked very plausible came out the other end of my Excel spreadsheet, whose chart looks like this:

WindSpeed

A couple of conclusions that I’m drawing is that at lower air speeds, the ambient correction circuit in the Rev P wind sensor is doing an admirable job, for some reason at higher wind speeds there is still some correlation between output and ambient temperature. It’s curious that the higher temperatures are reporting greater output, because normally one thinks of it taking more energy to get cold air up to temperature.

My current focus is on the ambient temperature correction circuit. The thermistor doing ambient correction is a 10k which is not by my choice. I would have desired a much higher value, but 10K was the highest value available in the thermistor line that I am using. The 10K thermistor dissipates about 3mW which is enough to raise its temperature almost 1 degree K, according to the datasheet. (Datasheet is 4mW/K). This would tend to be velocity sensitive also as at higher wind speeds the self-heating would be swamped by the power of the wind speed to enforce the ambient temperature. It’s just a hypothesis at this point.

Another hypothesis is that the “active” (heated) thermistor and the ambient sensor, just don’t track each other perfectly, leading to some variation over temperature. Indeed I would be shocked if there was no variation over temperature. I can cure the self-heating problem fairly easily, but only a lookup table will compensate for the variation in sensor response over temp, and that is the direction in which we are heading.

The new wind sensors are in the shop here: http://moderndevice.com/product/wind-sensor-rev-p/

By Paul Badger on June 26, 2014.

New Rev P Wind Sensors

Wind_RevP_1

In addition to working on our wind tunnel, we’ve been developing new wind sensor designs. Rev P is not a new version of our rev C wind sensors that we have made for several years. It might have been better with a new name, and may eventually get one, but for now it’s “Rev P”.  “P” stands for PTC or Positive Temperature Coefficient thermistors. The difference between NTC and PTC is as follows: NTC thermistors have smaller resistance as they get hotter, whereas PTC thermistors exhibit a larger resistance when they get hotter.

Why new thermistors? The PTC thermistors track each other more closely, and the ambient temp thermistor in the new design actually is part of the Wheatstone bridge, instead of just sensing ambient temperature, as in the Rev C sensor. The part is also available in a higher precision (1%) than the 3% thermistors in the Wind C sensors. The rev P thermistors are supposed to be more stable than the parts in the Rev C, with excellent values for maintaining their values after a year of being heated.

As you can see, the potentiometer has gone away, and the only wind speed output is the voltage output of the wind speed sensor. We have also added a real temp sensor, that is not dependent on the supply voltage. Everything would be great in wind sensor land IF I could buy PTC thermistors in the values I want. The chip I’m using only seems to be available in 100 ohms, which ends up being around 120 ohms by the time it gets up to working temperature. Consequently, to get enough power to heat the chip up, it requires a higher voltage than the Wind C sensor, which is slightly inconvenient. Right now the sensor requires 8 volts, which probably means a readily available 9 volt supply. We will bring out the next version very quickly that will have a boost regulator so that the sensor will run well from five volts.

Current draw is around 40 mA but this goes up at higher wind speeds, which one would expect, since it requires more power to keep the sensor hot at higher wind speeds.

Another feature of the sensor that we have been experimenting with is the non-standard mounting of the chip, with no pcb behind it. This goes a long way toward making the sensor omnidirectional. The chips are only coated on one side so there is still some built-in asymmetry in the sensor’s directional response that probably can’t be compensated out, without using two sensors. We’ll also get that characterized next week.

We’re still gathering data in the wind tunnel on this beauty and should have curves (at least from 25 to 40 degrees) and an Arduino sketch early next week. They’re already in production and in stock.

The new wind sensors are in the shop here: http://moderndevice.com/product/wind-sensor-rev-p/

 

By Paul Badger on June 6, 2014.

The Modern Device Current Sensor at 3.3 Volts

When we designed the current sensor we noticed that the hall effect sensors were rated only for a 5 volt supply in the datasheet, so we didn’t know what kind of performance we would get, if any, with a 3.3 volt supply voltage. So while we were doing the calibration research, we gathered some data at 3.3 volts. We didn’t plug in as many different loads as  with the 5 volt sensor but as you can see from the graph below, the output is very linear, once you get past the very low power “hook” on the left end of the curve, which is due to the “noise floor” from the amplified sensors.

3Vgraph

So the good news is that the Current Sensor will work fine on a JeeNode or other 3.3 volt microcontroller. One caveat is that the sensor’s saturation point (maximum reportable value) is also a bit smaller than the 3.3 volts supply,  because the output is governed by the topology of the op-amp peak detector.

Screen shot 2014-05-07 at 3.53.35 PMThe peak detector works with diode D1. The op amp IC1D cannot produce a voltage higher than 3.3 volt supply voltage so the maximum value for the peak detector output at IC1C (pin 8) is going to be 3.3 volts minus the voltage from the diode drop, which in this case is about .2 volts because we used a special schottky diode to try to minimize the diode losses.

Paul

 

 

 

 

By Jeffrey Blum on May 7, 2014.

Current Sensor – A Quick Calibration Method

Our last post concerned the Current Sensor and how to calibrate it to measure the amount of power being drawn through an AC line. That process involved gathering data and plugging it into a spreadsheet program, validated the sensor and showed that the voltage output of the sensor was very proportional to the power draw in the wire it was sensing. It occurred to us that if the output is linear, then only two points are really required to define a straight line. Thus, it would be fairly easy to develop a quick (but perhaps a bit less accurate) calibration by entering only two data points total.

So we developed a second current sensor program, shown below. To make this one work, all you need is two appliances with different power draws, ideally one around 20 to 200 watts and the other closer to 1000 watts. Measure the voltage generated by the current sensor for those two loads individually then substitute your data points in for V1, P1, V2, and P2, and you are done. The sensor is calibrated. As long as it doesn’t get bumped on its line cord, it should maintain very faithful calibration.

The one caveat is that you should make sure that the sensor is not saturating (hitting its maximum) on your higher current draw, so make sure the output voltage is under 4.3 volts (if powered from 5 volts). The analogous value (highest voltage without saturation) when powering from 3.3 volts is 2.6 volts.

That’s it! The program takes care of finding the equation for you really quickly at the expense of only using two data points, which means less accuracy. But as I said earlier, that might just be enough for you. Enjoy!

/*
  ReadMDCurrentSensor2
  Reads a Modern Device Current Sensor on pin 0, converts it to voltage,
  calculates the power, and prints the result to the serial monitor.
  Attach the V_OUT pin of the Current Sensor to pin A0, and V_IN and GND
  to +5V and ground respectively.

  This example code is in the public domain.
 */

//You'll have your own values for these constants

#define V1 0.577  // voltage of first data point
#define P1 225    // power of first data point
#define V2 2.91   // voltage of second data point
#define P2 1000   // power of second data point
float SLOPE;
float Y_AXIS_CROSS ;

void setup() {
  //Find SLOPE and Y_AXIS_CROSS for quick calibration
  SLOPE = (P2 - P1) / (V2 - V1);
  Y_AXIS_CROSS = P1 - V1 * SLOPE;
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  //Calculates power from voltage
  float power = voltage * SLOPE + Y_AXIS_CROSS;
  // print out the value you calculated:
  Serial.println(power);
}
By Jeffrey Blum on May 5, 2014.