APV Mod Round 1
After many months of using and ultimately becoming an enthusiast of electronic cigarettes and their associated technology, I decided to put my unique skills to good use. Naturally, therefore, I'm building an Advanced Personal Vaporizer "mod"!
I started by putting together a list of requirements, as well as just "nice-to-haves".
- Open source and hackable!
- Variable Voltage
- Variable Wattage
- Microcontroller for brains
- Resistance measuring
- Portable and handheld
- Intelligent display of settings
- Intuitive navigation and interaction!
- Cheap and easy to source parts
- Easy to use parts (No surface mount)
- Battery monitoring
- Battery charging
- Passthrough power
Being hackable and open source was a very important component to my efforts, in hopes of increasing the variety and choice in the vaping community I've become a firm part of.
Secondly, I also hoped to accomplish a better design than I'd seen from homebrew or more "commercial" devices, particularly with respect to how you interact with the system to switch modes, change settings and generally operate it.
I began working on the design, gathering parts, building some basic functional components and writing a lot of code. I also took an initial stab at a mockup diagram.
I had in mind to use a small 4- or 5-way thumb-operated joystick, to interact with the device, though I was also considering a rotary encoder mixed with dedicated buttons. Ultimately I decided on the joystick from Adafruit:
This turned out to be really awesome and a joy (hah!) to use.
I also decided to start prototyping using an Arduino Micro for the microcontroller.
For the display, I chose Adafruit's Monochrome 128x32 OLED display, with the I2C backpack for easy serial programming.
I ended up building a bit of a custom breakout board -- a small circuit board to hold a few components separate from other boards -- for the joystick, because the pins on it are not spaced like a normal breadboard. I used a small bit of perfboard, some header pins and a lot of swearing and hackery.
There's also another chip I needed, which gave me an awesome excuse to use my ZIF (Zero Insertion Force) DIP socket, and any excuse for that is a good excuse. We'll talk about this chip in a moment.
Once I had all of these bits working together nicely on a breadboard, I could move on to the power portion of the design.
For the power circuitry, I chose to start with a Murata OKR-T/10 chip to be used as a high-power adjustable voltage regulator. This chip also has non-standard pinouts so I built a breakout board for it as well with some high-current terminal blocks for wiring.
In order to control the OKR, I needed to present a variable resistance to the chip to adjust the voltage it outputs. However, it turns out to be very difficult to create a digital potentiometer (variable resistor) from discrete components which behaves in a way the OKR expects. I attempted to make a linearized MOSFET Voltage-Controlled Resistor, and it worked to some degree, but really not that well.
So ultimately I decided to use a digital potentiometer IC chip. I'll be going into the engineering and calculations involved in another post, but I actually had to write a piece of software to generate lookup tables of values to operate a digipot that didn't violate my list of requirements.
The completed prototype testbed is a bit hairy looking, but it actually works like a champ! I even got my lovely wife to text me a picture of the setup while I was at work, so enjoy.
There's still plenty of tweaking to do, but you can see a short video of some early navigation and display testing I did during the process.
I wrote a fair amount of code as an Arduino Library in order to operate this mod, as well as serve as a starting point for other mods. I put the code in a Github repo to get it out in the open ASAP and hopefully get collaboration from other modders.
Currently, the library is called "Apsuke" as an amusing portmanteau of my handle and "duke", in homage to The Duke mod, which some aspects of my design were inspired by (thank you for your work, Goss!)
There'll be more to come on this mod as I make more progress, so stay tuned!