Introduction: Laundry Alert With the LinkIt One

Laundry can be a bit of a drag. The laundry in our house is on the 2nd floor. While that is nice for moving big piles of clothes from the bedroom to the washer (they are right next to one another), it is quite a pain when I can't hear the washer from downstairs. My clothes sit there and mildew for a while before I finally remember I put them in there and rush to go put them in the dryer.

Well, that all changes with the LinkIt One. The LinkIt One is like a super charged arduino. It has WiFi, Bluetooth, and even GSM capabilities. This allows me to insert a sim card and have the LinkIt One send me a text whenever the laundry is done. No more clothes sitting wet for hours on end!

Step 1: Gather Supplies

For this Instructable you'll need the following:

  • LinkIt One Media Board
  • Pre-paid Sim (or you can borrow from a friend just to test)
  • SparkFun Triple Axis Accelerometer Breakout - MMA8452Q
  • Two 330 ohm Resistors
  • a few wires for some soldering

Step 2: Configure Your LinkIt One Board

We'll need to modify some of the switches on the LinkIt One board in order to make it work. Along with the image attached, make sure that you have done the following

1. Set the MS -- UART switch to UART

2. Set the USB -- BAT switch to USB

3. Set the SPI -- SD switch to SPI

Step 3: Insert Your SIM Card

I know that most people probably don't have a pre-paid SIM card laying around. If you are just prototyping and want to see a proof of concept, feel free to remove it from your current cell phone (or one of your friends) just to try it out. If you get serious and want to make this a full-time gig, you will have to pony up for a pre-paid SIM.

Inserting the SIM card is a fairly straight forward process. Flip over your LinkIt One and look at the smaller big metal piece. You can see in the figure where I inserted my SIM card if you are confused.

After you have inserted the SIM card, be sure to attach your GSM antenna that came with your LinkIt One kit. This will allow you to get a cell signal.

Step 4: Solder the MMA8452Q (Accelerometer )

The Accelerometer from Sparkfun comes without being actually connected to anything. We'll need to solder some header pins to make it easier to work with. In the picture included you'll see a picture of both the Accelerometer and the Header pin. Because it's difficult to hold a camera and a solder gun at the same time, I wasn't able to include any pictures of that process. If you're confused on how to solder, there are some excellent instructables that have great visuals.

Step 5: Wire Your Accelerometer to Your LinkIt One

Follow the attached diagram to connect your Accelerometer to your LinkIt One. Unfortunately, Frizting doesn't have a built in board for the LinkIt One yet, so I wasn't able to provide the concrete board in the schematic. Instead I just wrote "LinkIt One SDA" and "LinkIt One SCL". If you don't know where these connections are on your LinkIt One board, refer to the 2nd diagram which clearly labels them.

Step 6: Deploy Code to LinkIt One

Deploy the attached code to your LinkIt One. You will need to adjust certain parameters, such as the cell number to text when the laundry is done. If you need help deploying to your LinkIt One, I suggest you take a look at some of these resources.

The main logic of the code checks for the G-force, or change in acceleration. We basically want to check if the laundry machine is moving rapidly back and forth, compared to standing still. If it is moving back and forth, we assume it is 'ON'. Once we see that it goes from a positive acceleration to none (it stops moving), we send an alert text message to send the text message and notify you that it is time to get the laundry.

void loop()
{ if (accel.available()) { // First, use to read the new variables:;

//Use this to debug your Code printCalculatedAccels();

int curAccelDifference = accel.x - prevAccel;

//If we see large G-force (change in acceleration) // And we haven't sent a laundry text message, then send a text! if(curAccelDifference > 2.00 && !AlertLaundryFinished) { SendLaundryDoneAlert(); } else //Laundry sTarted { AlertLaundryFinished = false; }

Serial.println(); // Print new line every time. } delay(10000); //Put a significant delay in here so we know when Laundry is done moving }

Step 7: Deployment

Tape that sucker onto your laundry machine and you're in business!