Humming bear – how to lull a baby
Some time ago I spotted a ‘Humming Bear’ toy (http://myhummy.com/). These are not only a nice bear for baby to hug but it can also generate many noises which helps our baby go to sleep. When my son had about 1-3 months we used white noise sound to calm him down and it worked perfectly. The idea of a device instantly appeared in my head – as soon as I got home I started to build it. What you need is: piezo speaker, Arduino module (I used Nano Pro) and 9V battery.
I used code of Sleepduino project. It worked very well so I decided to use it. Here’s the listing:
— cut here —
int speakerPin = 3;
unsigned long int reg;
const boolean ON = LOW;
const boolean OFF = HIGH;void setup()
{
pinMode(speakerPin, OUTPUT);
reg = 0x0badbeefL;
}void loop()
{
unsigned long int newr;
unsigned char lobit;
unsigned char b31, b29, b25, b24;
b31 = (reg & (1L << 31)) >> 31;
b29 = (reg & (1L << 29)) >> 29;
b25 = (reg & (1L << 25)) >> 25;
b24 = (reg & (1L << 24)) >> 24;
lobit = b31 ^ b29 ^ b25 ^ b24;
newr = (reg << 1) | lobit;
reg = newr;
digitalWrite (speakerPin, reg & 1);
delayMicroseconds (50);
}
— cut here —
All worked fine, device ready for use:
Case preparations:
All seemed fine – my wife created a hippo made all from felt (take a look at her blog) – Joanna Sadowska – Blog Art. Device is hidden its belly, button is easy to feel.
Try it for yourself – you’ll be surprised how quickly can your baby fall asleep.. 🙂