Introduction: IoTyper - Control Your PC Via Alexa (IoT)
Haven' t you ever thought about controlling your PC with IoT? Our World get' s smarter day by day and today we turn our PC in a even smarter PC than it already is. Let' s start!
IoTyper is based on two basic MicroControllers: The ATMega 32U4 which can emulate a keyboard, and the ESP8266 that has WiFi capabilities. IoTyper combines both of them. The result is an Gate for your PC to communicate with IoT-devices. To connect everything via WiFi you need an MQTT-Broker. I am using iOBroker for this. My System runs on an old, upgraded Laptop. It doesn' t need to be the newest and fastest! An Raspberrry Pi would do the job as well...
The principle The ESP8266 reads a variable that is stored at iOBroker. We can change that variable on many different ways, for example with Alexa ( you need a script in iOBroker that connects both together but you can find one online) or with any other Smart Assistants. Of course you can also simply use Apps like Apple Homekit to trigger an event, in this case the Unlocking of my Laptop. The ESP8266 reads the variable and sends it' s text via Serial-Line to the ATMega 32U4. The ATMega 32U4 sends the text as an Keyboard Output to the PC. I included a test sketch for Unlocking on this page too :) This should only be an example code - The possibilities of the ATMega32U4 are incredible! You can include these skills into all of your projects to interact with your PC via WiFi!
Let' s start with the Materials I used:
--> Arduino Pro Micro (I desoldered the IC)
--> ESP01 --> TD6810 Buck-Converter
--> 2.2 uH Coil
--> 2x 22 Ω Resistors
--> 2x 10k Ω Resistors
--> 1x 680 Ω Resistor
--> 1x 150k Ω Resistor
--> 2x 330k Ω Resistors
--> 1x 1k Ω Resistor
--> 1x 100 nF Capacitor
--> 2x 22 pF Capacitors
--> 1x 10 uF Capacitor
--> 1x 1 uF Capacitor
--> 1x 100 pF Capacitor
--> 1x 22 uF Capacitor
--> 3x LED (Color doesn' t matter!)
--> 1x 16 MhZ Crystal
--> USB-Male Connector
--> (Optional) Etched PCB
Tools I used:
--> Yihua 862D+ Soldering and Reflow Station
--> Solder tinn
--> Solder Paste
Step 1: Program Both MCUs!
Firstly you need to programm both MicroControllers. I have used the Arduino IDE!
I removed the ATMega32U4 from an cheap Arduino Pro Micro Board. That was cheaper than buying the IC standalone...
I used these Settings:
- --> Generic ESP8266 Module
- --> Flash-Size: 512k (no SPIFFS)
- --> Arduino Leonardo
If you have finished Programming you can start to Connect everything as shown in the Schematic.
Step 2: Install the Arduino Leonardo Drivers to Your PC
To ensure that everything works fine you need to update your Arduino IDE to the newest version. Furthermore you need the latest drivers.
For Troubleshooting look at the Sparkfun-Website:
Step 3: Connect It to Your PC!
Last but not least you can connect your board to your Computer. It would detect it like an normal keyboard. You can find the IoTyper as "Arduino Leonardo" in your Device-Manager :)
Step 4: Configuring IoBroker
The directory for the file has to be /esp/iotyper in the basic configuration. Of course you can change this in the Code of the ESP8266 which is included in this Instructable too.
Step 5: Modifying the Code & Future Outlook
If you succeeded soldering you may want to modify the code now. For inspiration watch:
The possibillities are endless!
By the way: I will design an 3D-Printed casing for IoTyper soon, when I am back home from vacation...
Hope you enjoyed :) Bye :D
Participated in the