MemPot v1.0, potentiometer with a memory
Introduction
MemPot was developed by Dan Blackburn and me as a control interface for circuit bent instruments and sound generators. MemPot is a built around PIC 16F819 microcontroller that reads analog resistances, records them to memory and plays them back via digital potentiometer DS1267 chip. The memory buffer size and the playback speed can be adjusted.
The first PCB
MemPot was the first circuit design we finally got one proper PCB made for us. That was rewarding experience, although not without any problems. I learned myself the widely used Eagle CAD software during the design process and there are couple of things that I missed. Firstly, by mistake I chose too small resistor packages from the library, so the 6mm long, most common resistors, don’t fit horisontally but must be soldered vertically. Not a big thing luckily. The other is bit more inconvenient. I forgot to put extra solder points for GND and +5 used in the interface (outside the board) so when wiring the switches and pots, the GND and +5 must be wired to exposed points on the board. Coincidentally the exposed legs of vertically soldered resistors turned out to be just fine for this, so the first mistake kind of solved the second one.
- picture of the schematic (version 1.0)
- schematic and board file in Eagle format (version 1.0)
- PIC code (V1.0)
- example videos in YouTube
Making the MemPot with the PCB is straightforward. Solder the parts in any oder you like, I have usually done the chips first. There is a ICSP socket for updating the PIC code, so using IC socket is not necessary. If you are concerned of damaging the chips, use sockets for the PIC and the digital potentiometer chip. If you don’t have PIC programmer with ICSP port, you naturally need to flash the PIC first and use socket in order to update the software.
When you are done with the board, you can test some of it before doing the interface. If you power the board, the LED for indicating setup mode blinks few times and then turns off. Next is the interface. Before wiring the switches and pots, you need to make some decisions for the case and see how long wires you need from the board to the panel. Drill the holes for the pots, switches and the LED and attach them to the panel. Wiring them to the circuit is easier when they are fixed in place on the panel. Solder the wires according to the diagram below.
Using it
MemPot is a controller, so you need something to control. Simple sound maker like the NandSynth or APC with resistance controlled pitch will do. If you have some circuit bent instruments with pot or LDR controlling something, hook MemPot to that. This first version of MemPot has two outputs of 100K resistances of which we are using one. You can put larger physical pot in series with the digipot output to change the range, to 500K-600K instead of 0K-100K for instance.
Power up the board and the preset buffer should play, linear ramp of 0-100K resistance in loop. Adjust the playback speed from the speed pot. Hold down the rec button and tweak the rec pot, LED starts blinking. When you release the rec button, the recorded tweaking should loop. MemPot overdubs, so when the buffer gets full, it overwrites the memory from the beginning. You can change the buffer size by entering to setup mode from the toggle switch. LED lits when in setup mode. Now you can use the speed pot to change the buffer size. Try very short by turning the pot almost all the way counter clockwise. Exit setup mode from the toggle switch, the very beginning of the previously recorded buffer should play.
Improvements
The indication of speed and buffer size does not exist. I have used serial LCD screen or PC to debug the values, but simple gauge from few LED’s would do as well. For closed case, a power switch and power LED would make sense. Toggle mode for overdubbing vs one-time recording would be useful together with sync signal from one extra pin on every pass of the starting point of the loop.







20070827 8:00 pm
[…] MemPot documented here. […]
20070829 8:21 pm
Question: Can this be modified to record x/y movements of a joystick ( like a blacet one with two pots?)
20070829 8:36 pm
Anything that that gives out resistances or voltage changes in 0 to +5v range can be recorded. So if there are some kind of variable resistors / sliders / pots inside the joystick, it can. If the analog input is voltages, eg accelerometer, a minor change should be made to the circuit. Switching joystic, the normal ones with just 4 switches of some kind can also be recorded, but that needs different sizes of resistors serially with each switch to identify the 4 or 8 positions or using different pins in digital mode for each switch and changing the PIC code accordingly.
20070830 8:26 am
okay, i was a bit unspecific. the joystick is an analogue one, with two potentiometers, one for x and one for y.
is the current pcb design to read/write values for BOTH pots simultaneaously ?
20070830 1:29 pm
The current circuit supports reading four variable resistors simultaneausly of which we have been using two. However, the resolution decreases, since the pots are read one by one but still quite fast in a loop. The current code supports one pot values to memory and the other one used as the speed. Storing two pot values to memory halfs the available buffer, but additional eeprom or pic with bigger eeprom would solve that. To sum it up, you need to change the pic code a bit to store values from two pots and you split the memory between those two, still this is quite ok if you need short loops. The length of the loop is relative since you can adjust the speed. The fastest is
20070830 1:32 pm
(continued)… The fastest is playing the whole buffer in half a second the slowest is very low resolution (all values in long steps) but takes couple of minutes to run throught. There are 256 byte memory in the pic we use, so 256 values, 128 for two pots etc.
20070904 9:04 pm
Tuomo: can you provide me with a PCB and the modified code ? i’ll need it for a modular synthesizer, so the duration is fine, if it is some seconds, but x/y is surely needed. it’s kinda “store the pot moves” in order get voltage manipulation.
20070904 9:47 pm
I’ll fix few things with the setup and document it bit more. Then I can probably sell few of the extra ones.