Low cost keyboard emulator board - Page 1
Forum section: electronics / beginners

author: DanGB
author_rank: Newbie
timestamp: April 30, 2020, 10:56:07 am
content: Hi all,Looking to create a product, basically, its just a single button on a box that needs to press a 't' key like a keyboard.So I started off with a Arduino ProMicro. Works great as a keyboard emulator. Tried and tested. Too expensive.Looked at a Digispark ATTiny85, great price, but keep reading its not reliable as a USB device and doesnt have enough power protection. Unless im wrong?Now I am trying a 'blue pill' STM32F103C8T6 STM32 based device. I can get qty 50 of these for 1.24GBP each.Seems ok, not the best USB protection but probably good enough. Higher than I want to pay, and seems WAY overkill for my requirements.So basically i am looking for a PCB which covers these requirements:-Low cost as possible.-Can act as a USB keyboard type emulator.-Reliable.-Decent USB power protection.Qty may only be 200, so don't want to design a custom PCB, nor have the skills, unless there are already designs out there?Many thanks!

author: tooki
author_rank: Super Contributor
timestamp: April 30, 2020, 11:40:11 am
content: Arduino pro micro clones cost $3 on eBay. Surely that fits within your budget?!? (Arduino is open source, so clones are “legit”, and an Arduino is little more than the microcontroller with minimal support components anyway, so not really much to screw up.)

author: Renate
author_rank: Super Contributor
timestamp: April 30, 2020, 12:20:58 pm
content: I go with tooki's suggestion.You want something with real USB (not bit bashing, not ATTiny85) but ARM cores seems like massive overkill.Arduino Pro Micro = Atmel ATMega 32u4I like remote control and foot pedals, but spitting out "t" seems arbitrary.Ok, I get it, you have some specific software in mind.Still, if you program the uP to be HID then you've got something that is distinct from a keyboard press.On a desktop computer the "t" will also be sensitive to the shift key making it "T".

author: oPossum
author_rank: Super Contributor
timestamp: April 30, 2020, 04:51:12 pm
content: I don't think you will be able to beat the price of a blue/black pill for an OTS product. The risk with those is that some have a MCU that isn't a genuine STM32.If this was something I was doing for myself, I would make a custom PCB with a CH551G. Low cost and relatively simple.

author: DanGB
author_rank: Newbie
timestamp: April 30, 2020, 06:30:46 pm
content: Thanks all so far.Ive seen playing with a DigiSpark Clone ATTiny85 board today, with the VUSB. It seems ok so far on a few computers ive tried it onDo people really think there is an issue with non hardware USB, and bit-banging causes issues, even for my tiny bit of occasional data transfer?

author: Renate
author_rank: Super Contributor
timestamp: May 01, 2020, 11:45:39 am
content: Is this for a specific, single-application dedicated computer?Is this for a normal Windows/Linux/Mac multi-application desktop?If it's multi-application, multi-focus, then spitting out a 't' to the wrong application is pretty silly.If you do this as HID then the interested application will be the only thing that gets the event.

author: Renate
author_rank: Super Contributor
timestamp: May 01, 2020, 07:23:21 pm
content: Hey! I've got the solution!If you want the cheapest thing, go buy a standard PC keyboard, gut it and use the tiny PCB.They're selling these for $1.88/piece and that includes the cable that you'd have to pay extra for on a BluePill or something.https://www.alibaba.com/product-detail/K13-Standard-USB-104-Keys-Wired_62122891533.htmlJust connect a push button between the relevant row and column.

author: magic
author_rank: Super Contributor
timestamp: May 02, 2020, 06:48:05 am
content: For production, that will be a lot of waste keyboards to dispose ofAs for USB on ATtiny85, the problem was that Atmel wants you to run the micro at 5V for more than 8MHz or so but USB 1.1 signals are 3.3V, which means:- the outputs of the micro ought to be clamped to 3.3V with zeners or buffered by a suitable logic chip- the inputs to the micro may not reach the guaranteed Vih threshold unless they are shifted to 5V by a suitable logic glue chipIn practice, however:- USB ports are mandated to withstand 5V continuously for 24 hours on any pin- 3.3V will generally register just fine as high on CMOS running at 5V- I have overclocked a few AVRs to 30~40MHz and even there, 5V or 3.3V made little difference- YMMVATmega32U4 is not a cheap solution. However, a slightly cheaper variant exists: AT90USB162. A think there is also an ATmega8 or 16 U-something, very similar to AT90USB162. These contain a built-in standard-compliant USB interface and a built-in 3.3V LDO to power it. You add a crystal, a few capacitors and that's it.ARM boards will probably still be cheaper, though.

author: tooki
author_rank: Super Contributor
timestamp: May 02, 2020, 12:53:07 pm
content: Quote from: magic on May 02, 2020, 06:48:05 am$3 is too expensive?!?

author: magic
author_rank: Super Contributor
timestamp: May 02, 2020, 12:56:47 pm
content: Yes, because OP apparently already found ARM boards for $2