Technologist and Maker

I am building a large Arduino-based project and want to incorporate music from the circuit board that I ripped out of a Hallmark card that plays music. This blog entry is a guide to build a simple way to control the Hallmark circuit from the Arduino. In order to build this project you will need the following parts/components:

Hallmark (or other brand) card that plays music

Arduino microcontroller (I’m using the Duemilanove)

RadioShack Reed Relay (part number 275-232)

Breadboard

6 short pieces of insulated wire

Soldering gun & solder

In case you are not familiar with these musical Hallmark cards or have not torn one apart, inside the card there is a small circuit board containing a battery and a small speaker. On the circuit board, there is a piece of plastic (that acts as a switch) that slides back and forth when you open and close the card. When the card is closed, the plastic is separating the two contacts and therefore not playing music. When the card is opened, the plastic piece allows the two contacts to touch, and results in music playing. All cards are pre-programmed with music and the card I chose has a 25 second clip of “Over the Rainbow”.

This project has two primary goals:

Power the Hallmark circuit board from the Arduino with +3V so I don’t have to worry about the battery dying

Use a digital pin on the Arduino (and a reed relay) to control the music

Below are the steps to control the card’s circuit board and play music from the Arduino:

Carefully tear apart a Hallmark card that plays music and remove the circuit board and speaker. Take care when removing the board and speaker because they are usually glued to the inside of the card.

Remove the battery and carefully tear off the top bracket that holds the battery down. Double check how the battery is inserted into the circuit board and note the positive and negative sides. On my board, the negative side of the battery is pressing down onto the circuit board (negative) and the positive side was facing up and had a connection to the battery bracket (that I just tore off). Once the battery bracket is removed, you will see where it was riveted (positive). Note the positive (red wire) and negative (black wire) locations as you will need to solder a lead to these two locations shortly.

Locate where a piece of metal is anchored to form a switch when it is allowed to press down. And stops the music from playing when it is raised or separated from the contact below it on the circuit board. The location where the metal switch is connected must be soldered to connect to one side of your reed switch (blue wire). The location where the metal switch makes contact (and results in music being played) to the circuit board is the location where the second end of your reed switch will be soldered (green wire).

Solder your wires as described above and as displayed below (note the white wires were already soldered for the speaker).

Hallmark Board Soldered

Wire up the modified board to your Arduino as follows:Red: Connect to the Arduino 3V pin. NOTE: take care to not connect this to the 5V pin as it may damage the Hallmark circuit board.
Black: Connect to any Arduino ground pin.
Blue: Connect to on side of the COM connection on the reed switch (post on end of switch with just 1 pin).
Green: Connect to the N.O. connection on the reed switch (center post on switch on side with 3 pins). Below is the schematic:

Schematic

Once all connected, it should appear similar to the photo below:

All Wired Together

The final step is to plug your Arduino board into your computer, compile & load the following sketch onto the Arduino and verify everything works as expected.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

<span style="color: #808080;">/*

Example to turn on a Hallmark card's music using the Arduino.

Author: Matthew T. Mead (www.matthewtmead.com)

*/

voidsetup(){

pinMode(2,OUTPUT);

}

voidloop(){

digitalWrite(2,LOW);// switch reed relay to turn on music

delay(25000);// adjust to hear the entire song

digitalWrite(2,HIGH);// turn off music

delay(5000);// pause for a bit

}</span>

Note that I chose 25 seconds for the initial pause because that is approximately the amount of music that is played by the card that I chose. You should experiment to find out the right length for your card. Then customize this program as playing the song over and over in a loop will drive you mad. I’m planning to use this hardware and software technique to play music from a larger Arduino electronics project.

Anyone who uses Outlook tasks and notes and an iPhone knows the pain of not being able to sync tasks and notes over-the-air from Exchange to the iPhone. I was surprised when I first realized that the Exchange client oin the iPhone only syncs email, calendar and contacts and does not sync notes and tasks. I was surprised because I assumed it would be like any other Exchange client and sync tasks and notes as well. Initially, not being able to sync notes did not seem like a showstopper. But over time it became more and more problematic as I was unable to access notes from Outlook that I have become dependent upon.

Evernote

A colleague introduced me to Evernote (see evernote.com). Evernote is a service that allows you to save notes containing various types of media to a central, cloud-based service. The notes are available for viewing and editing using a variety of applications including: traditional web, iPhone, Windows dand Mac. Best of all, the service and clients are free if you do not exceed a (fairly generous) disk space allotment. Notes that are created or edited on any platform are quickly and efficiently replicated to all clients.

Moving Existing Notes

Evernote has two built-in mechanisms to import data:

Import Evernote import/export files

Extract notes from Microsoft OneNote

I found myself in a bind. I had over 125 notes in Outlook 2007 (I was not using OneNote) and could not find an existing way to import these Outlook notes other than to copy and paste each note, one-by-one, into my Windows Evernote application. So I wrote a program to convert the Outlook notes into a format that can be imported into the Evernote Windows client (Note: as of this writing, the Mac Evernote client does not support this import feature).

My Outlook to Evernote (OL2EN) program takes an exported Outlook 2007 Notes file in Windows CSV format as input and creates an Evernote compatible import/export XML file as output. The Evernote import/export file can then be imported into the Evernote Windows client.

The complete steps to get started and import your Outlook 2007 notes are detailed:

Download Evernote iphone client from the Apple App Store (the app is free)

Download and install the Evernote Windows client from the evernote.com site (the app is free)

Create a free account on evernote.com. You can do this from iPhone application or on evernote.com website.

Export notes from outlook in windows CSV using the following steps:
a. Click on Notes in Microsoft Outlook 2007
b. Select File | Import and Export…
c. Select ‘Export to a File’ in the resulting Import and Export dialog and click Next
d. Select ‘Comma Separated Values (Windows)’ and click Next
e. Make sure that ‘Notes’ is selected in the hierarchy and click Next
f. Type in a location and filename (ending in .CSV) for your Outlook notes export CSV file and click Next
g. Leave the default mappings on the final dialog and click Finish (your file will be created)

Create an Evernote XML import/export file using my tool using the following steps:
a. Download the OL2EN application and run it (note that it requires the Microsoft .NET runtime)
b. Run the program and select the CSV file you created in step 4 in the ‘Outlook Export File’ field
c. Type in the name of the Evernote XML file you want to generate in ‘Evernote Import File’ field
d. Leave ‘Ignore header row (first CSV row)’ checked as the first CSV entry from the Outlook 2007 export is a header row
e. Click ‘Generate’. A success dialog should indicate how many notes were converted.

Import the Evernote import/export XML file using the Evernote Windows client application using the following steps
a. Start the Evernote Windows application
b. Select File | Import | Evernote Export Files…
c. In the resulting File Open dialog, browser for and select the Evernote import/export file created in step 5 and click open. If the import is successful, you will see a success dialog indicating the notes were imported into a separate notebook inside Evernote. Contratulations! In the event of a failure to import, your import notebook will be empty and you will not see a success message. Unfortunately, there doesn’t appear to be any information provided by Evernote, but is is likely that the XML file is malformed.

OL2EN is free to use for commercial or non-commercial purposes. If you find OL2EN useful or want me to add any additional features, or run into any errors, please post a comment. OL2EN saved me from a lot of typing. I hope someone else can make use of it as well…

Some of you are blessed with the ability to drink coffee or tea at temperatures that seem to be approaching the temperature of lava. Unfortunately, I’m always trying to find ice or cold water to cool down my drink whether I just brewed it at home or bought coffee from a cafe.

So it is not surprising that a Smart Coaster Popular Science Build It project by Dave Prochnow caught my eye. This is a pretty simple circuit that uses a thermistor to measure the temperature of your hot drink. You calibrate your coaster to illuminate an LED while the temperature of the drink is too hot and to turn off the LED once the temperature reaches the point where it is cool enough to drink. I like the author’s use of a shoe polish container, but all I could get my hands on was an ever-so-versitile Altoids container.

Like the author explains, once you have your circuit built and tested, you need to calibrate your potentiometer to turn off your LED just when the temperature of your drink is ready to drink. I taped my thermistor to the underside of the top of the metal enclosure, but still found it a bit tricky to get the potentiometer set properly. When you are calibrating, you need to make sure you use the same type of coffee cup or else you will get very inconsistent results.

My finished product is below. As you can see, the LED sticks out the front and I also have my potentiometer sticking out the side of the enclosure. With the Altoids box, it is easy to have wires hang outside, but be careful as repeated open and closing quickly wears away the insulation on the wires!

I initially prototyped the circuit on a breadboard, like I do for any new circuit I’m building or experimenting with, and used a plastic (note metal would not be good here given that it would conduct and cause your battery to get extremely hot!) chip clip to hold the positive and negative leads onto each side of the flat, disc-shaped battery. In the enclosure I built a home made 3.7V battery holder by putting the battery in the top of an old 35mm camera film case and used hard plastic to cover the bottom. I cut a small hole in the top and bottom to route a wire with a long, uninsulated lead (that was swirled into a spring-like shape) into each side of the battery enclosure. Finally, I taped the home made battery enclosure with electrical tape to keep the positive and negative wires snug against each side of the battery. It looks pretty ugly, but works great.

Below is a picture of the inside of the enclosure where you will see the battery holder on right side, the tangled mess of wires and the thermistor taped with electrical tape to the bottom of the lid:

And I used the dead bug method to solder the LM324N Integrated Circuit (IC) into the circuit. This is a technique that is popular in robotics where space is limited. This technique is nothing more than turning the IC upside down, with the legs sticking up (so it looks like a dead bug on its back with its legs up in the air) and soldering your connections directly to the legs of the integrated circuit chip. If I had an IC socket handy I would have used the dead bug technique to solder directly to the empty socket and would have avoided the risk of damaging the circuit by soldering it directly. Fortunately, I did not damage the IC by soldering directly to it. By clipping the unused legs of the IC, it made it a bit easier to solder directly to the IC legs.

Finally, I’d highly recommend that you use a stripboard or create a printed circuit board for this circuit. The article does not advocate the use of a board and in the excitement to build the smart coaster I did not use a board…but shortly into the project remembered how frustrating it can be to solder everything together and then struggle to get the circuit into its enclosure without breaking any solder joint. With a strip or circuit board the circuit would easily sit in the enclosure with the LED, thermistor and potentiometer connected via lead wires.

In retrospect, I also recommend that you use very light gauge wire for any wires that will require flexibility and that you intend to move around. Otherwise, you end up breaking solder joints as you move the components around.

A few items worth noting if you are building this project:

You can always identify leg 1 of an IC by finding the dimple in side of Integrated Circuit (IC) and then finding the first leg that is counter clockwise to the dimple. Sometimes, leg 1 also has a dot of paint near it. My LM324N IC had the dimple, but not paint. Below is the block diagram that displays the dimple at the top and leg 1 on the top left.

I recommend that you purchase a battery holder for your 3.7v battery. Here is a battery holder available from SparkFun.com. You will still need to wrap your battery and holder in lots of electrical tape to make sure a metal holder does not conduct against the side of the smart coaster (assuming your enclosure is metal).

I would highly recommend that you use a heat sink if you are soldering your IC using the dead bug technique. This will draw heat from the leg and minimize the chance of damaging your IC.

Whether you use a board or not, you should make sure you have a helping hands or other desktop vice to hold your parts in place while you are soldering.

Get some heat shrinking insulator material and slip the heat shrink tubes on your wires prior to soldering. This way you can easily cover your soldering joints and exposed metal inside your crowded, metal enclosure. And for places where you cannot easily use heat shrink tubing, use plenty of electrical tape.