Wednesday, December 13, 2017

Arduino Playground

For testing different modules with the Arduino, I always used one or two breadboards in a cardboard box. But it was always somehow a hassle to store and to move these setups, so I decided to invest a little time to build a more robust "playground". Plus, I wanted to try out a new technique in our wood shop. I decided that the box should have space for an Arduino Uno (one of the $3 pieces from AliExpress, fixed to the box), plus one short and three long and breadboards.
First, I cut the wood for the frame, with a slit to hold the lid. The backside hs two holes (later actually four) for the power and USB connectors of the Arduino. The Arduino Uno is screwed to a thicker piece of wood. 
I used this opportunity to try the new Laser engraver in our wood shop to add the Arduino logo to the lid. The engraving was not perfect, but it was a first try, and it's good enough for this purpose. 
Two smaller pieces of wood are glued to the inside as separators to store cables. As an alternative power supply, I ordered a breadboard power supply (AliExpress, $1). 
This has two inputs, one for a regular power plug, plus a Mini-USB connector. It has switches, and can be set to 5V or 3.3V. It sits on one of the breadboards.

That's it: my new Arduino playground!



Tuesday, October 17, 2017

Building Floating Picture Frames: 30 for 30-in-30

Prologue

Someone started the 30-in-30 challenge, asking people to finish 30 pictures in 30 days. My wife liked the idea, and after a very busy month of September she finished 30 wonderful pieces. Now, all of these need frames. And that's where I enter the story.

Building Picture Frames

Let's start with a sketch, how the frames are supposed to look like. The pictures will float in these frames with a space of 1/4" to all sides. With a thickness of 3/4", this means that the outer size of the frames is 2" larger (in width and in height) as compared to the artworks.
From the hardware store, I got a bunch of 8ft pine boards (10" wide 3/4" thick) and took those to the woodshop. 

With the table saw, I cut pieces 1 1/2" (for the sides) and 1 1/4" (for the back), and glued them to each other. 

With a miter saw, those were cut to the appropriate length for the pictures.
 
Gluing the frames requires a ratcheting band clamp. This cheap one from Amazon continues to do a great job. This is actually the most fun step, when it all comes together.

After that, a little sanding is needed to smooth the corners.
And here is the first half of the "30 for 30-in-30".
Once the second half of the frames is done, the frames will need to be stained and the spacers and the hanging wires to be mounted. 

Monday, April 10, 2017

Analog sound and light detection with the Arduino

I have a few Arduino-based projects which I would like to be able
to respond to sound and/or light. Here is a brief description of my
setup for which the parts cost less than a dollar.

Light

The light part is easy: Connect a  photo resistor (or LDR: Light Dependent Resistor) in series with a fixed resistor, between the supply voltage (+5V) and ground (R5 and R6 in the circuit). Then read the voltage over the LDR with an Arduino analog input.

Sound

For the sound recognition, some cheap modules are available, like this one from Amazon. The disadvantage is, however, that these only provide the digital information whether the sound level is below or above an adjustable, but fixed threshold. For my purposes, I prefer an analog signal, based on which I can compute average values (to take into account the noise level in different situations) and identify significant upwards variations as the signal.
To get an analog signal, I used circuits that I found on the web, with some modifications, and the result is shown in the image. The circuit is based on an electret microphone capsule (10 pieces for $1.24 at Aliexpress), a 2N3904 transistor, four resistors, two capacitors, plus a diode. An additional capacitor C1 is used to stabilize the supply voltage. The electret microphone is polarized. It is important to connect that pin to ground which is also connected to its case. The amplifier circuit is made of C1, R2, R3, and T1. The diode clips the negative part of the signal and C2 and R4 form a RC circuit that stores the peaks for a time interval equal to t=R*C, which is 0.01 sec for these choices.
The microphone capsule and the photo resistor are soldered at the bottom of the circuit board on a piece of black felt, so one can not see the circuit board through the openings for the microphone and the photo resistor. The "sound-out" and "light-out" outputs are directly connected to two analog inputs of the Arduino.