First Project Ever. Vibrating Alertness Alarm

Hi,

I'm new to Arduino and basically a stranger to most programing. I am an industrial designer working on an ocupational theorpy project for a client with Multiple Sclerosis. The problem I am tackling is that he falls asleep a lot in casual settings and wants an alarm type device that will keep him awake. I want the device to be hand held and fairly discrete (so as small a board as possible will be best). The program will be fairly simple. When turned on I want the device to begin to vibrate at random intervals and only turned off when he presses a button.

I am planning on reading up on the programing side of things and teaching myself as much as possible but I need some advice about which board to buy. What is the smallest stand alone board I can buy? If there are smaller boards that require some other piece can I somehow modify them to be semi stand alone?

I may check back in later for programing advice.

Thanks,

-Coby

Would a sound in the ear do? Using an ear bud that would take less power so less battery, smaller, lighter, etc.

Otherwise cheap, small, low power, noticeable vibrator would be a small DC motor that turns an off-center weight. The final package if using a surface mount ATtiny could be very small and be worn like a semi-thick (depending on motor) wrist watch.

You could try a piezo-based vibrator but I dunno if that little bit would wake me up.

Sound in the ear was an idea originally but we decided that since this problem effects him mostly while talking to other people an audible alert would be too distracting. How much power can I run thorugh the ATiny? My non-programable mockup used 1.5 volts and was that seemed like enough. Also can I program the ATiny with Arduino software? How does that unit get connected to sensors and motors and such?

Thanks,

-Coby

Why not model this after the alarms they use in cars to sense a driver falling asleep?

But, yes, you can program ATTiny's with Arduino. But you need to add these files: Google Code Archive - Long-term storage for Google Code Project Hosting.

And to run a vibrator motor, you just need a transistor and a resistor since you only need to spin in one direction: http://www.me.umn.edu/courses/me2011/arduino/technotes/motorswitchled/index.html

For sensors, it depends on what sensors.

Maybe there's a change in pulse or skin resistance when the patient nods off? Then it won't have to be a persistent occasional stimulus.

I suggest the tiny's because the are small (surface mount, less than 6mm square), have few pins and at low but more than you need speed ...

• Low Power Consumption
– Active Mode:
• 1 MHz, 1.8V: 300 ?A
– Power-down Mode:
• 0.1 ?A at 1.8V

It's the wake up kick that may eat your battery. But you may find a way around that.

A simple DC motor just needs power. That's 1 pin ON or OFF and ground. Button... could be 1 pin or 2 for some forms of touch-sensor (capacitive sense, piezo disk, etc) that IMO have way longer lives than moving-part types.

Yeah, if you have the core files for the chip, Arduino IDE can program just about any AVR.
MIT High-Low Tech:
http://hlt.media.mit.edu/?p=1695

CobyUnger:
The program will be fairly simple. When turned on I want the device to begin to vibrate at random intervals and only turned off when he presses a button.

Instead of random time could you use accelerator sensor that triggers when the arm/wrist movement stops for X amount of time.

You can buy very small vibrating motor, used in cell phones, search for "vibration motor" on ebay.

Not sure how to detect someone dozing off, but I think your idea of random alarm that requires him to turn it off might just be good enough.

Develope it on Arduino and then turn it into 8-pin app is definitely huge, as many have already suggested.

Thanks for all the help so far guys. I'm really new to this, so I apologize if my questions are so amateur.

If I understand correctly from what I've read so far I will need the ATtiny, an Arduino, and A breadboard, A ATtiny programer board, and a commercial programmer board and all the components I intend to use on the device it's self. Is this correct? Do I really need all of this?

Thanks agian,

-Coby

You can use an Arduino as an ISP to program the ATtiny. Do you already have an arduino board?

No but I was just about to head out to RadioShack to buy one. What else will I need?

Well, start with just an Arduino Uno for devlopment. You can take your code and put it in the Attiny later. You will need some NPN transistors with a CE current high enough for your motors, some resistors (they should sell an assortment pack) a vibrator motor, and a small breadboard.

That will get you started. Once you have it all developed, then look for an appropriate perfboard and enclosure and whatever accessories you need. Radioshack used to sell a little keyfob enclosure that would probably be enough to house everything.

i m using those from http://www.sonicalert.com/products-alarm-clocks-all.html. i have one of them. i love it. let you know the vibrating input is 12 volts.

So I've got my code and circuit basically figured out. I think I'm ready to load this onto a smaller unit. What exactly should I buy? There seem to be countless ATtinys out there. I only need to hook up a battery, button and motor plus the related resistors and such.

You should start by determining how many I/O pins you need, how much flash and RAM.

Very minimal flash and ram. The code is embarrassingly simple. In terms of pins I will need one in and one out plus ground and power I suppose. Speaking of witch, how do I run power into the ATtiny?

Sorry for all of the beginner questions. A book is on order so I'll be asking fewer questions soon.

Very minimal flash and ram. The code is embarrassingly simple. In terms of pins I will need one in and one out plus ground and power I suppose.

You might get away with the Tiny45, or less. They're cheaper.

Your end product should use surface mount and I gotta warn you, that's not beginner easy to use. There are people here who do that stuff and might save you in time alone more than the cost, so check around about that. Just before you "go to board" make real sure you have a good, solid circuit which you can use a larger DIP chip to prove out. Don't rush it, be sure before you carve in stone.
I think that Frank Zhao may still be a member here, and he's not the only one that can do things like this USB business card (check the size of the Tiny and parts on that!):

OTOH you might find something already out from China that you can reprogram and use.

Speaking of which, how do I run power into the ATtiny?

About 3/4 the way down on the MIT page shows pinouts. The 45 and 85 power pin is on the upper right when the notched end is up.
http://hlt.media.mit.edu/?p=1695

The 45 and 85 power pin is on the upper right when the notched end is up. You will be using a battery I am sure, start checking into disk batteries and rechargeable li-ion types used in small MP3 players. You should not need a regulator except on a charger. Pick the right charger for price and voltage or go with cheap (in the short run) eco-bad disposables.

Sorry for all of the beginner questions. A book is on order so I'll be asking fewer questions soon.

Book is nice to have but for just this project you didn't really need it... but it may help. What you also want is the datasheet and maybe an application note from the ATMEL site. ATMEL makes the chips and do have a lot of free support. The hard part is finding just the stuff you want, they make a lot of different chips!

Main site:

ATtiny's. This page will help you pick and choose, for sure.

Sometimes you will have to dig at bit.