[go: up one dir, main page]

Electronics

A collection of SMD switches

Who doesn’t love a good button? Click click click, so satisfying. In the search for SMD switches / buttons, I thought I’d just buy some of “all” and try them out. I realize there are many more, this is just what I found browsing Aliexpress. This doc is mostly for me, but I’ll probably spent way too much time on it, so I might as well put it up. Criteria (more or less)

Tiny USB keyboard with ATMEGA 32u4 - it works!

After a USB keyboard with an ATTINY85, a try at one with ATMEGA 32u4, I’m now at revision 2/3 for the ATMEGA 32u4 single key, USB keyboard. Overview Same as before: a simple USB keyboard with 1 key reprogrammable tiny mechanical keyboard key cheap enough to give away actually works debuggable The “cheap” aspect was mostly to justify making & buying some :). Hardware design Since the previous design mostly worked, I tweaked to make two versions.

Tiny (still-flakey) USB keyboard with ATMEGA 32u4

After making a USB keyboard with an ATTINY85 and noticing it wasn’t the “yellow of the egg”, I decided to try at making an ATMEGA 32u4 version. Overview What I was looking to make was (recap from previously): a simple USB keyboard with 1 key reprogrammable tiny mechanical keyboard key cheap enough to give away actually works debuggable The “cheap” aspect was mostly to justify making & buying some :). These costs a bit more than the ATTINY85’s, but still not super expensive.

Wifi-control for a 5050 LED strip with ESP32

The 5050-type LED strips are pretty cheap, and can (sometimes) be controlled by ESP32’s fairly easily. The rough idea is to connect the individual color pins to a NPN transistor and to control them with an ESP32 PWM output pin. 5050 LED strips are always set to the same color, you can’t control them individually. There are different voltages of strips available - we’re using 5V since they seem to be pretty cheap, and they can just be powered by a USB cable.

Picking an ESP32 dev board

There are a bunch of ESP32 dev boards out there, and if you don’t want to make your own, you probably just want to pick one that just works well & is cheap. But which one is for you? Learn from my failures in picking boards. Updated December 2020 (well, that’s when this was written) For most use cases, these boards are equivalent and differ by pin count, board size, lipo support, USB port, and random accessories.

Tiny (flakey) USB keyboard with ATTINY85

It would be neat to have a dedicated key to mute myself in these ever-present video meetings. I don’t have a lot of clues when it comes to electronics, but this was an interesting first project with a PCB of my own. Overview What I was looking to make was: a simple USB keyboard with 1 key reprogrammable tiny mechanical keyboard key cheap enough to give away The last item was probably just a self-justification - if I make a board, I might as well make a bunch of them.

Visual Studio Code for ESP32 / ESP 8266 - a c_cpp_properties.json sample

Setting up Visual Studio Code for ESP32 / ESP 8266 development can be a bit awkward, if - like me - you don’t know exactly what’s happening behind the settings. The “C/C++ IntelliSense, debugging, and code browsing” plugin makes working with Visual Code a bit easier, but it needs to be configured for ESP projects. Luckily, that’s not too hard. #include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/home/(etc) ).

Basic 3.3v power supply / regulator

Not all Arduinos can supply the 3.3v that the NRF24L01+ needs directly. For example, the Nano only supplies 3.3v if powered via USB. To get 3.3v from a power source (such as what you would use to power the Arduino, or the 5v output of the Arduino), all you need is a regulator and a capacitor. For this, I used a LD1117v33 (archive.org) (the LM1117v33 (archive.org) is pretty much equivalent) together with a 10uF capacitor.

Using the Nordic nRF24L01+ with a Seeeduino Mega 1280

The nRF24L01+ module (sources (archive.org)) is a really cheap & easy way to achieve wireless communications. With the internal antenna, the reach is about 100m (open area), with an extra antenna it’s apparently 1100m+. One popular Arduino library for it is the Mirf library (archive.org). Connections Required pins with fix locations / can’t be moved: Arduino Uno / Nano (archive.org): MISO -> 12 MOSI -> 11 SCK -> 13 Seeeduino Mega 1280 (archive.

Ultrasonic-triggered MP3 player with Arduino

This small MP3 player is triggered when the ultrasound sensor notices someone nearby for a longer period of time (must be closer than 70cm for >0.9s). The hardware uses: Arduino Uno R3 (archive.org) Seeed Studio Music Shield v1 (archive.org) and micro-SD card with a MP3 file (shop (archive.org)) HC-SR04 ultrasonic distance sensor (eg shop (archive.org), they’re cheap) Breadboard, speakers, jumper wires Optional: LED, 330 Ohm resistor (to show that it’s still running) I hacked the Music Shield to include risers for some of the pins.