Remote control of PC and Smartphones with DIY HID devices (incl. Rubber Ducky / Bad USB)
Ғылым және технология
This is a replay of video 343 (during my summer break)
Human interfaces to computers are essential. This video will focus on our hands inputting data. And a Microcontroller replacing hands for automatic data logging. I will show you five very different projects, and maybe you find a project idea for this summer.
My second channel: / hb9blawireless
Links:
Jog Wheel: s.click.aliexpress.com/e/_d7RLvJE or amzn.to/2VJmJEo
Arduino Pro Micro: s.click.aliexpress.com/e/_dXD6aI8 or bit.ly/2ZzEvel or amzn.to/4cDe23h
Similar camera (not tested): s.click.aliexpress.com/e/_Ddp...
"Rubber Ducky": s.click.aliexpress.com/e/_DF8... or amzn.to/3RMDb3H
Code snippets: github.com/SensorsIot/HID-exa...
ESP32 BLE Keyboard Library: github.com/T-vK/ESP32-BLE-Key...
Overthruster: github.com/RedLectroid/OverTh...
"Inspiration" video: • Automating Mouse and K...
Patreon supporter companies:
www.welectron.com/
The links above are usually affiliate links that support the channel (at no additional cost to you).
Supporting Material and Blog Page: www.sensorsiot.org
GitHub: www.github.com/sensorsiot
My Patreon Page: / andreasspiess
Discord: / discord
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission on your purchases to buy new stuff for the channel
My Amazon.com shop: www.amazon.com/shop/andreassp...
For Banggood bit.ly/2jAQEf4
For AliExpress: For AliExpress: bit.ly/3MtXUY8 (just go on from here to your product)
For Amazon US: www.amazon.com/shop/andreassp...
For Amazon.de: amzn.to/2r0ZCYI
For Amazon UK: amzn.to/2mxBaJf
For ebay.com: ebay.to/2DuYXBp
/ spiessa
Please do not try to email me. This communication channel is reserved for my primary job
As an Amazon Associate, I earn from qualifying purchases
Corporate Rise-and-Hit_05.wav by s-cheremisinov -- freesound.org/s/401121/ -- License: Creative Commons 0
#no#midroll#ads
Пікірлер: 164
One thing not mentioned here (and it's a little-known but potentially very useful feature) is that in addition to the standard HID descriptors and profiles for things like keyboards/mice/joysticks, it's also possible to set up a "custom" vendor-specific HID descriptor that doesn't map to one of the usual classes. The device will be detected by your PC automatically and be accessible to applications, but the operating system won't do anything with it by default. This allows you to make "driverless" custom USB peripherals with their own data-exchange requirements. You basically set up the HID descriptor to contain generic read/write data blocks that match your use-case, and you can then interact with these blocks of data from the connected host. You need to write the program on the host side to interact with it (so it's more work than piggybacking on a standard class), but it's orders of magnitude simpler than writing a custom driver from scratch and sidesteps all the painful signing requirements that normally entails. Controlling custom RGB/LED layouts or LCDs, custom sensor inputs (force, temperature, accelerometers, etc) and more are all possible using this approach, and you don't have to worry about other applications interfering with your peripheral or ensuring you're not going to affect other programs because of some fake keyboard inputs you're sending. I believe it's even possible to interact with such custom HID peripherals directly from the Chrome web browser (because it has some APIs for interacting with USB/HID, although other browsers don't support this) although I haven't played around with this myself.
@AndreasSpiess
Ай бұрын
Very interesting information. Thank you!
The jog wheel should have some kind of indexing mechanism in it that snaps into grooves on a wheel or something similar. Open the thing, remove (or break) this, add a good amount of non-conductive grease (for dampening) and you should be done. Thanks for this informative video :)
@AndreasSpiess
Ай бұрын
Thank you for the tip!
With this Method i've bult a foot pedal used as PTT e.g. for discord. TIPP: Use funktionkeys F13 to F24, since they typically are not used by any standard input scheme, because this keys don't exist on a standard keyboard. But emulated with an arduino they work like a charm.. Great for Programs running in the background.
@AndreasSpiess
Ай бұрын
Good idea! Thanks.
I had some hoby projects in the past year, that ended up beeing HID devices. Maybe some inspiration for others: 1. some inputs for flight simulation at my PC. Here I used a Teensy. First I only added some Buttons and switches and a rotary encoder (to set the radio in the plane). When my rudder paddle device broke I did build an own that is also run by the very same Teensy-module. 2. A friend needed to combine two HIDs to act as one (with some tricks to avoid interference of both). I chosed a maybe overcomplicated solution with a Rasperry Pi where I plugged in both HID-devices. A Python script was able so separate inputs from both HIDs and ensured proper order... this was send via serial port to an arduino, which worked as a HID for a PC. 3. control KZread player on Smartphone or iPad. A musician want to play along YT-Videos... a ESP32 emolates a mouse/keboard HID and enable to chose a specific video with a rotary encoder. This video is then started in YT-app. An extra button trigger to jump at a specific time in the video. Raspberry pi Pico can also be used as USB hid. If you build a Bluetooth HID, don't forget to add a battery information (read voltage with analog pin). Battery status can be send via bluetooth, this is part of HID-protocol.
@AndreasSpiess
Ай бұрын
Cool ideas! Thank you.
ah its a replay. Still I got one of these videos for once within a year of it being produced. Keep it up - you have no idea just how much all these videos are helping I just deployed my first solar-powered esp32 project using a tp5000 and a lifepo4 battery and your vids were like 95% of what I needed from the hardware side.
@AndreasSpiess
Ай бұрын
Yes, it is a replay. And I am surprised how well it performs. It seems to be an "evergreen" topic ;-)
Also of help might be "Autohotkey" which can act as a layer above the HID and is able to run entire Macros. This can also detect & change which window is in focus, so can be made robust to input interruption. This is a lot easier to write & debug. Plus the microcontroller is simpler as it only has to send one keystroke combination (which can be entirely novel control+alt+whatever you like) for each action and AHK handles the rest.
@AndreasSpiess
Ай бұрын
Thank you for the info!
@Electronieks
Ай бұрын
I was thinking the same thing Ahk is very powerfull
May Dishka rest in piece in cat heaven!
I find the ducky device often called a digispark. I made some devices to tap the ctrl key every 5 minutes for some friends to use on their work devices and keep them awake.
@thetinkerist
Ай бұрын
lol and thereby bypassing the security policy the company has set for these work computers.
@ulwur
Ай бұрын
I made a similar one that toggled caps lock on and off randomly
@ulwur
Ай бұрын
Drove co workers crazy when they typed reports and such
@joeofloath
Ай бұрын
I built some digispark duckies, if you want to keep a computer awake you just need to draw a one pixel square with the mouse every few minutes, unless you're doing graphics or something you'll never even notice.
@AttilaAsztalos
Ай бұрын
The "Digisparks" are not 32U4-based though, and they don't actually have USB either - they barely limp by as a low-speed USB1.1 device, bitbang-emulating one with a rather shoddy timing.
A standard through hole or panel mount rotary encoder with a big heavy knob attached should run pretty free. I put one on a panel for some equipment at work, it has a little finger detent and you can give it a quick spin to make big changes or dial it in exactly, it's so much better than buttons.
@altamiradorable
Ай бұрын
use a stepper motor....cheaper!
@joeofloath
Ай бұрын
@@altamiradorable how do you use a stepper motor as an encoder? Is it really cheaper than a £1 PCB mount encoder?
Interesting, this solution might help me build physical knobs for my Analog Discovery 2, a software oscilloscope. Hope your summer will also be nice, greetings from Sweden.
@AndreasSpiess
Ай бұрын
I hope so too! Just returned from "around your corner" (Norway) ;-)
Andreas, for the encoder I just use a standard encoder like we use in industrial applications you can get them cheap. then I buy a solid aluminum knob usually a large diameter with a 6mm hole for the encoder. I also use these on my radio builds for frequency tuning. it works great and the weight of the large aluminum knob works very smoothly.
@AndreasSpiess
Ай бұрын
What would be the keywords to find it on AliExpress? (Links are not alowed on youTube)
@curtstacy779
Ай бұрын
@@AndreasSpiess 600P version of either is more than enough count per rev. you could probably go lower but you can fix it in code. The first encoders I used are this one $9.36 US: 100/200/360/400/500/600P/R Photoelectric Incremental Rotary Encoder 5V-24V I found a cheaper one but didn't try yet $6.26 US New incremental photoelectric rotary encoder 400P/R 600P/R 360P/R pulse / line AB two-phase 5-24V NPN PNP output 2m cable The knob I prefer the larger one here $12.50 US: 1pcs high quality aluminum knob solid potentiometer knob 44*22*6m But smaller knobs work also 2pcs for $2.53 US: 2PCS Aluminum Solid-core Knob Cap Size 32*13mm 13X32MM The Inn Have fun with this, it makes your project seem much more impressive with the feel you get. it's like using a store-bought radio. and thanks for all the videos.
@curtstacy779
Ай бұрын
@@AndreasSpiess By the way, let me know if you need more info maybe I can send the links a different way. the schematic was a standard easy-to-find version. it will bring your input to 0VDC and there is a better schematic that has just a little filtering in it I haven't tried to use that one yet but it could be even smoother.
@AndreasSpiess
12 күн бұрын
@@curtstacy779 Thank you for the links. I found the products! Nice looking knobs, indeed!
@curtstacy779
12 күн бұрын
@@AndreasSpiess Oh nice! you are going to love that setup! the only thing we may have to come up with is an adjuster to put some friction on the knob so it doesn't over travel but it works so well I just let that go. I'm happy to see you found them. can't wait to see them in a video.
Home run. Your "accent" is and always has been part of you. That is a good thing.
@AndreasSpiess
Ай бұрын
Thank you!
Cool video! I wanted to make a macro keyboard for myself, maybe that's a sign to finally do that. PS: For a smartphone photobooth - it works with headphones' buttons (wired or wireless) as their buttons also take a picture. I used to have a lot of old broken earphones with working buttons, before moving.
@AndreasSpiess
24 күн бұрын
So go for your macro keyboard!
AH, this is a cool video. Why did I not notice this before? I have been playing with USB keyboard interfaces a lot and I also have been working on a similar jog wheel for Davinci Resolve. I used an AS5600 magnetic angle sensor, a large bearing and some 3D printing to create my own jog wheel. That works great, the only problem I had was most microcontrollers only implemented a slow speed USB which uses a 8 ms polling rate, resulting in max. 62 keys/s. I used a Teensy 4 to get full speed USB with a 1 ms polling rate, theoretically getting up to 500 keys/s. This completely removed any key lagging in my case. I cound the AS5600 a great solution for this since this now allows me to adjust the number of steps (keys) per rotation, resulting in a perfect 1, 2 or 5 second (25, 50, 250 or 30, 60, 300 pulses) step per rotation. I not have to check if the ESP32 is up to a similar task so I can replace the umbilical (USB) with a battery to get more freedom on my desk😀
@AndreasSpiess
Ай бұрын
Thanks for sharing your project! I hope you will be successful with the ESP32. It is a bit cheaper than the Teensy...
As always an interesting video with usefull information. I think another option could be using a Streamdeck.
@AndreasSpiess
Ай бұрын
I agree (and own one now). But it has no jogwheel
I use my ESP32 as a keyboard for my Kodi-Mediaplayer... Works very well, with Bluetooth.
@AndreasSpiess
Ай бұрын
Cool. Thanks for sharing your experience!
Thank you.
@AndreasSpiess
Ай бұрын
You are welcome!
Thank you
@AndreasSpiess
Ай бұрын
You are welcome!
Still a good video, thanks!
@AndreasSpiess
Ай бұрын
My pleasure!
I have a similar looking microscope, and didn't like the mouse control, but i found out that plugging a usb keypad instead of the mouse give me the most used commands. You can choose focus mode manual/auto, when in manual focus you can adjust it with two keys or make a single shot automatic focus. And you can make a screen capture. The only function i miss is starting/stopping vidéo capture.
@AndreasSpiess
12 күн бұрын
Also a good idea. Thanks for sharing!
Cool! I wish someone would just make these devices.
@AndreasSpiess
Ай бұрын
Maybe you find one on one of these project pages?
@goodcitizen4587
Ай бұрын
@@AndreasSpiess Good point. Still, it will be nice when they are more mainstream. Thanks for the vids!
I have used an Arduino Micro as a game controller in order to use a sled as a car driving device (I also made a video showing that). The possibilities with this device are so huge!
@AndreasSpiess
24 күн бұрын
Cool project! But I do not know if your daughter liked it that she had no sled afterwards ;-)
24 күн бұрын
@@AndreasSpiess good question, I was too busy playing to ask her! Thanks for watching ;-)
7:09 Evan Kale 😢 I miss this guy. He got me into tinkering with electronics. Wish he’s all good
@AndreasSpiess
24 күн бұрын
Success on KZread is not easy for young people, I think.
Hey Andreas! Great video, as always. I've been looking for something like this for some time, but for controlling my music production/live mixing, and usually those programs use the MIDI protocol - maybe it is worth a try on exploring it? Many musicians use very expensive controllers that could be done for basic functions with little less than some buttons and a controller board. Another thing I've been trying to explore, but with no success, is doing a DIY button matrix, where each button could be illuminated with a defined colour (e.g. to dynamically allocate functions to them and know what they do in each program by their colour), it seems that it is a bit difficult to build RGB buttons, maybe you have any tips on that?
@AndreasSpiess
Ай бұрын
You should find projects for small keyboards with different additional functions. An may use ready-made "Stream Decks". So far I had no use for midi (other than for a video on my second channel).
There are Chinese encoders available with very smooth movement and a standard 6mm shaft, just add a machined knob that has some decent mass to give some inertia.
@AndreasSpiess
Ай бұрын
Thank you for the additional info!
I used an attiny85 on a board that fit in the usb port. The program pressed caps-lock at random times. Drove my co workes crazy when they couldnt figure out the problems with their keyboards 😂
@AndreasSpiess
Ай бұрын
I assume you won the "best co-worker" award after that prank ;-)
Super sonntig mit Andreas films
@AndreasSpiess
Ай бұрын
Danke!
You could use a hard drive, a spinner, to create a freely moving rotary encoder.
@AndreasSpiess
24 күн бұрын
A good idea!
@MichaelWoodrum
24 күн бұрын
@@AndreasSpiess I can't remember where I saw it. I used adafruits rotary encoder board to read the pulses from the magnets though. Used it for the same purpose as your thinking. It also looks cooler because it's shiny. They're also all over the place and I'm sure you have many old ones.
Yes lesson learned when seeing hello world all over the Arduino ide. Lucky for me, it was a Leonardo there has a reset to hold it, so it could be reprogrammed.
@AndreasSpiess
24 күн бұрын
A reset button is always a good thing ;-)
I saw a build where they used a VCR motor as a jog wheel!
@AndreasSpiess
24 күн бұрын
Cool idea!
It should be possible to modify the CNC rotary encoder you show. I have done it with one (for tuning an SDR). I had to remove the 'handle', carefully remove the centre disc (it's stuck on with double-sided tape), remove the knob then remove the spring-loaded ball-bearing which creates the 'steps'. I got this information from another YT channel - can't emember which unfortunately.
@AndreasSpiess
Ай бұрын
Thank you for the info!
What microscope camera setup are you using there? Ive been looking to get one like that, but there are so many different models that look the same but with vastly different specs...
@AndreasSpiess
Ай бұрын
Since this is a replay video, my setup is no more available. But I posted a link to a camera that should contain a successor chip.
I always wanted to use HID for pausing/playing KZread on my IPad via home assistant when the door rings or I leave the room.
@AndreasSpiess
Ай бұрын
Sounds like a good plan!
interesting 👍
@AndreasSpiess
24 күн бұрын
Glad you think so!
I would of thought the software would have shortcut keys
hi Andreas , nice video, how aobut some proyect of old HF transmitters and recivers for amateur radio aficionados?
@AndreasSpiess
Ай бұрын
At the Swiss Radio Amateur Society (USKA), I am responsible for "new technologies". You you should not expect too much content about old radios ;-)
@jmaguilarr
Ай бұрын
@@AndreasSpiess i así because you know a lot
@jmaguilarr
Ай бұрын
Ask
Use optical encoder for smoothness
@AndreasSpiess
Ай бұрын
Good idea!
I made a small joystick to use with Candle and my small CNC 3018. Keyboard control is a pain on Candle.
@AndreasSpiess
Ай бұрын
Cool!
Dishka cat gets a Esp controlled Selfie Booth 😸😸
@AndreasSpiess
Ай бұрын
:-))
Everyone thinks HID stands for Human Input Device, but it actually stands for Hacker Input Device 😂
@AndreasSpiess
Ай бұрын
Aha. This is new to me, too ;-)
I didn't know I wanted this before but now is like a rotary encoder on my phone and computer for moving thru yt videos. I wonder if the same left/right key strokes will work on Android yt as in my desktop browser.
@AndreasSpiess
Ай бұрын
Maybe google knows the anwer to your question (I am an IOS user)
High quality jog wheel: maybe slaughter a disused Logitech mouse for one?
@AndreasSpiess
Ай бұрын
Maybe. I never tried...
@Electronieks
Ай бұрын
Yes and mod it in a nice box
Maybe a projet that manages password with face or fingerprint for easy input on challenngingn apps?
@mathieucaron4957
Ай бұрын
That's a big risk if you lose the device 😕
As5600 magnetic encoder are great... But it's just a chip.. you need to build an enclosure...
@AndreasSpiess
Ай бұрын
I agree.
7:50 you should talk to Tinkering with Atkalar. He services switches and may be able to help you removing the brake function. He is from Wien in Österreich.
@AndreasSpiess
Ай бұрын
Thank you for the tip! I just found his channel!
Can you link that scope-camera? It looks awesome
@AndreasSpiess
Ай бұрын
Since this is a replay, the camera I used is no more available. It uses a SONY IMX290 autofocus sensor. I now posted a link to a camera with a newer sensor.
@kamilosxd678
Ай бұрын
@@AndreasSpiess Thank you!
challenge - is it possible to connect a USB keyboard and mouse to Arduino at the same time? Esp32-s3 with USB-OTG currently supports only one connected device at the same time.. Any suggestions?
@AndreasSpiess
Ай бұрын
I do not know :-(
A friend of mine had a horrible accident and was paralyzed from the neck down. I used an ESP32 to built him some buttons and levers he could actuate by moving his head. One function was launching the Google assistant reliably instead of "ok Google", which get frustrating quite quickly.
@AndreasSpiess
Ай бұрын
Very useful application. And you are a good friend!
Also, i want a esp32s3 rubber ducky
Would love to see the review of that microscope.
@AndreasSpiess
Ай бұрын
I once made a video about microscopes. But mainly optical binoculars. If you watch it, you will see why...
@galileo_rs
Ай бұрын
@@AndreasSpiess That was 7 years ago, this looks like it's new and you are using a stand-alone lens. The reason why I ask is that you get pretty good image quality, the one I got from AliExpress is lousy so I'm looking for one that is decent and affordable. The alternative is to convert a DSLR into a microscope.
@AndreasSpiess
12 күн бұрын
@@galileo_rs I bought the new one because I never managed to get the camera working on the trinocular. I just have it for KZread.
please make a video on sct013 100A/50ma and ads1115 for calculate ac current
@AndreasSpiess
Ай бұрын
I made some videos about such topics.
How about a AS5600 with some 3d printing instead of a rotary encoder?
@AndreasSpiess
Ай бұрын
I never looked into it :-(
Hallo Andreas, es gibt auch noch eine Möglichkeit ein Pi Zero (vermutlich auch 2) in ein HID zu verwandeln.
@AndreasSpiess
Ай бұрын
Gut zu wissen. Danke!
What is the model of your microscope? Where did you buy it?
@AndreasSpiess
Ай бұрын
I did not find a link, but added one of its successor.
@ergindemir7366
Ай бұрын
@@AndreasSpiess Thanks, do you know the sensor of your microscope?
@AndreasSpiess
Ай бұрын
@@ergindemir7366 SONY IMX290
As a rotary replacement, what about a stepper motor (from a printer or something else)? But I do not know how to detect the direction for that 😞 PS; for a project I would like to do, do you know if there is an ESP library to connect to an external HID over bluetooth? I have a scanner which can behave like a keyboard either over USB or BT. Of course I also have other solutions which already support usb IN, and I wil use that alternatively. But if there is an ESP library for this, that would be great! Second question: I would like to remote control lights and such. But all the radio or LED controlled devices use 5 mA at standby. This is way too much. I know BT used really so little, I would like to enable lights over BT with a simple BT switch (those ones they sell for taking pictures with your Android). I am asking too much. But I hope I may inspire you to use either one for a project (if you know there is a working solution). PS: yes, I have seen most of your remote devices in many of your previous videos! Do know I watched them all. I was just thinking of switching a new way. Or: do you think a BT receiver would use a lot of power as well? I do know the sender uses almost nothing! I have temperature meters running all day on a cr2032 battery for over a year. BT must be the way to go I think.
@AndreasSpiess
24 күн бұрын
Unfortunately, bluetooth on the ESP32 was quite power-hungry when I tried it. So it is not an ideals platform to save energy... Otherwise, BT is great!
@deslomeslager
24 күн бұрын
@@AndreasSpiess Thanks! I will focus on radio signals. An AM radio needs as good as no power (the sender is the source). Keep up the good articles on your channel, I like it. It is unique in its kind.
How about using vband with a key?
@AndreasSpiess
24 күн бұрын
Would probably be possible if you know what vband expect. Maybe a simple serial adapter would be sufficient. I made once a video about a similar thing on my second channel.
Well, left some comment about my 3D printed job version / project.... Any mention to external links get zapped.... Too bad.
@SarahKchannel
Ай бұрын
It kind of sucks that we cant share info on such a topic, makes the whole comment section sort of useless.
@luisfelipesaldivar5100
Ай бұрын
What are you talking about?
@AndreasSpiess
Ай бұрын
Indeed, KZread deletes most comments with links.
@SarahKchannel
Ай бұрын
@@AndreasSpiess I sent you some pictures of the 3D printed encoder on X.
@AndreasSpiess
Ай бұрын
@@SarahKchannel Thanks. I will check later.
So did anyone since found outwhat BLE input device commands android stuff understand for next, prev, pause, etc.? (it is asked in the video) - but it reminded me that i never found out how to do it years ago, and the real actually fully working solution to the problem i wanted to solved years ago, still does not exist. (aftermarket car head unit :D )
@AndreasSpiess
Ай бұрын
I do not have the answer :-(
Esp32 ble keyboard have lags issue.
@AndreasSpiess
Ай бұрын
Thank you for the info. I was not aware.
A pain in the dah-dah-dah to program? That's a pain in the O. Surely you meant it's a pain in the dit-dah-dit (dit dit dit) - that's a pain in the Rs ;-)
@AndreasSpiess
Ай бұрын
:-))
I wait when the first USB-C rubber ducky with video capture support comes out. A nightmare for security. With a OCR or a nano AI model he can control the whole computer.
Esp, a confused chip.
@AndreasSpiess
Ай бұрын
Why do you think?
@xDR1TeK
Ай бұрын
@@AndreasSpiess oh for many reasons. But it seems everyone disagrees with me. For one, is it an RF transceiver or a microcontroller? Another point, they seem to take so much feedback from the hobbiest community as from the Arduino but when they give you the option to use their ide with the idf they end up with half functional code that doesn't run the same firmware between updates. Dear Andreas, you're a model engineer, what do you think? Please share.
@AndreasSpiess
Ай бұрын
@@xDR1TeK I like the possibilities of the ESP32 and did many projects with it. Its price performance is excellent, and its community support, too.
:-)
Malduino is better and cheaper than rubber ducky
We need a tutorial how to create a cheap powerbank in 2024
@AndreasSpiess
Ай бұрын
We get now very good USB-C powerbanks for cheap. So I most probably would no more build my own...