Posts

Showing posts with the label electronics

OpenSCAD Module for Rounded Boxes

Image
I got kind of tired of rewriting the same OpenSCAD code to build rounded boxes for things and messing up the minkowski sum math in the process, so I built a simple module to do it for me.  Usage is simple: include <rounded_case.scad> rounded_case(25, 25, 10, 2); The paramaters are: rounded_case(X, Y, Z, T, LID , LID_OFFSET ) Where: X, Y, Z : Inside dimensions of box T : Thickness of walls LID : optional, bool : true to also make a lid LID_OFFSET : optional :  how much smaller to make the "lip" of the lid that fits inside the top of the box The outside dimensions of the box will be the inside dimensions + 2 x T.   E.g. if the X dimension is 20mm, and T is 2mm, then the width of the box will be 24mm (20 + 2 + 2).   The example above will make a box that is 29mm x 29mm x 14mm (with the lid on) on the outside, and 25 x 25 x 10 on the inside. Get it here:  rounded_case.scad

Generic $5 128x64 OLED SPI display with Arduino Pro Micro

Image
I bought a couple of ~$5 generic 128x64 graphic OLED displays on eBay to play with.  It took some trial and error to figure out how to get the Arduino Pro Micro to talk to them, and there's lots of different information on the net about doing so (probably owing to the wide variety of implementations of these displays and generic controller chips.) This particular one uses the SD1306 controller and is wired for a 4-wire SPI interface. I used the u8glib library to talk to it.  The "gallery" page on the library repo provides lots of examples of people's various combinations to make these work.  This particular one wasn't shown, but by perusing through the different examples I was able to find a combination that worked. Wiring: I'm using the SW SPI function of u8glib, so I don't have to use the ARM chip's native SCK or MOSI pins.  I found that this device will accept data without the CS pin connected (pulled low instead), so I left that out to s...

Programming a generic STM32F103C board in Arduino

Image
A while back I purchased some generic STM32F103C8T6 development boards on eBay for about $4 each.  I initially had some limited success programming them using the GCC ARM Embedded (eabi) toolchain and a generic STM32 loader program.  Since then I've discovered a project to get them working with the Arduino 1.5+ toolchain. There's a lot of different information about the various STM32 boards out there.  I'm documenting my notes here mostly for my own sanity since I don't play with these boards often.  Maybe you'll find it useful too. Arduino hardware library for these boards: https://github.com/rogerclarkmelbourne/Arduino_STM32 "Support" forum:  http://www.stm32duino.com/ The USB port The generic boards do not have a meaningful USB bootloader.  The USB port is only useful for power.  (TODO: Flash the "Maple Mini" bootloader onto them for future ease of use?) Arduino Board Selection & options Tools -> Board -> Generic S...

Arduino-based barometric altimeter / altitude deviation alerter

Image
While working on my instrument training, it occurred to me that I had everything I needed in my parts bin to build a device to help alert me to deviations in altitude. So, I built MonkeyAltimeter. It started off on a breadboard while I worked on the code: Then, I took it for a flight test (primarily to see how accurate it was in the cabin and see if my VSI routine worked): Finally, I designed and printed a simple case for it: The details,  parts list, operation manual, &etc are here: http://www.thingiverse.com/thing:942832 The source code is here: https://github.com/phreakmonkey/MonkeyAltimeter Enjoy!