Smart Alarms with accessibility function (deaf)

Going to do my best here, half asleep when this idea hit me

I sleep without my hearing aids, now I do use the light functions but this is not always ideal when it also wakes up my partner extra grumpy and peeved being up earlier on on non work morning. Currently I use a bed shaker but it would be good to somehow put together a smart bed shaker that I could integrate with, it would be great if some mornings I that might need to be up earlier for some event scheduled in the calendar, for an extra get the hell up, there’s fire, or have two vibration patterns, one for meds and one for get out of bed unless I’m already out of bed.

Basically… y’all got any idea how I could go about getting or making a smart bed shaker with integration that a novice like me could put together?

I have never seen a bed shaker, but I assume it’s an oversized version of what is in a phone.
And that seems simple to add an ESP to.
But since I’m not sure about the input voltage or if it’s even possible to rewire then it’s hard to answer.

Talking about the one I have currently, you’re right, it’s a small motor with off-set weight, covered in a plastic housing. I am not sure of the needed voltage either, most likely either 5v or 12v.

So how is it wired?

You have an alarm I guess, the old type by the bed connected with wires to this shaker, and the shaker has a power adapter also?

Yes, I just tried to find my retired vibrating pad, I think it’s currently packed away (moving in a few weeks) I was able to find the model of my retired alarm clock with bed shaker that I could use for this. Shop Sonic boom Sweetheart Bed Shaker Alarm Clock Online

Answers the earlier question too, it’s a 12v motor

Edit: The vibrating pad itself doesn’t have a power adapter, just the alarm clock itself that send power to the connected pad

Sweetheart alarm clock with 113 dB alarm. Yeah… that’s a sweetheart.

I looked at the manual and found the plug just goes directly to the clock as you say.
The manual is not very clear about this part here:

Do you have access to the motor itself to check what the writing is on the motor?
If there is anything about it’s consumption in watt or A.

What is your thought on how this should work?
Do you want to get rid of the sweetheart and just use the bed shaker together with a phone alarm time?
Or do you want the alarm clock to function as normal and have just extra control of the shaker?

Found it, this all I can tell you about the motor:


It’s 12 volt motor, the clock takes 9v and 900mA power supply

As for function, primarily I want to get rid of the clock (sweetheart) part and have it so home assistant can trigger the pad in pulses. Bonus is if it can have additional patterns of pulses of varying strength.

First thing I would do is to make sure you have 12 volt in the red and white cable when the alarm goes off.
You probably need help with measuring this with a multimeter since that thing will not be still.

When that is confirmed then there is a few options.

1 you add a smart plug and a 12 volt adapter (or just the one from the clock and wire the adapter to the shaker cable).
This is a very simple solution, turn on the plug and the bed shakes. You have some limited pattern possibilities I guess, the delay in the smart plug is the limiting factor here.

2 Use a shelly or sonoff relay to do pretty much the same as above.

3 use an ESP8266 or ESP32 to control a relay, again the power adapter you have will work fine.
You can probably add a buck converter to take the 12 and convert it to 5 volt the ESP needs.
This method gives you more control but also requires soldering. While you are at it, I would advice to add a bed sensor also to make sure you get out of bed when you should.

I’m not sure if we can vary the strength of the pulses but pattern is with on/off times.
Perhaps if the motor gets a lower voltage will it create a different strength?

I don’t mind soldering, I’m just bad research and deciding on components, along other things.

So, looking at your options, I do like the idea of ESP32, I wonder if it could be matched up to a speed/dc controller?

Digging deeper, I’m fairly sure it’s a 6-12v DC brushed motor, set to run at 9v ish. I don’t have the original 9v power adapter, I’m sure I can find a spare somewhere to adapt. Get a barrel plug of two different size, one for power into… buck converter and speed controller, maybe and buck convertor step down to 3.3v, the other barrel plug from motor controller to motor?

Just cut the wires… You don’t need the connectors.
If you know how to solder then connectors are not required.

If it’s 6-12 volt then I would get a 12 volt 1A (since the included was 9 volt 900 mAh (?))
Something like this:
NOYITO PWM to Voltage Module 0%-100% PWM to 0-10V Voltage Suitable for Signal Interface Switching for PLC or Other Industrial Control Boards: Amazon.com: Industrial & Scientific
It’s only going to give you 10 volts, but this is what I found from a quick google search.

Now that I’m awake, and had a chance to re-read and using what I learned:

I’m thinking my shopping list is:

  • ESP32
  • Development Board
  • L298N
  • Button(s?)
  • 2 Barrel plug+Jack of different size\type1
  • Power supply of 12v 3a

1 For breakaway reasons and different size/type because knowing me, I may accidentally put the power in the wrong jack

Then my steps is for success is this,

  1. Get parts
  2. Wire\Solder
  3. Code
  4. ???
  5. I’m awake, I think

Looks good.
Did I read it correctly that the L298 has a 5volt output also? That’s great!

I would definitely add some type of bed sensor while you are at it.
This can be as simple as a long FSR and a resistor.
Or a pressure mat.

What do you mean by development board?
Do you mean a bread board? They are generally not supposed to used with “high current” components as motors.
It’s better to use perfboard since you can solder enough thickness in the connections.

I went and confused myself a little, I remember reading ESP32 (and the likes) refers the chip part and to get started with ESP32 I should get the development board… I’m referring to… Espressif ESP32 Development Board - Developer Edition : ID 3269 : $15.00 : Adafruit Industries, Unique & fun DIY electronics and kits

I am thinking about that, but decided to delay it to avoid overwhelming myself. I could add it later, although a glancing thought over it, it’ll have some edge cases to overcome.

1 Like

Just to be clear, there are cheaper ESP32.
And you can use a ESP8266 also, but this only have one analog pin

1 Like

really? I don’t really know what’s out there in terms of ESP32, choices overwhelming~

Looking at amazon I found some for $5.
But they are shipped with a raft.

But there are probably places locally that is cheaper than adafruit if I was to make a guess.

Hi. I’m in the damn same silence boat as you. All the vibrating pillow options are either available in a closed eco system.

For me the Shelly option sounds like an option. You made any progress ?

I’m literally in this same same boat too and went along a similar process. Was looking at the same brand of shaker too. Lol.

Was thinking of starting off with a direct 12v input activated by a ZigBee smart plug , then was thinking what about pulsing as that would be better than just full speed on and off control.
Then moved on to thinking an esp32 too.

Interested to see if anyone completed some sort of build. If I do mine I’ll post here.

1 Like

Let me know if you finish yours. I too was looking at trying to hook up the bed vibrator to HA. I’ve used the sonic boom alarm clock for years, but after we moved, I started up HA and I’ve wondered if I could get a bluetooth, or ESP32 enabled vibrator for my bed and ditch the alarm clock unit.

@teek541 Yeah, I’ve just completed mine and finalised a few extra things in the code.

Went with an ESP32 (i had lots of spare ESP32-Cam’s lying around so just used one of them), and an L298N motor driver. Connected up to a Geemarc CLA2 with the connector chopped off (I think that’s the same unit a sonic boom clock uses).
Then, ESPhome flashed to the ESP32 and a bit of messing around with the code and i’ve now got a switch I can call in automations, as well as the ability to preset the motor speed and a vibration pattern - admittedly only basic patterns.
As i use sleep as android, and the custom component in homeassistant, I just have my automation trigger the vibration switch while my phone alarm is ringing.

Wiring is like this, but be wary of what gpio pins you connect the speed (EN), forward (IN1), and reverse (IN2) to:

Also if you’re powering the ESP from the stepdown on the l298n then make sure the jumper is set to output 5v like in the image.
Threw all this in to a small electronics box I 3d printed. I might eventually design a proper box for it but would be kinda bespoke for the esp32 unit I used. And had a 12v PSU to hand with a barrel jack from an old powered usb hub.

Then, the bulk of the code I used in ESPHome:

##############

# Set these to whatever GPIO pins you used on the ESP32 end
output:
  - platform: ledc
    id: motor_forward_pin
    pin: GPIO12
  - platform: ledc
    id: motor_reverse_pin
    pin: GPIO13
  - platform: ledc
    id: motor_enable
    pin: GPIO15

fan:
  - platform: hbridge
    id: shaker_motor
    name: "Shaker Motor"
    pin_a: motor_forward_pin
    pin_b: motor_reverse_pin
    enable_pin: motor_enable
    speed_count: 20
    decay_mode: slow
    internal: True

number:
  - platform: template
    name: "Vibration Level"
    id: vibration_level
    optimistic: True
    restore_value: True
    min_value: 0
    max_value: 100
    step: 5
    initial_value: 50

globals:
  - id: selected_mode
    type: int
    initial_value: '1'

select:
  - platform: template
    name: Mode
    id: mode
    options:
     - "1.0s"
     - "0.5s"
     - "0.25s"
     - "Pulse"
    initial_option: "1.0s"
    optimistic: True
    restore_value: True
    # set a global variable with easier to manage mode as numbers
    on_value:
      then:
        - lambda: |-
            if (x == "1.0s") {
              id(selected_mode) = 1;
            } else if (x == "0.5s") {
              id(selected_mode) = 2;
            } else if (x == "0.25s") {
              id(selected_mode) = 3;
            } else if (x == "Pulse") {
              id(selected_mode) = 4;
            }
        - logger.log:
            format: "Selected option: %s"
            args: ["x.c_str()"]

switch:
  - platform: template
    name: "Vibrate"
    id: vibrate
    optimistic: on
    on_turn_on:
      then:
        - if:
            condition:
              lambda: 'return id(selected_mode) == 1;'
            then:
              - script.execute: vibrate_slow
        - if:
            condition:
              lambda: 'return id(selected_mode) == 2;'
            then:
              - script.execute: vibrate_fast
        - if:
            condition:
              lambda: 'return id(selected_mode) == 3;'
            then:
              - script.execute: vibrate_very_fast
        - if:
            condition:
              lambda: 'return id(selected_mode) == 4;'
            then:
              - script.execute: vibrate_pulse

script:
  - id: vibrate_slow
    then:
      while:
        condition:
          switch.is_on: vibrate
        then:
          - fan.turn_on: 
              id: shaker_motor
              speed: !lambda |- 
                  float calc_speed = id(vibration_level).state /5;
                  return calc_speed;
          - delay: 1000ms
          - fan.turn_off: shaker_motor
          - delay: 1000ms
  - id: vibrate_fast
    then:
      while:
        condition:
          switch.is_on: vibrate
        then:
          - fan.turn_on: 
              id: shaker_motor
              speed: !lambda |- 
                  float calc_speed = id(vibration_level).state /5;
                  return calc_speed;
          - delay: 500ms
          - fan.turn_off: shaker_motor
          - delay: 500ms
  - id: vibrate_very_fast
    then:
      while:
        condition:
          switch.is_on: vibrate
        then:
          - fan.turn_on: 
              id: shaker_motor
              speed: !lambda |- 
                  float calc_speed = id(vibration_level).state /5;
                  return calc_speed;
          - delay: 250ms
          - fan.turn_off: shaker_motor
          - delay: 250ms
  - id: vibrate_pulse
    then:
      while:
        condition:
          switch.is_on: vibrate
        then:
          - fan.turn_on: 
              id: shaker_motor
              speed: !lambda |- 
                  float calc_speed = id(vibration_level).state /5;
                  return calc_speed;
          - delay: 250ms
          - fan.turn_off: shaker_motor
          - delay: 250ms
          - fan.turn_on: 
              id: shaker_motor
              speed: !lambda |- 
                  float calc_speed = id(vibration_level).state /5;
                  return calc_speed;
          - delay: 500ms
          - fan.turn_off: shaker_motor
          - delay: 250ms
          - fan.turn_on: 
              id: shaker_motor
              speed: !lambda |- 
                  float calc_speed = id(vibration_level).state /5;
                  return calc_speed;
          - delay: 1000ms
          - fan.turn_off: shaker_motor
          - delay: 500ms

Then after adding in to homeassistant via discovery you have a device with these controls:

2 Likes