Wednesday, January 27, 2016

Music and Me Part 3

Around two years ago I wrote about building a pipe organ in a post called Music and me continued. At the end of that post I said that the number of solenoids that I would need would cost quite a bit of money and I wasn't sure when I would get back to it (i.e. I am too cheap to spend that kind of money on the project.)

Well, my friend Jim from across the street came over just before Christmas and I was showing him the pipes that I had made and he asked what the next step was in the project. I said that solenoids were too expensive to take it any further and by way of illustration I called up the Electronic Goldmine website (http://www.goldmine-elec-products.com/) and what to my wondering eyes did appear but solenoids on sale for $5 each. I quickly penned a letter to Santa and there, under the tree on Christmas morning were 42 solenoids. I was back in motion once again.

Jim and I spent hours working on designs for the configuration for the solenoids and eventually hit on something that we thought would work, and here it is in the flesh.
In the lower part of the picture is the "wind chest" that I mentioned in my last post on this topic. This is a design that I pretty much just stole from Matthias Wandel from his woodgears.ca website. For springs I used hacksaw blades because they are made of spring steel. You can see that there are two rows of valves with the (mostly) white hacksaw blades pressing them down (closed). Above the wind chest you can see that there are two aluminum angles, the bottom one is populated with solenoids, the top one not yet.

Running down from the solenoids you might be able to spot thin wires attached to the valves. When the solenoid is powered it pulls on the wire and opens the valve.

So far so good. How do I play music? I mentioned in an earlier post that I planned to use MIDI (Musical Instrument Digital Interface). This is a standard that is more than 30 years old. It is used to control digital musical instruments like synthesizers, to manage stage lighting and pyrotechnics that are coordinated with music and so on. There are many thousands of songs in MIDI format available for free online. These are not sound files, though. They are instructions on what notes to play, when, for how long, and at what volume. Here is an example of some lines from a MIDI file converted to text.

   4: 1:  0  |On Note | chan= 3   | pitch=C#2 | vol=66
   |On Note | chan= 3   | pitch=C#1 | vol=64
24 |On Note | chan= 3   | pitch=F#2 | vol=52
43 |(Off) Note  | chan= 3   | pitch=f#2
48 |On Note | chan= 3   | pitch=G#2 | vol=56
61 |(Off) Note  | chan= 3   | pitch=g#2
72 |On Note | chan= 3   | pitch=E 3 | vol=88
   |On Note | chan= 3   | pitch=B 2 | vol=76
   |On Note | chan= 3   | pitch=F#2 | vol=76
   |On Note | chan= 3   | pitch=G#2 | vol=68
90 |(Off) Note  | chan= 3   | pitch=g#2
91 |(Off) Note  | chan= 3   | pitch=b 2
94 |(Off) Note  | chan= 3   | pitch=c#2
95 |(Off) Note  | chan= 3   | pitch=e 3
   |(Off) Note  | chan= 3   | pitch=f#2
      2:  8 |(Off) Note  | chan= 3   | pitch=c#1

The numbers on the left are timing. Then comes the instruction. The channel is the instrument, then the note, and finally the volume. This particular MIDI file breaks each beat into 96 increments. So, for instance, the first line says "at the beginning of the first beat of the fourth measure, for instrument number 3, start playing C# in the second octave at a volume of 66". The next line says "at the same time start playing C# in the first octave". Then after 24/96ths of a beat (or actually 25/96ths of a beat because the counting starts at 0 rather than 1) start playing F# in the second octave. Then 19/96ths (43-24=19) of a beat later turn of F# in the second octave. And so on, and so on.

I had an Arduino Due microcontroller and hooked up an SD card reader to it and put a MIDI file on the SD card.

Here is the Arduino. It has 53 output pins. Under program control it can turn each of these on or off. I wrote a program on the Arduino that assigns each note to a pin. Then it reads the file and turns the pins on and off with the correct timing. Since I only have 42 notes on the organ I only need 42 pins. These pins can only supply a tiny amount of electricity, however, not nearly enough to trigger a solenoid.


















My sister Monica and her husband Jim happened to be visiting, and she and he and I built this board.
The main components are 42 transistors. These work like electronic switches. The tiny amount of electricity from the Arduino can turn on a transistor, and a transistor can switch enough electricity to trigger a solenoid.

I still have to wire all this stuff together but I'm pretty confident that it will work







And what about all those pipes, you might ask. Not tons of progress on that front, with one exception. Again, I have been using the information provided by Raphi Giangiulio's YouTube videos on how to make wooden organ pipes.

In looking at his specifications there was something that didn't make sense to me. As the pitch gets lower the pipes get bigger until we get below C below middle C. Then they are significantly smaller. I didn't understand that so I sent an email to Raphi and he generously responded and explained that Bourdan pipes are stoppered. That means there is an airtight stopper put into the pipe and that lowers the frequency. It's counter-intuitive but it works. Here are a series of five pipes in order of frequency with the lowest on the left.














And here is a shot of a couple of stoppers.

I have only 18 pipes of the 42 pipes made, and so I am not nearly finished with the project but I am re-invigorated. I'll keep you up-to-date.

Thursday, October 15, 2015

Matching headboard

Regular readers might remember that sometime back I built a bench for the foot of our bed. At the time I mentioned that we had a queen size mattress but were thinking of upgrading to a king size. The issue was that Peg likes a firmer mattress and I like a softer one. I thought about one of those Sleep Number beds where each side is adjustable as to firmness. I priced them, however, and realized that it would be cheaper to buy a car and sleep in there. Then, as luck would have it we were up visiting Abigail in Washington D.C. We stayed in a Marriott hotel and we both liked the bed. I looked for a tag on the mattress. It was a Serta but didn't have a model name or number. Peg looked on the Serta website and they said that if you stayed in a hotel and liked the mattress you could call Serta and order the same model direct from them. So I did.

Now, however, the pressure was on. I had to actaully make the headboard to match the bench that I had been talking about. I had enough cherry left over, and enough caning so I did it, and here are the pictures to show you.




I didn't have any 8/4 cherry so I made the posts by doubling the 4/4. These are the posts with mortices for the lower rail.





I cut one of the two 4/4 pieces shorter than the other giving me a way to overlap the upper rail. Here you can see one of the completed posts with a groove cut for one of the panels. You can also see the three stiles with their tenons and grooves cut.














Here's how I made the panels. I used half inch plywood. I glued the caning to one side and cut rabbets along the edges of the other side to fit into the grooves.


 Here is the lower rail with tenons and groove cut.



















And here you can see one of the mortices in the lower rail, cut to accept the tenon on the stile.













Here are most of the pieces, ready to assemble.






And now the posts, lower rail, and stiles are glued together and ready for the panels to be inserted.

As no good deed goes unpunished I imposed on my friend Jim (who helped me with the Historic Spanish Point benches) to help me glue on the top rail. This glue-up was particularly exciting because we had to get the tenons on the three stiles into the three mortices, while at the same time getting the top rail aligned exactlly with the posts all before the glue dried. You can never have too many hands or too many clamps.

Next I cut grooves to fasten the header to the top rail using biscuits. To the uninitiated, buscuits are oval shaped pieces of compressed wood. When glue is applied to the grooves and the biscuit inserted, it swells and that in combination with the glue hold the joint firmly.

Six coats of polyurethane later and it's ready to go.


Ta-Daa. The finished product, matching bench, and hotel mattress.

Monday, October 5, 2015

Benches for Historic Spanish Point

Some of you may recall that a while back I made a model of the HSP (Historic Spanish Point) orange sorter. They wanted to use it for their outreach program to take it to schools, nursing homes, and that kind of thing.


HSP has beautiful grounds that are part of the land that had been owned by Bertha Honore Palmer, the wife of Potter Palmer who built the Palmer House Hotel in Chicago. Besides being popular for historical tours and the like, they have facilities for weddings and other such gatherings. They have a small chapel the stained glass windows of which were the inspiration for one of the stained glass lanterns that I blogged about some months back.

Well, in order to better support (no pun intended) the gatherings they host there, HSP asked me to make some benches. I asked, with some trepidation, what they wanted the benches to be like. The reason for my fear dates back 25 years or so. I was going to build a swing set/climbing platform etc. in our back yard for the kids to play on. I thought it would be a good opportunity for them to learn about the design and planning process for such  project. We sat down and collected a bunch of ideas about what things they wanted to include, how many levels, how tall, how many swings and so forth. Then we drew pictures to scale from different angles of how it would look. Finally we built a small model to help work out the construction details. They agreed that that it was just what they wanted.

Then I went to work. It took me a few weeks of weekends but finally it was done. I hung the swings, fastened the ladders and climbing ropes, checked to make sure there were no rough spots or slivers, and then invited the kids out to try it. They came running out and as they got close they stopped dead in their tracks. They said, "Where's the slide?" I asked what slide they were talking about. They said they thought there was going to be a slide. I took them back in the house and we reviewed the list of desired features we had developed at the start of the project -- no slide. I showed them the drawings. Then we looked at the model. I pointed out that there was no slide on either of those. They allowed as how that while that was true it should have been obvious that a structure like this should have a slide.

Fade out 25 years ago, fade in present day. Scarred as I am from that episode I always nervous when someone wants something built but don't have too firm and idea as to what exactly it should be.

In this case my fears were completely unfounded. Kara at HSP had found exactly what she was looking for on the web at http://www.thehappierhomemaker.com/2013/10/rustic-15-dollar-bench/


What's more, the website included a dimensioned drawing and, much to my surprise the material costs really were around $15.

Kara brought the HSP truck and she and I went to Lowes and bought all the stuff.












I went into production line mode and cut all the pieces.



Mercifully, my friend Jim from across the street stopped by to see what was going on and volunteered to pitch in. We worked together over a number of days, improving our efficiency with each bench we completed.

Here are the first nine.

And here are the last sixteen. Kara seems pleased with them, and if she's happy, I'm happy. Thanks again to Jim for all his help, and thanks to thehappierhomemaker.com for a solid design.


















Sunday, July 5, 2015

Kite pictures with a Raspberry Pi Camera

My brother Jim and his family were down here in Florida and we got it into our heads that it would be fun to take some aerial pictures. Now that I'm retired I'm too cheap to buy a GoPro and a multicopter, and besides those copters are just too annoying.

I cooked up a python program on one of my Raspberry Pi single board computers that would snap a picture once a second. The PiCamera has a resolution of about 5 megapixels.

Then my brother and his two kids figured out a way to rig it to a kite that I had bought when I was living in Singapore.


Here is a picture south along the beach near the apogee of the flight. The kite string is visible on the right.




This is Venice, Florida looking east.


Jim's neighborhood, with his house in the middle distance.




A nice view of the Gulf of Mexico and a few July 4th weekend beachgoers.





Jim and my nephew and myself discussing some crucial landing parameters.

Me and the kite nearly reunited.


My niece and nephew wrestling the kite back into its storage bag.

Sunday, May 3, 2015

Stained glass

I'm sorry for not posting for a while. My everyday computer got jumped by Mr. Dead. I've therefore been somewhat discombobulated however all is now sorted out . . . and I am thus recombobulated. Then we had our three daughters and son-in-law down for Easter.

Peg and I took a class in making stained glass. This is what happens when you're retired and so have too much time on your hands. We have this courtyard around the pool at our house. We often eat dinner out there, and entertain as well as use the pool and the outdoor kitchen. We have lights under the eaves but we were looking for something a little more subtle. We put candles on the tables and that led us to the idea of making some lanterns to put the candles in, which led us to the stained glass class. Or at least that's the way I remember it.

Neither Peg nor I go in much for tchotchke, and after looking through the pattern books that seems to be stained glass' stock-in-trade. Thus, I think the lanterns will be our final projects for the moment. I'm glad I now know the techniques, however, so if some huge money-making opportunity opens up in the stained glass arena, I'm ready to take it on.


Here are some pictures of the ones that we made. 






















Peg made these using a combination of stained glass and fused glass techniques. Fused glass involves partially melting glass in a kiln to soften the edges and (as the name implies) fuse the pieces together.





Wednesday, December 17, 2014

Measuring Electricity with an Arduino

A few of us have been working on a project to try and figure out what is the most cost effective temperature at which to set our thermostats if we plan to be away for an extended period. I'll write about the details of that at a future date, but clearly an important factor in that determination is how much electricity our air conditioners use. That is a question that I have focused on recently.

 FPL (Florida Power & Light) provides hourly data, as shown here.




For my purposes, however, this has a couple of drawbacks. First, I would have to pull it from the website every day. Second, the highest resolution is on an hourly basis and I am looking for much more detail than that.

I nosed around the internet and I found a website called Desert Home. This is a fascinating collection of home automation projects with detailed how-tos. Dave from Desert Home referenced OpenEnergyMonitor. They sell a bunch of products for doing this kind of monitoring, but they also have a large number of educational posts that give the theory behind measuring electricity. Since I'm retired and have more time than money I decided to build the tools myself.

I ordered up some CTs (current transformers). They clip around the electrical feed lines coming into the house and produce a small current that is proportional to the large current that is flowing through the feed wires. You can see them near the bottom of the picture below. For those of you not familiar with household electricity, in the US we commonly use 120Volt 2-phase 60 Hertz current. That is, the voltage on each of the feed lines alternates between a root-mean-square voltage of +120V and -120V relative to the neutral wire (the thick white wire in the picture) 60 times per second. That's why there are two transformers in the picture, one for each feed line. Incidentally, the 60 cycle wave-forms on the two feed lines are 180 degrees out of phase (thus it's called 2-phase) with each other, so when one is at +120V the other is at -120V. Thus the potential between the two feed lines, rather than between the feed line and the neutral, alternates between +240V and -240V 60 times per second. That's how you get 240V for your electric dryer or pool pump or whatever. But I digress.

You might think that's almost the end of the story, but you would be mistaken. The way power companies charge for electricity is on the basis of "real power." Real power is the instantaneous voltage multiplied by the instantaneous current, giving the instantaneous (real) power (in watts). The reason that's important, the folks at OpenEnergyMonitor taught me is that electrical devices draw different amounts of current at different voltages. The plots of voltage and current draw might look something like this. So what you have to do is measure the voltage and current a bunch of times a second, multiply them, and then total them up. 

Okay, so here is what my setup looks like with all the covers off.


I have two 200amp panels, each with two feeds so I have four measurements that I take. I ran a piece of conduit from each panel to the blue box. I then connected them to a circuit I built, again based on guidance from OpenEnergyMonitor that conditions the current coming from the transformers so that it can be measured using an Arduino microcontroller. You can see it hanging from the wires in the bottom of the above picture. You will remember that the two components needed to measure the power used are current and voltage. That's why there are two "wall wart" transformers plugged in in the picture. One powers the Arduino and one just delivers the alternating current waveform to the conditioning circuit.




Here is a closer picture of the circuit stacked on top of the Arduino.  And here is everything all buttoned-up.

The Arduino takes around 45,000 readings a minute from each of the four current sensors. That may seem like a lot but you must remember that the voltage is alternating 60 times per second so 45,000 readings per minutes is 750 readings per second and if there are 60 cycles per second that is only 12.5 readings per cycle. The Arduino takes the readings and averages them for one minute then stores that number. Then every five minutes it uploads the data to a small computer up in my office. That computer stores the information in a SQL database that I can access via web browser from any computer on my network.

I was a little concerned that I was only getting about 12.5 readings per cycle but the electrical usage that I measure is within less than 2% of what Florida Power and Light reports so it's pretty close, and I think I can get it even closer if I tinker with my calculations a little.




Here is a graph of the electrical usage on a minute by minute basis. The four colors are the four electrical feeds. I know what circuits are connected to what feeds so I can use the information to track down what equipment is using the electricity. I've just gotten this working but there are some features that jumped out at me. Specifically, the blue, yellow, and red lines all have trains of more or less evenly spaced peaks. The blue ones repeat about once every forty-five minutes, the yellow once every two hours, and the red once an hour.

I showed them to Peg and asked her what she thought they were. She said, "What about the refrigerator?" I said it couldn't be that because they each have periods of even units of time, forty-five minutes, one hour, two hours. They must be things that are running on timers. I unplugged my cable box and TV. I unplugged the printer. I turned off the breaker on the security system...nothing. As it turns out they are three different refrigerators. The red one is the one in the kitchen, the yellow one in the outdoor kitchen, and the blue one a small beverage 'fridge that we have in the guest room. Who'd have thought? Well, Peg I guess.

That's it for now. As I said earlier, we're working on a project to measure air conditioner usage and I'll give you an update on that in a later post.


Thursday, December 4, 2014

Housewarming present

I've mentioned in the past that my brother John and his wife Doreen are building a vacation home here in Venice. It was supposed to be done in July, then August, then September. Well, I guess new houses asymptotically approach completion, half way, half way half way but never quite there.  Each time I go by there are a tradesperson or two over there tinkering with something. However, they were down a few weeks ago, and they got a certificate of occupancy and actually stayed in the house. I thought that was official enough to give them their housewarming present.

It's what is sometimes called an ambient device. The idea is that is kind of conveys information to you almost subliminally. For instance, I've seen these small globes that sit on the table in your living room and glow green when the stock market is going up or red when the stock market is going down.

Well, down here in Florida we focus a lot on the weather. Considering how little weather we actually have here relative to the rest of the country it's a peculiar fixation, but it is what it is. Here is a picture of the device. It has two display modes, one is temperature and one is barometric pressure.




Here it is displaying a temperature of 83 degrees Fahrenheit. The top two lights represent the tens place and the rest represent the ones place.





















In Barometric Pressure mode the top light shows the current pressure, the next one down the pressure three hours ago, the next one three hours before that, etc. etc. Here we can see that the current pressure is  between 30.00 and 30.20 inches of mercury, down slightly from three hours ago.
















The device is made from alternating layers of cedar and acrylic. In the center of each acrylic layer is an RGB LED. It's really three LEDs (Red, Green, and Blue) built into one. Each color can be illuminated at 4096 different intensities and thus, theoretically, each LED can display 4096 x 4096 x 4096 = 68,719,476,736 different colors. Of course humans can't discern anywhere near that many colors so I settled on Red, Orange, Yellow, Green, Blue, Indigo, and Violet (Roy G Biv) White and Black (no light at all.)

I went over to Lowes and picked up cedar board meant to be a fence rail and ran it through the planer. Then I cut it into isosceles triangles.













I made some jigs and glued the cedar into squares.





Then I made another jig to drill holes to fasten them together and for the LEDs and wires.

I made a bigger square of cedar for the bottom and hollowed it out for all the electronics. Then fastened them all together.