Archive for the 'DRU July 2007' Category

MemPot v1.0, potentiometer with a memory

20070827 19:50


DSCN4641.JPG

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.

DSCN4642.JPG
Making it

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.

MemPot_wiring.jpg

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.

Beeps workshop outcome

20070713 23:32

DSCN4295.JPG

Beeps, waves and bass lines workshop took place in DRU studio in Bates Mill, Huddersfield. Six participants plus me and Dan had intensive three days with making electronic instruments namely the Nandsynth and MemPot controller. Feedback was positive from the participants regardless of some dark moments of debugging the circuits.

For improving the workshop a few remarks: Working with stripboard vs ready-made PCB for first soldering job is bit challenging. Since making PCB’s is an extra expence, pre-cutting the strips and marking the component places will solve this equally. Again, I think I underestimated the time needed for completing work in workshop context. Keeping the workshop schedule on time while solving unavoidable problems is more difficult point of improvement. I feel my time management is still not in balance. All suggestions from the participants are most welcome here.

Workshop material is online and I will publish the revised tutorial sheets as soon as I check the changes.

Thank you again, Rob, Frank, Dave, Rees, Jordan, Robert and Dan!

MemPot PCB

20070702 21:33

DSCN4252.JPG

The first batch of MemPot PCB’s arrived. This was a Eagle learning process and there might still be mistakes in the design. The learning curve for Eagle was a bit steep, with three different editors: library, schematic and board, all interconnected. Good tutorials are available and after a days slow reading while doing paid off and it started to make sense. Lot of the work was finding correct libraries for different components and making some of myself. Due to the fact that many libraries seem to be done by the Eagle users, there are some inconsistencies with naming, package, wire and pad sizes. This, and the various requests from the PCB manufacturer was quite confusing but it seems that they matter mostly when doing delicate multilayer design with very small / sensitive components. Big old-skool DIL design with microcontroller and few resistors and caps is more forgiving. Still, one PCB needs to be soldered to see if it really works.

The Eagle CAD files are here. I hope I can post the final verdict on the success of this design later this week.

Quad NAND Gate - synth, the Nandsynth

20070613 19:32

6_NAND.JPG

Introduction

This experiment is based on an example in Nicolas Collins’ book: “Handmade Electronic Music, The Art of Hardware Hacking”. The motivation for this experiment is to learn IC logic chips and to prepare inexpensive experiments for sound making electronics workshops. This is a first version, please be aware of possible errors. All corrections and contributions for improvement are highly appreciated. This post will be updated.

The misuse of Quad NAND Gate 4093 chip makes simple & cheap way to synthesise modulating square waves. Misuse, since the 4093 chip was not designed to make sounds but to do boolean logic, as a member of highly successful CMOS 4000 series IC chips form late sixties.

A single NAND gate has two inputs and one output. The 4093 chip has four NAND gates, hence the name QuadNAND gate. The NAND stands for one of the common boolean logics (Not AND) where two input states, highs(ones) or lows(zeros), define the state of the output. In NAND case, if neither of inputs are high (being low) the output keeps high. If both of the inputs are pulled high the output inverts to low. If one of the inputs is low the output is always high. The chip uses Scmitt Trigger comparators, which provides noisless & direct swapping of the states.

To turn this to sound it helps to understand basics of the sound. To put it very short, when there is changing states there is frequency. If the frequency oscillates through air and is in the range of hearing, there is sound. If we do the above mentioned state swapping we generate oscillation, a square wave signal of highs and lows, which can be amplified and heard.

Basic square wave can be made with just one NAND gate. The first input is connected high(+5 to 15V) the second is connected low(GND) via capacitor and the output is fed back to the second input via resistor. The chain of events in a fast loop:

  • input1 is driven high, the input2 is low, making the output high
  • the high output recharges the capacitor in time affected by the feedback resistor
  • charged capacitor pulls the input2 high, output goes low, capacitor discharges
  • back to the beginning

The frequency generated is based on the capacitance and resistance of the components menitoned above. Increasing the resistance with eg. a potentiometer, less current will flow to capacitor, slowing the “swapping”, lowering the pitch. The higher the capacitance, the longer it takes to recharge, forcing the range of the sweeping pitch lower. This experiment uses 100k pots with 0.1uF and 2.2uF caps. The big cap keep the range very low, in rhythmic clicks, where the small one takes the range high in clear pitch frequencies.

NAND gates can modulate each other. By connecting the output of gate1 to the input1 of gate2, the swapping high-low cycle enables and disables the second gate very fast while the the second gate produces its own frequencies. This can be fed further to the gate3 and so on. This results to complex square wave modulations worth experimenting so read on.

nandsynth_1

Making it

This configuration can be done with breadboard, which is highly recommended for experimenting the logic first. For this first version, I used stripboard and connectors for changing between two caps and inserting variable resistors. Wiring here can be simplified. I have all wires on component side for clarity. This circuit works for me, this explanation is not proofed, build it with your own risk and please report any errors to me.

1_NAND.JPG

1. Solder the 4093 chip with enough space on the sides. Using socket is always wise. I chanced it here. Old CMOS chips are sensitive to static so be aware. Solder the GND(black) wire to pin7(lower left) and the +V(red) to pin14(top right) notice the chip orientation from the marker on the top. Remember to cut the strips from the solder side between the pins, see 3b.

2_NAND.JPG

2. Solder the two caps between input2(pin2) and gnd. Put the smaller cap closer to the chip, break the connection from bigger cap to ground and solder jumper pins over that break. When jumper is connected the bigger cap goes in parallel with the smaller cap, “overriding” the smaller cap and switching the pitch range to very low end. Solder the output1(pin1) to +V. This connection can be replaced with jumper/switch if you want to trigger the synth sound externally. If you use the same stripline for the cap gnd and the pin1, remember to break it on the solder side!

3_NAND.JPG

3. Solder the 4way connector (or wires) to the pins2-5, right besides to the chip. This gives us resistor insert points for gates1&2. Wire the output of gate1(pin3) to the input1 of gate2(pin6). Solder the main power pins or battery clip to +V and GND strips on the top. At this point you can try to test the first gate by putting a resistor in the socket between the pins 2&3 and taking signal from pin3 to the tip of the audioplug and commong GND from the board to the sleeve. Notice the warning of using mains connected amp in section 6 below.

3b_NAND.JPG

3b. Remember to cut the “multiused” strips from the solder side if using stripboard or wire all the necessary connections if using dot-board. (Sorry for the blobby soldering, I’m still struggling with my new leadfree solder.)

At this point you can try to test the first gate by putting a resistor in the socket between the pins 2&3 and taking signal from pin3 to the tip of the audioplug and commong GND from the board to the sleeve. Notice the warning of using mains connected amp in section 6 below.

4_NAND.JPG

4. Solder the caps to the gate2, between pin5 and GND, same jumper break as before. Solder the output of gate2(pin4) to the other side to input1 of gate3(pin8).

5_NAND.JPG

5. Solder the caps, jumpers and sockets for gates3&4 accordingly. Check the 4093 specsheet for pin order. Solder the header pins to all gate outputs (pins3,4,10,11), the green headers in the image. Notice, these are the signals for the tip of the audio plug to amp. You need to take the common GND from the board to the sleeve of the audio plug.

6b_NAND.JPG

6. Wire the pots / resistors / LDRs to the sockets. Double check the solder points for shorts to strips next to them and use magnifier to check that cutted strips are properly disconnected. Power up the board, feel if the battey or the chip warms up, if so disconnect and look for shorts. Take the audio signal from gate4 output(pin11) to amp together with common GND. Signal is loud, be aware. Caution! Broken amp connected in mains can give an deadly electric shock when using exposed wires. Build simple battery powered amp with LM386 chip like this, or use battery powered active pc speakers if unsure of your amp.

Using it

Start with the first gate, varying the resistance between pins2&3. Take the audio out from header in pin3. Try the difference with a jumper enabling the bigger cap in gate1. Move to gate1 modulating gate2. Put another pot between pins 4&5 and move the audio out signal to pin4 (gate2 output). Experiment with the pots and cap jumpers. Carry on to gate3 and gate4.

Instead of a potentiometer as a controller, you can try different variable resistors. Slider, like mixer fader gives very quick interface of varying the resistance, close to scratching speed. LDR or photoresistor can give gestural control when blocking and revealing light hitting to it.

If you want more automation, you can build the Memory Pot from our earlier examples, where the pot turns are recorded and playdback with variable speeds.

Mempot&NAND.JPG

Or you can build simple sequencer varying the resitance in discreet steps like in the SwitchSequencer example below. Check also the videos of our experiments.

Sequencer&NAND.JPG


Sign-up for a workshop in July!

20070605 19:48

BWB_poster

Do you want to make a machine that goes ping? Repeatedly, in a glitch-funk manner? Participate our workshop just prior to the We Love Technology -day in Huddersfield, UK. July 9.-11. & 12. 2007. Sign-up via WLT site and check the details in Workshops -category on the right.

We Love Technology

20070604 21:07


Thursday 12 July 2007
The Media Centre, Huddersfield, West Yorkshire

Compered by Matt Locke
Commissioning Editor for New Media and Education, Channel 4

Led by pioneering technologists and artists working in areas such as interactive architecture, sound and games, We Love Technology presents the latest adventures in the creative use and misuse of technology. In a bid to encourage a more human-centric future WLT07 presents a full day of informal presentations, workshops and performances and experimentation in the creative control over technology.

www.welovetechnology.org

MemPot, the prototype

20070601 01:54

mempot1.jpg

MemPot is a small controller circuit where potentiometer (or any variable resisor) is read and recorded with PIC (16F819) microcontroller. PIC stores a sequence of values from the user turning the knob and plays the same sequence back via serially controlled digital potentiometer (DS1267) chip. The playback speed and recording buffer can be controlled. This is a handy tool for performing gestures with electronic instruments with variable resistors as controllers.

Same circuit can naturally be experimented with other variable resistors or analog sensors as inputs. LDR’s, bend sensors or even accelerometer movements could be recorded and played back similarly. If the resistance changes are not continuous but in steps, the playback resembles simple step sequencer. Follow the various experiments from the oikosulku-blog:

MemPot was developed by me and Dan for our circuit bending activities and to use as a workshop project on analog sound synthesis. We can hopefully include the making of MemPot for our next DRU workshop in July.

MemPot documented here.

#3 Beeps, waves and basslines -workshop materials

20070531 15:17

(DRU July 2007 workshop materials page, participate! and check for updates)

Documents


Specsheets

MemPot

Books:

  • “Handmade Electronic Music : the art of hardware hacking” by Nicolas Collins
  • “Timer, Op Amp, and Optoelectronic Circuits & Projects” by Forrest M. Mims III
  • “Physical Computing” by Dan O’Sullivan & Tom Igoe

Links:

#2 Beeps, waves and basslines -workshop images

20070531 14:51

DSCN4295.JPG
DSCN4300.JPG
DSCN4298.JPG

DSCN4305.JPG

DSCN4308.JPG

DSCN4306.JPG

#1 Beeps, waves and basslines -workshop program

20070531 14:13

(Draft 1, subject to change)

Day 1.

  • introduction to workshop, background
  • creative misuse of cheap logic chips for sound/noise making
  • square wave & modulations from CD4093 NAND gate, schmitt trigger
  • square wave & modulations from 555-timer (aka Atari Punk Console)
  • options for additional modulations, interference and filtering
  • experimenting on breadboard, notes for own instrument

Day 2.

  • planning own instrument based on previous experiments
  • soldering own instrument on stripboard
  • soldering simple amp&speaker unit
  • testing & debugging

Day 3.

  • introduction to MemPot, Potentiometer with memory
  • soldering MemPot PCB kit
  • using MemPot for controlling own instrument
  • the most annoying jamming session ever
  • where next