Welcome to my musings on whatever topic catches my eye, plus stories, recipes, handyman tips, welding, photography, and what have you. Oh, and analog/digital hardware design, and software. Please comment on the blog post so everyone who visits can see your comments.

Category: STEM (Page 6 of 11)

Science, Technology, Engineering, Medicine

Bridge Collapse Sign of Things to Come?

A bridge collapsed this morning in the West Deptford area of New Jersey sending a train loaded with toxic chemicals into a creek.  It was reported on CNN here: http://www.cnn.com/2012/11/30/us/new-jersey-train-derail/index.html

CNN Photo:

The American Society of Civil Engineers publishes an annual evaluation of the infrastructure of the United States.  There are tens of thousands of bridges in the U.S., most of them built long ago and ill maintained.  The ASCE says that a quarter of the nation’s bridges are “structurally deficient or functionally obsolete.”  Water systems, dams, and other infrastructure is also old and in need of repair.

But politicians are reluctant to sponsor remediation projects because they lack appeal and pizazz.  It’s much more exciting and attractive to voters to grandstand about a new project.  There’s no interest in spending money on existing structures and systems.

The ASCE estimates that $2.2 trillion needs to be spent repairing existing infrastructure.  Imagine how many jobs that would create.  But remediation projects are boring so we’ll have to wait until serious failures become common and people die before something is done about this problem.

The American Society of Civil Engineers publishes the results of their evaluation here: http://www.infrastructurereportcard.org/

Here Comes 3-D Printing

Engineering, software, and the Internet have made it easy for people to share documents, music, photographs, and videos on a worldwide basis. It’s obvious to anyone skilled in the art that, short of shutting down the Internet entirely, sharing cannot be controlled by governments or by anyone else. There are a lot of smart people in the world and any attempt to block sharing will be quickly circumvented. No matter how clever a blocking scheme you come up with, there’s always another guy on the other side of the world smarter than you who will break it. Recent history has shown over and over that this is true. Blocking and security schemes are usually broken before they are even introduced. So we’re not going to be able to control the sharing of music, videos, etc. Get over it.

Now imagine a world where the sharing of physical objects and mechanical devices becomes just as easy as sharing music or videos. That world is nearly upon us. 3-D printer technology is available and when people discover how useful it is, the technology will quickly mature. Today, consumer 3-D printers work mainly with plastics but 3-D printing with metals has existed for many years in industry and home printers will soon be able to work with a wide variety of materials including high-strength steels. Want a 9mm pistol? Just download the print file for the particular brand and model you want and send it to your 3-D printer. When the parts are done, assemble them and go shooting.

This technology has all sorts of implications. Intellectual property problems will not be limited to businesses producing music, photos, and videos. These problems will become real for manufacturers of all products that could be fabricated by a 3-D printer. A pistol is just one example.

And if that’s not exciting enough, work is already underway to develop bio-printers and chem-printers. These are devices that are miniature chemistry labs that will be able to generate a wide variety of chemical substances, including drugs. Need an antibiotic for an infection? No problem. Just download the chem file and generate it on your desktop. We’ll have this technology on our desktops in a few years. Imagine the implications this will have for pharma companies.

The Mystery of the Non-Waterproof Hot Glue Solved

Six years ago I had a bad experience with hot glue.  I expected it to be waterproof and it wasn’t.  I did an immersion test and within 3 days the glue turned into a whitish gelatin and fell off.  That’s barely water resistant and certainly not waterproof.

For waterproofing I usually lean towards silicone (RTV, silastic, aquarium cement).  It works well in every application I’ve ever used it on.  But hot glue is so convenient and sets so fast that I kept thinking about it and wishing I could use it.  A few weeks ago I decided to learn more about hot glue.

There are many different kinds of hot glues used in industry and most of them are available in standard 11mm sticks, but I would much prefer to use the common household clear bluish or yellowish stuff if possible.  The standard home-use glue is made from EVA (ethylene vinyl acetate) plus various additives to adjust its characteristics.  Nearly every article I read says that “hobby” hot glue is waterproof, and indeed, EVA is a waterproof thermoplastic.  This disagreement with my experience really got me studying.  Something is not adding up here.  I learned about all kinds of hot glues and their characteristics and just as I was getting ready to compose emails with specific questions to hot glue manufacturers, I ran across the answer.

What happened to me six years ago was a “materials compatibility problem”.  Six years ago, what I had done was to waterproof some electronics by building it inside of sealed PVC pipe.  The plan was to bring a couple of small insulated wires out through a small hole in the pipe and then seal it up by pumping hot glue into it.  This is the application that failed the immersion test.  Naturally I assumed it was the water that caused the failure, but it was not the water.  It was the PVC pipe material and especially the PVC insulation of the wires.  Actually, it was not the PVC itself but the pthallate plasticizer that’s mixed with the PVC to make it flexible and not brittle.  PVC wire insulation has an especially high amount of pthallate.  Pthallate attacks EVA and causes it to decompose, and that’s why my test failed.

Recently I’ve done more experiments with EVA hot glue.  Yes the material is waterproof.  I’ve had a glob of hot glue immersed in water for weeks and it’s  unaffected.  I did another experiment where I used EVA to hot glue polyurethane to painted ABS.  It sticks like a weld.  You have to destroy the pieces to get them apart and it’s unaffected by water.  So it all depends on materials compatibility.  I just wish I had known this sooner.

Simplest Way to Play Raw PCM Audio on Ubuntu: libao

There are a zillion ways for a Linux programmer to play audio through the sound card.  This is the problem.  There are many layers to the audio system, many ways to go, and most of them are very complex because multimedia is very complex.

But what if you have the simplest of all cases where you have a buffer in memory containing raw PCM samples, ready to play, and you just want to pump the data out to the sound card and play it at a certain sample rate?  In many cases you’re looking at hundreds of lines of code, writing your own plugin, etc.

After two days of asking questions, Googling, and reading, I finally found what I was looking for.  Libao is part of the standard Ubuntu distribution and it does the job without writing tons of code.

I found a couple of examples but both had problems compiling cleanly.  After using Synaptic to install the libao development files the following will compile cleanly on Ubuntu 10.04 using the gcc command shown in the comments below:

 /*  
  *  
  * ao_example.c  
  *  
  *   Written by Stan Seibert - July 2001  
  *   Modified slightly by Phil Landmeier - February 2011  
  *  
  * Legal Terms:  
  *  
  *   This source file is released into the public domain. It is  
  *   distributed without any warranty; without even the implied  
  *   warranty * of merchantability or fitness for a particular  
  *   purpose.  
  *  
  * Function:  
  *  
  *   This program opens the default driver and plays a 440 Hz tone for  
  *   one second.  
  *  
  * Compilation command line (for Linux systems):  
  *  
  *   gcc -lao -ldl -lm -o ao_example ao_example.c  
  *  
  */  
 #include <stdio.h>  
 #include <string.h>  
 #include <ao/ao.h>  
 #include <math.h>  
 #define BUF_SIZE 4096  
 int main(int argc, char **argv)  
 {  
     ao_device *device;  
     ao_sample_format format;  
     int default_driver;  
     char *buffer;  
     int buf_size;  
     int sample;  
     float freq = 440.0;  
     int i;  
     /* -- Initialize -- */  
     fprintf(stderr, "libao example programn");  
     ao_initialize();  
     /* -- Setup for default driver -- */  
     default_driver = ao_default_driver_id();  
     memset(&format, 0, sizeof(format));  
     format.bits = 16;  
     format.channels = 2;  
     format.rate = 44100;  
     format.byte_format = AO_FMT_LITTLE;  
     /* -- Open driver -- */  
     device = ao_open_live(default_driver, &format, NULL /* no options */);  
     if (device == NULL) {  
         fprintf(stderr, "Error opening device.n");  
         return 1;  
     }  
     /* -- Play some stuff -- */  
     buf_size = format.bits/8 * format.channels * format.rate;  
     buffer = calloc(buf_size,  
             sizeof(char));  
     for (i = 0; i < format.rate; i++) {  
         sample = (int)(0.75 * 32768.0 *  
             sin(2 * M_PI * freq * ((float) i/format.rate)));  
         /* Put the same stuff in left and right channel */  
         buffer[4*i] = buffer[4*i+2] = sample & 0xff;  
         buffer[4*i+1] = buffer[4*i+3] = (sample >> 8) & 0xff;  
     }  
     ao_play(device, buffer, buf_size);  
     /* -- Close and shutdown -- */  
     ao_close(device);  
     ao_shutdown();  
  return (0);  
 }  
« Older posts Newer posts »

© 2025 Shuttersparks

Theme by Anders NorenUp ↑

Find me on Mastodon