Physical Buttons for Zoom

by tuenhidiy in Circuits > Arduino

2630 Views, 13 Favorites, 0 Comments

Physical Buttons for Zoom

Title_1.jpg
Title_2.jpg
Physical Push Buttons For Zoom Meeting

Due to the COVID-19 pandemic, my children had to learn online from home via Zoom App. After a few observations, I found that my little daughter had difficulty with keyboard and mouse operations because her desk was filled with notebooks, textbooks, pens, rulers and school supplies. Sometimes she missed answering questions when the teacher called her name because she was slow to use the mouse and keyboard. So I made her a physical push-button box controlled by Attiny85 that connects via the laptop's USB port to help her study better.

Supplies

First of all, I would like to thank the JLCPCB for supporting me on this project. If you have a PCB project, please visit the JLCPCB website to get exciting discounts and coupons:

⦾ JLCPCB PCB Prototype only $2.

⦾ Get $24 Register Coupon Get $24 Register Coupon herejlcpcb.com/cyt

Main materials:

⦾ 1pcs x DigiSpark ATTiny85.

⦾ 1pcs x M5StickC (Optional).

⦾ 4pcs x Mini Round Momentary Push Button.

⦾ 1pcs x Double Sided DIY Protoboard Circuit 5x7cm.

⦾ 2 meters x 5 Cores Cable.

⦾ 1pcs x Cable Gland. It is based on 5 core cable size.

⦾ 4 pcs x R10K.

⦾ 3 pcs x R22K.

⦾ 1 pcs x R200K.

⦾ 1pcs x Male & Female Header.

⦾ 1pcs x PVC Pipe Cross Ø21mm.

⦾ 4pcs x PVC Pipe End Cap Ø21mm.

Schematic

ATTINY85_DIGIKEYBOARD_SIMPLE_bb.jpg
Calculated.jpg

In this project, I used DigiSpark ATTiny85's reset pin (PB5 or ADC0) as the multiple analog buttons without setting Fuse Bits. The schematic is as follows:

ATTiny85 & pushbuttons in this project works like an USB HID (Human Interface Device) keyboard. There are 4 pushbuttons and their functions describes below:

Center Button: Enter (short press less than 1 second) or Exit (press and hold more than 2 seconds) the Zoom meeting window.

Audio Button: Mute/ Unmute my Audio.

Video Button: Start/ Stop Video.

Hand Button: Raise/ Lower Hand.

The table below shows the voltages and analog values at ATTiny85's PB5 pin corresponding to each push button when it is pressed:

With this hardware config, PB3 (USB+), PB4(USB-) and RESET (PB5) pins are used and I have 3 pins left for further development:

PB0 (SDA) and PB2(SCL): can be used for I2C related further development applications.

PB1(PWM1): can be used for PWM control.

⦾ Or PB0 (MISO), PB1 (MOSI), PB2 (SCLK): can be used for SPI communication.

Assembly

Prepare PVC pipe fittings Ø21mm: one cross and four end caps.

Drill holes on 3 end caps and install 3 green push buttons.

Drill hole on the PVC cross center and install red push button.

Mount cable gland on the remaining end cap.

Solder 5 cores cable to 4 push buttons, joint 4 PVC end caps and cross together.

Cut the PCB 5x7cm in half, solder the resistors, 5 core cable at the bottom and mount this PCB on a small acrylic sheet, fix the 5 cores cable by cable tie.

Female headers for ATTiny85 were soldered on the PCB top. The I2C pull-up resistors 10K and 8-pin male header for M5StickC were also soldered for further development.

Plug DigiSpark ATTiny85 on the PCB control board. DONE!!!

Zoom Keyboard Shortcuts

Download and install Zoom Client for Meetings software in my computer.

Open Zoom ‣ Settings ‣ Keyboard Shortcuts

Record the shortcuts that I want to use for my buttons, in my case, they are:

⦾ Mute/ Unmute My Audio: Alt + A.

⦾ Start/ Stop Video: Alt + V.

⦾ Raise/ Lower Hand: Alt + Y.

⦾ Close Current Window: Alt + F4.

For the kids we can set up the following options:

Open Zoom ‣ Settings ‣ General

⦾ Start Zoom when I start Windows.

⦾ Enter full screen automatically when starting or joining a meeting.

Push Button Calibration

To find out the analog values when I pressed each button, I used a small program below:

#include <DigiKeyboard.h>
// Define an analog pin we want to use
// A0 (or PB5) is RESET pin of DigiSpark Attiny85
const int BUTTONS_PIN = A0;
void setup()
{
 pinMode(BUTTONS_PIN, INPUT);
}
void loop()
{
  DigiKeyboard.println(analogRead(BUTTONS_PIN));
}

Then I connected DigiSpark Attiny85 to my laptop, opened the Notepad++, recorded the printed value when I pressed each button.

Compared with the analog values calculated in the previous step (STEP 2), they are slightly different but they're reasonable because I use 2 meter - 5 cores cable and they also have copper core resistances. The compared values are highlighted in green and red color in the table.

Programming

The DigiSpark ATTiny85 program is as follows:

#include <DigiKeyboard.h>
#include <AnalogMultiButton.h>

// Define an analog pin to be used: A0 (or PB5/ RESET PIN) of DigiSpark Attiny85
const int BUTTONS_PIN = A0;

// How many buttons we connect to Attiny85 via analog pin
const int BUTTONS_TOTAL = 4;

// To find out the analog values when we press each buttons: we use a command DigiKeyboard.println(analogRead(BUTTONS_PIN))in the loop().
// Then we connect DigiSpark Attiny85 to computer, open the Notepad++, record the printed value when we press each button.
// Enter their values into array below in order from smallest to biggest.
const int BUTTONS_VALUES[BUTTONS_TOTAL] = {728, 846, 910, 989};

// Define constant value for each button in the same order as the numbers in your BUTTONS_VALUES array, so whichever button has the smallest analogRead() number should come first

const int BUTTON_CENTER = 0;    // Center button
const int BUTTON_AUDIO  = 1;    // Left button
const int BUTTON_VIDEO  = 2;    // Right button
const int BUTTON_HAND   = 3;    // Bottom button

// Declare an AnalogMultiButton object, with parameters: analog pin, total buttons and analog values array
AnalogMultiButton buttons(BUTTONS_PIN, BUTTONS_TOTAL, BUTTONS_VALUES);

void setup()
{

}
void loop()
{ 
  buttons.update();

  // If BUTTON_CENTER is pressed or pressed and held less than 1 second before releasing
  // Enter Zoom link which includes "URL-plus-Password"
  if(buttons.onReleaseBefore(BUTTON_CENTER, 1000))
    {
      DigiKeyboard.sendKeyStroke(0);
      DigiKeyboard.sendKeyStroke(0, MOD_GUI_LEFT);       
      DigiKeyboard.println("chrome.exe https://URL-plus-Password");
      DigiKeyboard.delay(50);
      DigiKeyboard.sendKeyStroke(KEY_ENTER);
      
      // Zoom Full Screen Option (Alt-F)
      // DigiKeyboard.delay(15000);
      // DigiKeyboard.sendKeyStroke(0);
      // DigiKeyboard.sendKeyStroke(0, MOD_SHIFT_LEFT | MOD_CONTROL_LEFT | MOD_ALT_LEFT);
      // DigiKeyboard.delay(50); 
      // DigiKeyboard.sendKeyStroke(KEY_F, MOD_ALT_LEFT);
    }

  // If BUTTON_CENTER is pressed and held more than 2 seconds before releasing
  // Quit Zoom meeting.
  if(buttons.onReleaseAfter(BUTTON_CENTER, 2000))
    {
      DigiKeyboard.sendKeyStroke(0);
      DigiKeyboard.sendKeyStroke(0, MOD_SHIFT_LEFT | MOD_CONTROL_LEFT | MOD_ALT_LEFT);
      DigiKeyboard.delay(50);
      DigiKeyboard.sendKeyStroke(KEY_Q, MOD_ALT_LEFT);
      DigiKeyboard.delay(50);
      DigiKeyboard.sendKeyStroke(KEY_ENTER);
    }
    
  // If BUTTON_AUDIO is pressed
  // Turn On/Off Audio (Alt-A)
  if(buttons.onRelease(BUTTON_AUDIO))
    {
      DigiKeyboard.sendKeyStroke(0);
      DigiKeyboard.sendKeyStroke(0, MOD_SHIFT_LEFT | MOD_CONTROL_LEFT | MOD_ALT_LEFT);
      DigiKeyboard.delay(50); 
      DigiKeyboard.sendKeyStroke(KEY_A, MOD_ALT_LEFT);
    }
  
  // If BUTTON_VIDEO is pressed
  // Turn On/Off Video (Alt-V)
  if(buttons.onRelease(BUTTON_VIDEO))
    {       
      DigiKeyboard.sendKeyStroke(0);
      DigiKeyboard.sendKeyStroke(0, MOD_SHIFT_LEFT | MOD_CONTROL_LEFT | MOD_ALT_LEFT);
      DigiKeyboard.delay(50); 
      DigiKeyboard.sendKeyStroke(KEY_V, MOD_ALT_LEFT);
    }
  
  // If BUTTON_HAND is pressed  
  // Raise/Lower Hand (Alt-Y)
  if(buttons.onRelease(BUTTON_HAND))
    { 
      DigiKeyboard.sendKeyStroke(0);
      DigiKeyboard.sendKeyStroke(0, MOD_SHIFT_LEFT | MOD_CONTROL_LEFT | MOD_ALT_LEFT);
      DigiKeyboard.delay(50); 
      DigiKeyboard.sendKeyStroke(KEY_Y, MOD_ALT_LEFT);
    }         
}

The following core, library and driver need to be installed in this project:

  • ATTinyCore.
  • Digistump Driver.
  • DigiKeyboard library.
  • AnalogMultiButton library by Damien Clarke. This library can be used to capture button presses on multiple buttons through a single analog pin. It includes debouncing and many options to detect when buttons are being held, pressed, released, pressed for a duration, released before or after a specific duration has elapsed...

Verify and Upload the code to DigiSpark ATTiny85:

In the program, Zoom keyboard shortcuts and analog values of push buttons have been clarified in the previous steps.

My daughter's teacher sent a Zoom link with "URL-plus-Password" when she created the meeting, so I could enter into the Zoom online class easily by pressing the "CENTER" button.

DigiKeyboard.println("chrome.exe https://URL-plus-Password");

If we want to change keyboard usage values, we can see "HID Usage Tables" document on the https://www.usb.org/, Chapter 10 Keyboard/Keypad Page for more codes.

Testing & Notes

DigiSpark Bootloader.jpg
HID_COMMENT.jpg

I have paid attention on "Device Manager" when I plugged the Attiny85 into my laptop.

Firstly, the Windows recognized Attiny85 as a "libusb-win32 Usb Devices" (DigiSpark Bootloader).

After that Attiny85 was recognized as a HID Devices (USB Input Device/ HID Keyboard Device/ HID-compliant mouse). The buttons are ready to be used.

Notes & Tips:

⦾ My laptop operating system is Window 7 SP1, before Attiny85 is plugged into my laptop I have to unplug my mouse, otherwise the error pop up "USB Device Not Recognized". And after laptop recognized Attiny85 as a HID device, I can plug my mouse again.

⦾ In case the "USB Device Not Recognized" error doesn't go away, I unplugg the Attiny85 and plugg it again. Then I press "HAND" button every time the laptop chime sound plays, it notify a peripheral device (Attiny85) is connected or disconnected from my computer. This is really effective way and Attiny85 can be regcognized as HID device instantly.

Further Improvement

I can extend this push button box functionality with devices that communicate via I2C or SPI protocol. I have an 8-pin header available on the PCB for the M5StickC.

We can use the M5StickC screen to display the buttons states, and use some extra built-in buttons on it.

Or we can use M5StickC in combination with Blynk App. to assign and customize functionality to the push buttons and links we want to access, for examples:

Conclusion

B_1.jpg
B_2.jpg

Thank you for reading my work!!!