Category Archives: Uncategorized

Mechanical keyboard build

This is something I’ve wanted to do for a while but never got round to. I was initially going to design my own PCB, but sadly A level exams are a thing, and I just wanted a quick project.

The parts:

Switches and LEDs fitted to plate and soldered to PCB

Half dressed…

Finished.

The keycaps are a custom set I designed and MaxKeyboards sent over from the US. The case is CNC’ed aluminium that’s been anodized. It cost a bit more than a plastic case but I’m glad I paid the extra as it adds a nice weight.

I tried inverting the spacebar and liked it so much that the Alts got the same treatment.

I flashed it with the QMK firmware, and modifying the layouts and layers is an ongoing thing. Holding spacebar is my main alternate layer, which gives me arrows, media keys and PgUp/Dn on the home row. I’m also playing around with some mouse functionality when Caps is held.

Bluetooth Speaker

17968937_1959024710996276_1944348986_oRecently I was given an old iPod dock for parts. Since I had some spare 3″ speaker drivers lying about, I decided to salvage the circuitry from the dock and make a portable speaker.

IMG_20170315_154003700 (1)

Spring afternoon exam procrastination in the garden

First, I had to make an enclosure. I used some scrap oak floorboards that I found in our shed, along with some pine for the front face.

17431448_1487279381304514_944488883_oimg_20170320_093957960.jpgimg_20170403_184854934.jpg

I routed a step into the top of the sides, and joined them with a simple mitre. Then I cut and chamfered the speaker holes from the front face.

Next, I salvaged the amplifier PCB. It was the only part I needed from the iPod dock since the speaker drivers were cheap and very tinny. I added a bluetooth module, a battery management board, boost converter and a pair of Li-ion 18650s in parallel before testing the electronics.

Everything worked great, apart from the fact that I wanted to use a latching switch for power and a potentiometer to control the volume. This was a problem since the amplifier’s only controls were 3 momentary push buttons for power, volume up and volume down. Since the power button would only work when it was pushed and released, I had to come up with a way to simulate that happening, whilst using a latching power switch. In the end I used a relay, resistor and capacitor to create a circuit which simulated pressing the power button for half a second, then releasing it, then holding down the volume up button. This allowed me to control the volume of the amplifier by using a potentiometer at line level on the input.

When first turned on, the relay closes the power switch until the capacitor charges up. When it is charged, the power switch is opened and the volume up switch is closed. When the power is switched off, the capacitor discharges through a bleed resistor.

The electronics assembly inside are rather messy, and use copious amounts of hot glue, but it does the job.

IMG_20170411_162942038 (1).jpg

The back has switchable inputs between a standard 3.5mm jack and a bluetooth module. There’s also a micro USB charging jack. IMG_20170417_170015821.jpg

Overall, I’m fairly pleased with how it turned out. The woodwork is pretty scrappy and could definitely be better, but it sounds pretty good 🙂

Modelling flight time

My latest project is building a small, fast, 250-class quadcopter. Since it’s designed to be light and agile, keeping weight down is an essential part of the build. A lot of the total weight (~1/4)  of the quad comes from the battery, so choosing the right size is a major decision.

I decided to model the flight time that different batteries would provide, based on their

  • Weight
  • Capacity.

Since the current drawn by the motors would be directly determined by the weight of the quad, I needed to find how much current my motors would pull for a given amount of thrust.

CaptureOf course, this is not a linear relationship, so I used a thrust table for the motors I am using to plot some points in GeoGebra, then created a quadratic function to fit them.

Next, I made a spreadsheet which takes a weight and capacity of a given battery, and calculated the flight time. It is available to view here.

The gist is:

  • Find total weight
  • Find thrust needed per motor (hovering)
  • Find thrust needed per motor (if tilted at a certain angle)
  • Divide this thrust by a constant, determined by how smooth/aggressive the flight is (~0.95 for smooth flying, ~0.5 for acrobatic flying)
  • Use the Current-Thrust model to  find the current supplied to the motor to sustain this thrust
  • Multiply this by 4 to find the total current
  • Using this current, and the battery’s capacity, calculate the flight time in minutes.

I will be interested to compare the predicted times with my actual flight times once I’ve finished the build.

Quadcopter

IMG_20160124_135902005My latest project has been to build my own Quadcopter.

CaptureCaptureWeight

 

I spent a while researching in late 2015, got some parts for Christmas, and have been building since. As you can see from the costings graph above, my main expense was the RC transmitter, as I decided to go for one that supports telemetry. For a flight controller, IMG_20160124_081304359the Arducopter project appealed to me as it uses completely open source software and hardware, so I can customise/hack any part of it I like. I chose an S500 frame as it’s suitable for aerial photography but not too large, and it comes with a PDB (Power Distribution Board), which makes cable management a lot easier.

It had its maiden flight today, and now that it’s working in its most basic form I’m looking forward to adding a camera, and having a fiddle with the source code 🙂

IMG_20160118_180944368

Control Panel

Lately I used an Arduino Leonardo’s native USB communications to make a control panel for my IMG_20151026_160419134computer.

It can open applications; cut, copy and paste text; switch and close windows; run a demo; as well as turn off the computer.IMG_20151121_190548872

Clap Clock

Recently I was given an old CD player that wasn’t needed anymore. I decided to hack the electronics, and turn it into a clock (because what else would you turn an old CD player into?). I attached an LCD screen to the CD tray to display the time, and wired it up to an arduino.

I had decided that I wanted the clock to slide out the CD tray and display the time on the LCD when it heard a clap from someone in the room, so I hooked up a simple electret Mic. I also wanted the sound threshold at which the clock triggered to be adjustable, so I traced some PCB tracks and probed terminals until I found the connections to the buttons on the front panel of the CD player. I then hooked these up to the arduino with some pullup resistors.

Next I figured out how to control the opening/closing of the CD tray, so I found the relevant terminals on the old PCB and soldered them to an arduino motor shield. I attached a Real Time Clock to make sure the time was accurate.

photo 1 [42642]

Finally I put it all together and wrote some simple software. Demo in the video above!

Code can be found here: https://github.com/musicboyben/clap_clock/

Electronics course in Southampton

Last week I attended a Computing and Micro-electronics course at Southampton university.

We worked in teams of 5 to build a completely autonomous robot capable of fetching blocks and taking them home to base, navigating and spotting blocks by means of a webcam. The video above shows my team’s robot in the competition at the end of the week, against three other robots in the same arena. Within my team, I was responsible for the programming of our bot.

After a lot of hard work and midnight GitHub commits we came second out of ten.

Code can be found here: https://github.com/musicboyben/robot