ATTINY85 NeoPixel bicycle led light

I wanted better side visibility when riding my bike back from work at night.

I used two long servo cables to connect the  ATTIny85 board to the Neopixel LED strips, and some hot glue to hold things in place

Mounted it to my rear rack with a USB battery pack.

0120faf2d010af3f65588e42edf566a8b9978dc0a4

Added ATTiny ISP circuit on board for easy reprogramming using Evil Mad Science Labs Arduino ISP shield.

attiny_combined

Matias Mini Quiet Pro FK 303 keyboard scan matrix

I have been using a Matias Mini quiet Pro keyboard at work for a while now. I recently decided to replace it with a KB Paradise V80 (also with Matias quiet switches) to match the TKL layout of the keyboard I use at home. This was mainly because the different key placement between my home and office keyboard was driving me crazy. Using the standard TKL layout is nice, but the thing I miss the most about the mini quiet pro is the stealth space bar, which has to be the least noisy spacebar I have ever used. I should post a comparison video/audio of it someday.

matias1

 

By inspecting the photos posted on a review of this keyboard I realized that the keyboard controller daughter board was replaceable. So I decided to make a Teensy based replacement controller board so that I can make custom key mappings to fix some of my issues with this keyboard:

  • Change page-up, page-down to home and end
  • Change F12 to default to insert, and Fn+F12 to F12
  • Change caps-lock to Fn

01d0cc6720540417bb95fa4e78492d0c3b26f642a8

Opening the keyboard involved removing two screws on the back (thankfully without any warranty void stickers) followed by using plastic cards to push in the 7 tabs holding the top plate to the bottom plate. The plastic tabs are fairly sturdy but I somehow managed to break one of them the second time I opened the case, so do be careful about not pulling apart the top half till all the tabs are released.

DSCF5539

The key switches are mounted on a metal plate and soldered on to the two layer FR4 PCB. The daughter board with the 1×4 USB hub chip (Genesys logic GL852G) and keyboard controller (Weltrend WT6522, uses one of the 4 hub ports) mount on a daughter board which connects to the main board via 2mm header pins. The keyboard scan matrix is wired up to the two 17 pins sockets, which for some reason are offset by 1.5 pin width (1.5 * 2mm = 3mm). The other two sockets are used for the three USB hub ports.

DSCF5528DSCF5537

DSCF5533

After some googling I came across this post about reverse engineering the keyboard scan matrix. I mostly followed the directions from that post but with the following important additions:

  • Since one of the keyswitch terminals is connected to the scan row/column via a diode the polarity of the multimeter probes matters. I placed the black/common probe on the keyswitch terminals and scanned the pin headers with the red probe.
  • The left terminal seems to have a diode on most keys – and I named it pin 2, and the right terminals as pin 1 for each switch.
  • The pin with the diode made a blip sound vs. continuous beep sound for the pin without the diode.
  • As you scan though the keys remember to make note of which key blips vs. beeps
  • Build a table and use rows for pins that go blip and columns for pins that go beep, and add the PCB screen print label at the intersection of the row and column

 

 

0144a5aaffcf6cf087d1204cac77a4fa6305c60d9a

Scanning through all the keys took somewhere between 2 to 3 hours with multiple breaks taken in between. And then another hour to analyze and compile the data and find measurement bugs/typos.

Google drive spreadsheet with scan matrix details here.

Next I need to figure out how to make a PCB for this in Eagle/KiCAD and then map the pins to a Teensy 2.0++ board.

Keycap comparison

Cooler master Quick Fire ABS vs. KB Paradise V80 double shot ABS vs. Matias Mini Quiet pro ABS:

 

 

Cat feeder servo Motor upgrade

This weekend I upgraded our Cat feeder from the Parallax continuous rotation servo motor to the more powerful and faster PowerHD continuous rotation servo from Pololu bought during their black friday sale.

Also used the opportunity to wash and clean up the Zevro KCH-06138 dry-food dispenser.

The servo coupler, mount, hubs, gears, plastic link chain, misc. hardware was sourced from ServoCity and my local hardware store.

The arduino Diavolino and chronodot came from EMSL, the bluefruit from adafruit, and other stuff from seeedstudio, mouser etc.

Thing still left to try out:

  1. Reduce the serving size
  2. Better SW debouncing the rotary encoder
  3. Test and check with larger quantities of food

Frosty Flake controller for Cooler Master Storm QuickFire Rapid keyboard

After a sudden brain wave last week I had been googling to see if anyone of the mechanical keyboard models had easily modifiable firmware and realized that the very keyboard I was typing on had a removable daughter board… and there was already a ATmega32U2 (note U2 & not U4) replacement controller available for it called the Frosty Flake.

I ordered one of these and will be documenting my changes to the firmware here. Here are a few photos of it next to the original board (thinner and flimsier).

I also decided to remove the top plastic cover on my keyboard to give it a more naked look and taped up the controller to avoid shorting it. I plan to make a transparent acrylic laser cut cover for the Frosty Flake.

01d135d9843b976dcbb92e615f0c9c0427f32cd37b

Power Raspberry Pi directly with Lithium Ion rechargeable batteries

From reading Adafruit’s excellent dissection of the (then new) RPi Model B+ power supply I had learnt (from the schematics) that 5V GPIO pin was directly connected to RT8020AGQW step down DC/DC converter (5v to 3.3V/1.8V) which automatically switches to a low-dropout mode.  So it should be possible to power a RPi B+ with much less than 5V at the GPIO 5v pin. Relevant excerpts from the data sheet:

Two operational modes are available : PWM/Low-Dropout auto-switch and shutdown modes. Internal synchronous rectifier with low RDS(ON) dramatically reduces conduction loss at PWM mode. No external Schottky diode is required in practical application. The RT8020 enters Low-Dropout mode when normal PWM cannot provide regulated output voltage by continuously turning on the upper PMOS.

Rds_RPi

Since I did not have the right equipment to test for this at that time I tried calculating it from the datasheet. Assuming a worst case Rds of 0.5 ohms for the PMOS at a current of 700mA (model B+, camera module, USB wireless) I get a voltage drop of 0.35V across the PMOS. So if we ideally want 3.3v at the output, then VIN should be 3.65V. At this point I should add that I am not completely sure if that is the correct way to estimate the dropout.

Now that I own an adjustable power supply I wanted to test that out. The only RPi I had on hand was a model A+ so thats what I used.

DISCLAIMER: All numbers below are from a very rough test and come with no guarantees. This means that if your house burns down or something terrible happens because of using something I said then I am not  to blame for that.

Test A:

I tried booted the RPi at 5V, with a keyboard and HDMI monitor connected. Then I launched Minecraft (wish the RPi foundation included a stability testing benchmark) and started lowering the voltage. For the short duration of time that I tested I was able to run without any brownouts at 3.5V. Going lower to 3.4v or even 3.45V would cause random reboots, which brings us to the next test.

01945a9c7fc4c34230ff0884c13f99afb23d015780

Test B:

While the RPi was rebooting I increased voltage back to 3.5V but noticed that was not sufficient and the RPi stayed stuck in a continuous reboot cycle. I was able to see the RPi booting up messages but at some point during that it was get reset. In hindsight I should have tried to make a video to figure out when exactly the reset happened. I next tried 3.6V which also did not work. I was only able to stop the reboot cycle at 3.7V.

01a07dcba2cc9da5ee10bc21b2964d116874a85c34

Test C:

Next I unplugged the keyboard and plugged in wireless dongle and again tried lowering the voltage. I was able to sustain a download over wifi with X server loaded at 3.5V.

Conclusion

The calculation was fairly accurate and as expected the model A+ was able to operate at a lower voltage than calculated because of using less current.

Coming back to the title of this post, I went down this path because I wanted to minimize components and was wondering if I could directly power the RPi for my remotely controlled home rover from the Li Ion battery. Searching for lithium ion battery discharge curves I see that at 1C rate reaching 3.5V would be somewhere in the 60% to 80% discharge capacity of the battery. So if I want to use the full battery capacity I should use a step-up converter, but if I don’t care about that I should be able to power up a Rpi with a lithium battery connected directory to Vin. Monitoring the current and voltage to the RPi might also be a good option to ensure stability to raise early warning if the voltage goes too low.

Relevant products:

Adafruit INA219 breakout to monitor current and voltage to the RaspberryPi.

CPS-3205 power supply bought from ebay

Lenovo ThinkServer TS140

-under construction-

I recently got an Intel Core i3-4130 variant of the TS140 for a great price ($230) and have set it up as my home Linux file server, which I intend to put to use to replace a Synology NAS that I am using currently.

This place holder post will get more details of the setup over the next few weeks.

Things I am planning to try:

1) Kubuntu

2) btrfs/ZFS mirror

3) timemachine

4) samba

5) UPS nut client server

6) Airprint