Welcome to Robot Dialogs. This is a place where I will record my progress, mistakes, errors, failures, lessons learned and hopefully occasional success in my designs and implementations of robots and other technical endeavors. I will try to make it as educational, informative and entertaining as I can...

Sunday, February 13, 2022

Eurorack Level Display

This build was inspired by this post from ElectroDruid, at least in part. I have been getting into sound synthesis over the past year and needed simple module on my Eurorack setup that I can plug anything into and see if it's working (or peaking). There are a few modules out there like what I've made here but I'm doing most of my synth as DIY kits or pure DIY of my own design.

The idea started on the breadboard, and because I had an Arduino Pro Mini in my box of spares that's what I used. 

Here all 16 outer pins of the Pro Mini and two of the inner analog pins are connected to the row of LEDs each of which has a series resistor. for a total of 18 LEDs, which was later reduced to 16. 

There were still two analog pins available (the green and yellow wires) which were used as audio inputs. The other two analog inputs were later used for some timing/debugging. The audio and control signals on Eurorack can swing ±10V which would damage the Arduino if used directly. To solve that I've used almost the same circuit as the ElectroDruid version but with different values which clamps the signal to +5 : -0.5V for the Arduino.

The Pro Mini I had handy was the 8Mhz 3.3V version, but later I switched to a 5V 16Mz version to improve the sample rate.

For  a proof of concept I started with the built in Arduino APIs, which work but are very inefficient. That initial version only managed to sample at ~2kHz. Eventually after switching to the faster Pro Mini and several iteration of optimization the sample rate was improved to ~38kHz; however, two pins are sampled, toggling every other read, so it's about 18kHz per input. That's not as good as the PIC used by ElectroDruid, but it's plenty for my purposes. Here's a pin toggled with every ADC read showing the final sample speed.

Reading a pin toggled during every ADC interrupt.
Prior to getting that kind of performance I set the software aside and designed a set of PCBs. This is the first time I've designed PCBs for manufacture. I've only made them for etching before. I figured this was a fairly straight forward design to get some experience on. After some design time and learning how to use KiCad I managed to get a v1.0 I was happy with and had some samples made by Seeed Fusion PCB service. I also spent some time learning how to use FreeCAD and made a footprint or two for this design. 

While waiting on the boards to arrive I finished improving the software, ordered the components I needed to make several of them and used FreeCAD again to design a front panel. I initially 3D printed the panel to see if the fit was okay and then had a friend with a CNC mill machine some from aluminum for me. In the software, I also added a peak indicator to the code so fast peaks are more visible. The ~38kHz sample rate came at the expense of resolution which was reduced to 8 bits. There is a lookup table in the code based on this table. The look up table is used to map the audio level to the number of lit LEDs where each LED covers a fixed value 0dB down to -30dB.

Once received, the v1 boards worked great. 

After a few of these were built as intended I decided to make some that ignored one of the inputs and connected the two audio jacks as a passive multiple. This seems to be more convenient than plugging two independent sources in. The v1.0 boards have a 5V regulator on them and some configurable solder jumpers for that but I don't think they are needed, since the power consumption is within the limits of the regulator on the Pro Mini.

Power Consumption on v1:
Peaks (All LEDs on) = 85mA on +12V
Idle (LEDs Off) = 26mA @ 12V

So ~60mA/16 LEDs. LEDs pull 3.75mA each (avg)

On one of the boards I used some alternate firmware to implement a tuner. The tuner is pretty basic, measuring time between zero crossings and mapping that period to notes with a look up table. For that, 12 LEDs were used for notes and 4 for showing the deviation (how far out of tune). It's very convenient and intuitive for tuning oscillators.

After some testing and using the v1 boards and a few months using them I did a redesign in KiCad 6 for v2: 
  1.  Used footprints for resistors that are closer to 250mW sizes. There's a lot of wasted space on the board, same for diodes and ferrite bead.
  2.  Use footprints that are correct (wider than v1) for all ceramic caps so they don't have to be bent.
  3.  Avoid resistors for Arduino foot print so they don't run into each other.
  4.  Moved second 20pin header on PCB_B to reduce the depth when plugged in.
  5.  Use small traces for all the led paths, no need to mix and match.
  6.  Add Open Hardware logo.
  7.  Add passive multiple path with solder bridge.
  8. Removed several unneeded capacitors.
  9. Removed the 5V regulator and it's support components.
  10. Changed a bunch of footprints.
  11. Removed power LED.
  12. Removed mounting holes in corners.
I'm waiting for the v2 boards to arrive along with 10 other PCB designs... I went a little ham on the PCB ideas.

Some things I didn't try on v2 that could happen on a v3:
 1. CV input circuit path (could use LEDs to show semitones and octaves)
 2. CV output circuit?

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Thursday, September 13, 2012

A Twitter hack for the Typo...matic

Tonight 9/21 I'll have the Typo...matic online searching for tweets with the following #tags:

There will also be a google hangout where you can watch it type away live!

I spent the evening at CCCKC tinkering with TTYtter and some bash scripting and coreutils that were new to me...
The result is the world's worst implementation of a polling Twitter search that can feed new tweets to any other bash command. I'll be hooking this up to the Typo...matic at the next public event I lug it out to...

I have a chunk of c code that talks to the Typo...matic's Arduino and it takes as arguments the serial port and a file of text to print. So the end result of the script below is a text file of recent tweets matching the #ccckc hash tag.

Feel free to gank this script and do dumb things with it. I'm not proud of it from a technical standpoint but for a hack it'll do.

Saturday, June 30, 2012

The Translator...Mini Sumo Bot

A few months before Maker Faire KC a friend started working on a Mini Sumo Bot and in passing I said I could probably get a bot ready for that...well those months slipped away and two weeks prior to the faire I had no bot (and had been constantly hounded by said friend). So I did a grand total of 30 minutes of research on the internets and ordered some parts (not recommended).

I ordered everything from Canada (Fingertech and Solarbotics) so I had to wait almost another week to get started.

Here's the parts list I ended up with:
The first thing I did was construct the BittyBoty 3-Way Object Sensor which is used to find the other robot. This kit is a nice compact proximity sensor, but it's a bit tough to mount (double sided tape...). Building the kit was a challenge because it's a very small board with several tiny surface mount parts to solder...and I didn't have the right kind of tweezers. After melting one of the indicator LEDs and testing the rest of it I deemed it passable and moved on.
My first attempt at getting everything working consisted of using solid core and wire-wrap wire to do point-to-point connections. That was a mistake.
But it did work! I rigged it up to work with a 9 volt battery and let it tear around my desk for a few days like that.
That video shows it moving slow, detecting lines and it does actually detect and turn towards the can. Also in that video you can see the competition ring we made at CCCKC with the help of Craig (Built-to-Spec) who did the vinyl white ring. 

After a few days fighting that solid core wire jumble I got fed up and designed a single sided PCB that I could etch. Unlike my previous etchings, this time I went shopping for some Hydrochloric Acid and Peroxide. This worked AMAZINGLY well compared to Ferric Chloride. I didn't want a top layer or vias so I intentionally left out some of the complex traces so that I could do them with wire-wrap wire instead. This took some time and patience but worked okay in the end... A hint if you do this, use Eagle to keep track of the wires you patched on to the board by adding traces to a layer. Maybe next year I'll mod it by getting the whole board fabbed. In the end I managed to get the board made and only fried one line sensor on power up...crossed the streams...
This PCB design fits the standoffs on the COBRA chassis perfectly and instead of directly soldering the Arduino and motor drivers to this board I soldered on headers to accept those. I also added breakout connections for the motors, proximity board, line sensors, power, and switch. So essentially everything plugs into this one board. I also broke out the serial lines and 5V/GND connections so that I could easily attach a XBee wireless serial board (very helpful for debugging).

After all the solid core wire was replace with either traces on the helper board or stranded wire (stolen from various old USB cables) this setup was MUCH easier to work with. I went to the local hobby shop (which has no website or I'd link it) and picked up the LiPo battery and charger. The battery fits beneath the helper PCB, keeping the center of gravity low.

The result (after another programming session) was excellent.

At the Faire I ended up taking first place. Woo! Granted there was only one other entrant... Next year bring your bots!
  • Total Estimated Cost: $285.69
    • Chassis: $119
    • Proximity Sensor: $30
    • Motor Driver(s): 2 x $8.95 = $17.90
    • Arduino Pro Mini: $18.95
    • Battery & Connector:  $16.99 + $3.25 = 20.24
    • Shipping: $17.98 + $61.62 = $79.60 (ouch!)
  • Total Estimated Hours: 30
  • Final Weight: ~450 grams (I still have room for better sensors :) )
  • Width: 9.9 cm
  • Length: 9.75 cm
  • Height: 7.3 cm
  • Code is on github
Lessons Learned:
  • Don't use solid core wire in tight spaces...I already knew this, I just wasn't clever enough to chop up some useless USB cables for multi colored stranded wire until the second attempt.
  • Buy some good tweezers and fine solder tips for surface mount.
  • Find better paper for toner transfer. I used plain paper this time, but I need to find something better.
  • Procrastinating and then having to pay for 3 day shipping from Canada really raised the price on this thing. It's quite reasonable if you remove shipping from the final cost...
    • I'll just have to get a lot of use out of this bot to recoup the cost.
  • You could also add in $110 for the battery charger...but I got a really good one so I can use it on more projects in the future. You could also throw in $70 for the Dremel drill press, Dremel bit chuck and Dremel drill bits...but I'll used the crap out of those for boards from now on...
    • I don't recommend the drill bits though...get them online, get several of whatever size you need.
  • Cut down copper-clad PCB board to size before running it through the lamitator for toner transfer. I tried this this time and it worked better than sending the whole board through (less jams).
  • Hydrochloric Acid is better and faster than Ferric Chloride for etching PCBs.
Coming Soon!

Wednesday, June 13, 2012

Typo...matic (Part 3)

My Selectric II project is finally 'done'. Here's a demo video.

Please read the previous posts for more details and try to come visit the KC Maker Faire on June 23/24 if you can.

Edit: Here's a great video explaining the Selectric typerwriter(s) mechanisms:

This was my first attempt at serial via straight C code (gcc) in Linux. Needless to say my code is ugly, full of failed attempts to get POSIX serial communication working and bad coding practices. There's a great guide here by the way... I'll get it cleaned up and added (Arduino and C code) to this post as soon as I can but...

The rest of this week and next week I'll be working on a sumobot for the competition at the faire. I'll post about it too...If you've got a mini sumo bot and you're in the area come and compete (mostly for bragging rights) we don't have enough entries yet!

Friday, May 18, 2012

Typo...matic (Part 2)

I've made quite a bit of progress on the Selectric II project. Since the last post I managed to get a fair amount of the mechanisms necessary to actuate the keys figured out (at least for a first attempt). I made the mechanical additions using a bunch of Erector Set pieces.

For the time being I've used fishing line to tie the Erector Set levers to the solenoids. Initially I had it set up with fishing line going up over a bar above all the key press mechanisms (essentially pulling up on them) but this didn't work and wouldn't have survived the test of time (rubbing against a bar all the time...).

This past week I made my first go at the toner-transfer & ferric chloride etching process to make a Solenoid Driver board. I also did quite a few things in Eagle for the first time. The circuit for the driver board is below, it's a simple power FET (IRL2703) circuit with some blinkin' lights thrown in for good measure. Eagle files below, I used default part libraries and the Sparkfun Eagle Library.

I'm no expert on the toner transfer process, so just Google that if you're interested. I will document the equipment I used (some of which is not the greatest) here in case anyone is looking to buy this stuff for the first time:
  • Laser Printer: Samsung ML-2525W
    • Does an 'okay' job. Toner thickness could be better, and manual paper feed mechanism is wonky. Full sheets of photo paper recommended. 
    • Had a weird issue with linux (had to reboot printer after each print...) that I didn't take time to figure out completely.
  • Laminator: GBC HeatSeal H220 Laminator
    • The RadioShack 0.065 ish boards + 2xPhotopaper stalled a few times in this laminator, but it has a release button (kind of a clutch mechanism) that you can keep pressed down to help big pieces through.
    • Next time I'm just going to get thinner boards from some web store.
  • Ink Jet Glossy Photo Paper: HP 'Everyday' Glossy Photo Paper
    • Not recommended. This doesn't soak up water well and doesn't peel off board easily. But it's Walmart's least expensive option...
    • I also tried plain paper (v0.01 boards were made with plain paper transfer) it does a passable job on big traces.
    • I also tried parchment paper (on it's own too flimsy to make it through printer).
      • I'm going to try this paper again next time, but taped (with something other than scotch tape) to a normal piece of paper. 
  • Copper Clad Board: I used the 4"x6" double-sided sheets you can get at RadioShack because I was in a rush.
  • Ferric Chloride
    • Used the off shelf RadioShack stuff. 
    • It worked 'okay'. I know there are other cheaper chemical options, I might give those a try next.
    • Please look up how to dispose of this stuff (especially after it's infused with copper particles)
      • In a nut shell, take it to a local chemical disposal facility if your in a rush.
      • If you want you can allow copper to settle to a sludge and poor off the reusable ferric chloride.
      • To fully neutralise it you must slowly add Sodium Bicarbonate (Baking Soda) to it until the (obvious bubbly) reaction is stopped.
    • I HIGHLY recommend researching this before attempting.
      • Treat it like a chemistry assignment for school, write down everything ON PAPER that you need to do, from opening the bottle to how you're going to do disposal. That way you don't skip steps or start the process when you don't have everything you need to finish it!
      • Understand the chemistry, maybe not the gory details, but know the chemicals, safety procedures and the gases this stuff puts off when reacting.
  •  Adgitator
    • Not required but proved to be very handy.
    • I MacGyvered together an agitator using Tupperware, CDs, a servo, an Arduino, and Duct Tape...
    • The Arduino commands the servo position with pseudo-random timing.

After etching and soldering on all the components I went to town testing it on the Selectric II. I only attempted to hook it into the seven levers needed for key presses though. I'll post again when it's further along, but I did make a build video:

Solenoid Driver (v0.2) Eagle Files: Solenoid Driver (v0.2).zip
  • This is a board to drive 8 solenoids (at up to 30 V) at a time. It uses:
    •  IRL2703 Power FETs (with 5V compatible gates)
    • [overkill] 6A/1000V fly-back diodes
    • 1kΩ and 10kΩ resistors
    • LEDs 
    • Sparkfun screw terminals (here) 
    • Standard 0.1" spaced headers