Cheap USB Host Microcontroller [CH559, ESP32, HID]
HTML-код
- Опубликовано: 1 окт 2024
- This video shows an affordable way to add USB support to maker projects.
$2 for 10 PCBs (Any Color): jlcpcb.com (sponsor)
The CH559 is a 8051 architecture based microcontroller that has built in dual USB Hosts. This allows to interface generic Keyboards, Mice, MIDI devices and in my case gamepads. I added this chip as an add on to my ESP32 based game console to replace the SNES controllers by cheap generic ones. The communications is handled over UART which can be done by both ends in hardware. There still is some work to do but you can try it out already. Have fun!
CH559 firmware sources & compiler:
github.com/atc...
Aarons video:
• Usb mouse and keyboard...
Links to my game using the USB:
github.com/bit...
CH559:
link.bitluni.n...
Links to the parts (affiliate links):
USB SNES Gamepad ($2.70 shipped):
USB Fake PS3 Controller ($3.30 shipped):
aliexpress.bit...
aliexpress.bit...
Set of Tweezers ($3):
aliexpress.bit...
Flux ($3 for two):
aliexpress.bit...
Ultrasonic Cleaner(~$50):
aliexpress.bit...
Soldering Mat ($9):
aliexpress.bit...
My camera and lens (4k 60fps):
amazon.bitluni...
plz share :-)
Check out my Tindie store to get some of my creations:
www.tindie.com...
Consider supporting my lab for some extras and frequent updates:
github.com/spo...
/ bitluni
paypal.me/bitluni
Twitter: @bitluni
reddit: u/bitluni
#electronics #diy #maker
3:45 Plugging USB correctly for the first try is illegal!
Insert with the open tabs up, 60% of the time it works every time.
insert with the usb logo on top, works 90% of the time, every time
As written by others, you have between 60%-90% chance of selecting the correct orientation the first time(dependent on how much time you are willing to spend). This means that you can insert it correctly the third time(fifth if unlucky). -not too bad.
video was obviously edited.
If you can SEE the NO-SEE, you got it right UP (or in front) the first time.
What I mean is that there is an indentation in the center of the metallic end you insert into the socket, looking a bit like a nose on a LEGO figure head. The back is a cracked hairline :ø)
One of the great shortcomings of the ESP32 is it not having a USB interface.
@@BlackTigerHD I wasn't talking about a programming interface which is usually a only a cheap USB-to-UART chip, but about a real, native USB interface, like it's common with Atmel chips, like the 32U4 or SAM D21.
@@beardmaker Sadly, ESP32-S2 will sacrifice a lot of other functions, like no BLE, no Ethernet, no SDMMC.
@Z80 None of them have the massive feature set of the ESP32, though. At least not at that price point.
Let's wait for a ESP64 to rule them all. Amen.
@Z80 I can name one STM32F411 project on youtube: betaflight ;)
FTDI makes a number of these types of chips, and they are better documented and supported. The FT120 looks like similar style, using a parallel interface instead of uart.
nothing from ftdi costs $1 and it's funnier to get something like this to work than a ready-made meal.
Please implement a USB-MIDI Host to serial driver! Pretty pleeeze!
yesss i need that
This was a brilliant hack, a fun project, had great editing, and was quite funny! Well done on all counts!
How you soldered everything on that board by hand was great. I love tech and diy projects (even though I can't do 90% of them). You got a new sub.
Will we see USB slave mode too? :D
I hope so too.
Sure.. I want to get rid of the extra serial chip to program the esp
I'm always amazed by the hidden gems in the Chinese ICs.
Wish I have such friends who are so enthusiastic about electronics projects. :)
Incredible again. Belated happy new year guys!
Happy new year
Who knows, you might meet someone @ Function '20 :-)
Join a hackerspace?
now: just use the BLE Hid library to make a wireless controller O.o crazy world
Are there any chances you could share the schematics? It would be very helpful :)
Hey, can u send me the gerber file please?
Also if you don't need USB Host and a large program memory, you can try CH552/CH554 which only comes with USB Device mode. They are really cheap and I have already tried to make a small USB keyboard by modifying the provided example code on WCH's website.
I had to go with the ch559 since I want to have keyboard and mouse in future and a usb hub ic costs more than using the 559 in the first place
@@bitluni Yeah, for any use cases that ultilizes USB Host mode and multiple ports, CH559 is a solid choice as it provides double port root hub, while still cost effective. Thanks for sharing!
And there it is, the pre-stream video release to announce the makercast stream!
This is the first video on YT I've watched that hasn't made me shake my head when seeing someone using soldering tools :))
But why for the love of jeebus, would you want to replace the SNES pads? They are gamepad perfection! And for a crappy USB clone SNES pad. Are you crazy?! :P
Hello, today there is the ESP32-S3, which has a USB Host (OTG) port. But they are still making the software to support USB HUB. So, if anyone has the knowledge and time to help with this, it would be very useful to see how HUB support is progressing in the ESP-IDF repository. (reference espressif/esp-idf/issues/12554).
After 4 years, still, this is one good solution, because ESP32-S2 supports a single device only, so mouse and keyboard cannot be connected even using a USB hub.
Congratulations! That's going to be useful in so many projects.
Now, you can also take a C3/C6/S2/S3 series ESP32 witch all have USB support integrated ! :)
Well done for breaking through the documentation for that IC! USB hosts are such a useful tool to advanced makers.
You are just one of the kind! I wish I know 10% of what you know! I can'r even come close to your ankles, but I do enjoy your videos!!! Thank you very much and keep up the good work! Wishing you, your family and friends a great happy and prosperous 2020! What do you put into your water to sonic-clean your boards? Thanks.
Hi,
Im currently using a raspberry pi to emulate and run keyboard/mouse scripts with a combined HID0/1 I wrote.
But I hate coding on the raspberry pi and would like to to build a usb HID emulator / controller for my PC instead.
It seems like this would work.. do you have any already finished ideas that might also do this? Basically plug in device that I can send code to and it emulate a keyboard/mouse back.
I'm not looking for a macro recorder, because I need to be do other things with the code. And every ms matters, so I'm writing it in C++
looking at this atm, ESP32-S3-USB-OTG
Nice job! I noticed that unlike the MAX3421E, the CH376S has no built-in ESD protection. Does the CH559 have internal ESD protection?
No clue.. maybe someone else can answer this. That's really built to the dollar so I can keep all the GOLD to myself 😂
@@bitluni 🤣
EDS protection is cheap. I would look at both a viable solutions. ESD protection must always be a major consideration when designing to protect against silly failures.
Is it true you just use isopropyl alcohol in the ultrasonic bath, or is it some other fancy electronics cleaner?
I bet you could use alcohol + mineral spirits/isopropanol (50/50).
Works a treat for manual cleaning, do not see why it wouldn't with ultrasonic.
@@Mr.Leeroy What worries me is the heating element in the ultrasonic cleaner, combined with a flammable liquid like isopropyl alcohol. Most people warn about this, but I read in some other comment some weeks ago that Bitluni uses only IPA in the ultrasonic so I wanted to check.
@@SeanChYT he uses beer? Germans... (jk)
I have the same cleaner. There is a solution specifically made for this - mine is called "Flux Remover Ultrasonic Cleaning Solution". Part number is US-SO-FLU-1L if you're interested. It lasts for ages, as it is diluted with water, and you can reuse it several times.
@@SeanChYT selfignition point of IPA is 400 deg C. At 80 it is only boiling. Moreover ultrasonic cleaner bath is usually isolated pretty well from any electronics that reside in a separate compartment. So I think you should be fine unless catch a spark from shorting something.
I'd not bother with heating IPA at all because it works very well on it's own and with ultrasonic treatment it should make wonders even at room temps..
Communicate via a UART ? Then you dont't need a USB controller and diggin into Chinese sources, an documentation. FTDI chips will do the USB -> UART conversion for you. It's much simpler.
Awesome what can be done with today's technology!! :)
Since even broken Amiga 2000 keyboards are going for $240+ on fleabay, this little chip might be just what the doctor ordered to adapt modern keyboards and mice to work on amigas!
Very nice. As usual, you videos are quite informative. Now a quick question. Can the device function as a USB host for MIDI? Can I plug my music keyboard with the modern USB midi and can I channel it to somewhere else(say a 5 pin midi)
Also would these boards support USB hubs(powered/unpowered)?
Thank you for building great content
do you think we can use this to get acoustical data from a USB microphone (such as ATR2500 usb mic)? Thanks!
The hardest part of this project is to find a VGA display nowadays.
Thats component/composite
VGA Is different
Is it? Any time I go on a website that sells monitors something like 70% of them still have VGA input.
CRT displays are another matter entirely of course.
But the VGA signal standard? That's easy.
Look for used GPS navigtion screens used in cars. Or display that are used for car backup cameras. Those very often have a composite input.
Dude WTF, are you printing directly on the bed without a print sheet? :O
Can u add the link for buying the CH559L Programmer kit
Can you please show me a way How can i make esp32 look as an HID wired keyboard device? i have searched alot about it but no luck
Hi there.
I have a question here I have a duel usb hub that I want to use on a computer but it's just reading as a host to host bridge .
any ideas?.
You have a nice computer desk. Did you build it yourself?
That ultrasonic cleaner is nice! Wow. Have a board that needs that here.
Whats the name of the music you used at 4:52?
Jeremy Blake - Powerup
What solution did you clean the boar in with your ultrasonic cleaner and for how long?
How to make USB wireless, so i can access anywhere in the world?
Bitluni, could you work with lilygo and make a variant of this for their wildely popular t-display?
Me finding this 2 years later :p Now the Pico W was just released and has a USB host + another USB via PIO. I am going to try and use that for my project, but this is an incredible backup resource. Thanks!
The CH559 has an 8051 core + 6k SRAM + bootloader + USB capabilities + very cheap... that makes a one IC, all in one MCU development platform...
Nice job. But is there a specific reason for not using a MAX3421E-based USB host shield?
I think the 3.6/4.6USD price for a complete mini/full-size board (incl. shipping) is reasonable, especially as there are ready-made and tested Arduino libraries for this that support HID devices, ADK, CDC ACM, PL2303, FT232, BT HID, SPP, mass storage, and also PS3/PS4/PS Buzz/Wii/Xbox controllers, among other stuff.
Have you considered the ESP32-S2 chip? It is single core with usb otg (USB PHY 1.1) built-in. I would like to see you investigate it for using off-the-shelf usb hardware (webcam, game controller, keyboard, etc.) designed to work with generic drivers.
Where can I buy this console? 19$ ?
Really nice! I designed my own board based on your instructions, but when I hold the button to enter the programming mode and plug in the microcontroller, windows says it cannot recognize the device... I tried to install the CH340 driver, but still not works. Could you help me a bit? Best regards, Caio.
Have you considered porting V-USB to ESP32? Would it be possible? With that we wouldn't even need the USB to UART for programming either!
Could you design an ESP32+VGA+USB host+Audio out ? That could be a nice computer :) Like what you show on 0:38 with your DOS board v0.1
Thanks for the video! really interesting... Do you have these USB wings for sale? I'm hoping to use the ESP32 to forward USB traffic to another host (wish me luck) this board would be a great starting point.
Sir, can you make a USB host shield for Atmega chips? The Arduino USB Host Shield are very expensive in my country. It's a dream for me, a cheap USB Host Shield.
Do you think it would also be possible to build an PTP-driver so it's possible to communicate with (e.g.) DSLR-cameras?
How good or bad is the input lag?
Soooo close to what I'm looking for. I REALLY want to be able to build a USB Host bridge so that I can turn a keyboard into a wireless keyboard (without "stealing" the firmware from a more expensive USB Host). So I need a USB host and some sort of wireless communication to some other unit that can be a USB slave (teensy or arduino should do).
The SAMD21 is an ARM unit that supports USB host mode, according to it's datasheet.
Hi, what is the name of that flight snes game? Thanks.
Could you use this method of connecting a microcontroller to a computer? The arduino leonado is an option? I’ve looked into microchips arm range specifically a sam4 but I’m struggling to find online resources .... thank you!
Hi, Bitluni, great work. Any chance that it can be used as pure USART to USB bridge for control a 3d Printer ? Mirko
Huh. I've been trying to work out the logistics of adding USB host support to devices for a while now.
I have about a half dozen projects that could really benefit from this...
Many of which have to do with retro computers. (for instance - I wanted to add 3.5 inch floppy support to an 8 bit atari. There's many ways to go about this, but one of the most accessible that doesn't rely on obsolete parts, is to use a USB floppy drive... Which... Means being able to build a USB host controller and interface it to the IO connectors the atari has available.)
Then there was a SNES cartridge designed for homebrew development work and software testing where it would be useful to be able to do remote debugging with a PC, but where it would also be useful to have a way of attaching a USB keyboard...
(I'm also currently looking at something equivalent for SATA; mainly so I can interface a modern DVD drive to a very old computer. But my guess is that's even more complicated than a USB host...)
Man, that was awesome! No to mention outright hilarious as well xD
bitluni_subscribers++ ;)
is CH559 can handle webcam usb ?
Hey great project bitluni ! Do you think an esp32 is good enough to connect a usb webcam through the CH559 and use a lcd screen to show a video from it ?
At minute 3.35 you used a ultrasonic cleaner. Please may you give me info about time, temperature and liquid type used for cleaning? many thanks
Just awesome! I wish I had your skills too :).
This will be awesome if was portable version, maybe a PCB that can have even the controller on. The low power required by the ESP 32 to run and the low resolution that will be just fine for a screen with 800x480 resolution.
I was wondering if i could build such a usb host to capture webcam images on a ESP32 board.
I don't press the "subscribe" button often or easily, however, I've been following you for a while and your channel is so amazing with such nice, interesting and cool content that I subscribed and I will also become a Patreon member!
It might be possible to have USB HID with the new ESP32S?
Which music are used in this video
You should make one with vga so you can just stick it on the back on an old monitor , very small and tucked out of the way. This would allow for a smaller enclosure and it would be cool to see a esp based gaming platform on a dongle . Most CRT were VGA or DVI .. I like this tiny TV you show at the end of the video I have so many things I could use it for.
WOW!!! I just wanted to see how esp32 i can use s a macro keayboard :D :D :D
can this be used to emulate a HID keyboard? i.e. use esp32 as a keyboard to connect to the computer?
man, your soldering skills are beyond this realm. LOL .
Great video and well done.
Bet that was frustratingly fun 🥺😫😅🤔😁🤑
Awesome project! Shut up and take my money! :) Plan to sell these on your Tindie store?
can i use usb 3.0 keyboard with a ch559 chip? is there any limits?
Hi Bitluni, Would it be possible for you to share the circuit diagram for CH559 HID that you are using?
Thats a great video, I think PIC18 or PIC24 have USB too but might be a bit more expensive they have better software though
Please make more videos on USB host examples. There is a showstopping lack of teaching material on the topic..
I use the ATMega8U2 MCU as a USB host/client on projects. It's under £2, and has a lot of good documentation and examples for all types of usage. It would be good to find a chip that justs passes the USB peripheral data across to UART without needing to be programmed though - to save a step in manufacturing! A bit like the CH340 does for USBSerial
Esp32 can connect to ps3 using Bluetooth i have Arduino library for that
There should have been windows USB plug-in sound
sounds like hell 😅
Can this be use as usb midi host?
Aswome project!
audio multitrack record
I need a German teammate too 😅
Any chance it could be available on tindie? The console I mean :-)
oh this looks like a big promising update that could also(expanding on this) make usb to bluetooth DIY overall better.
Using that razor blade on the 3D printer gave me a shock.
Incredible work! I'm learning from 0 and have gotten a few sketches working. I'm a long ways off from writing drivers though! Is it possible to find these on breakouts? I'm biting off far too much in one go and making something very silly.
Incredible !!!
Hi bitluni, what kind of liquid do you have in your ultrasonic bath?
Avr maybe be expensive, but you get awesome documentation.
Thats why i stick with pic or atmel.
does any one knows the name of music track when Bitluni solder the components on board ?
how to make an wireless usb hub, with esp32, mr bitluni sir?
Это реально круто!
У русских блогеров на подобную тематику почти что ничего нет...
Where can I get Game ROMs that can be upload? Are the ROMs free?
Just a general piece of advice, take precautions when using software from foreign manufacturers
FTDI also have USB Host chips like these called "Vinculum". They also have a ready to use UART firmware. 😁
u got my subs