Random or Pseudorandom Analog Meter Movement Project – I’m Stumped!

Discussion in 'The Projects Forum' started by Dibubba, Aug 20, 2015.

  1. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    I will TRY to provide enough info here for somebody to maybe be able to help me! :)

    Posit: I have some cool retro analog meters, of various movement types. I want to mount them individually into old refinished wooden radio cabinets, along with some retro rotary switches and Bakelite knobs and jewel lamps... such that the finished unit is looks like some retro-tech device of uncertain origin and purpose. Ergo: “Steampunk”. I have a LOT of these meters, and boxes, and a proximate number of old wall warts, whose outputs range from 6 to 12 VDC, generally 200 – 500mA.

    I want to assemble and sell these units at something-approaching a profit. Based on what I'm projecting, my electronic component costs (not including the meters and boxes, time, or labor) need to be on the order of $20 or so.

    My dilemma is this: within the above constraints, I want the meter to move. Sure, I could wire a pot and shunt, or I could wire a rotary with differing resistors so the meter reading would change when a control is moved… but I want the meter to appear to move ON ITS OWN volition, as if it were tracking “something”. And I’d like that movement to be either random, or pseudorandom, swinging the meter needle gently to different values, with a period of something upwards of 3 minutes or so.

    Assume that a variance of 0 – 3VDC (and probably a lot less!) would do the trick to swing the meters. I’d buffer each meter according to its specific movement.

    So. I can do this with Arduino, but the sum per-unit cost of the components exceeds what I can afford, if I hope to break-even, margin-wise. I can do it with combinations of 555’s, etc, but the results are just too rapid and too predictable, and don’t vary. It looks like a saw wave. I can use a standard VU meter breakout board, but again, it’s too pricey, and an onboard mic isn’t sensitive enough, and the end result isn’t the smooth meter swing I’m after.

    I have pored over every circuit handbook I could find for the past 6 months, new and ancient, but I cannot find anything that will help me achieve this (admittedly goofy and non-scientific) end, with the minimum possible “currently available” (Jameco et. al.) discrete analog or IC components, in such a way that I can easily build a lot of them.

    So… I need IDEAS, and/or a firm kick in the rump, to either get me in the right direction, or to shock me into the reality that “it ain’t possible, bro!”. :D
     
  2. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    You could use one of the 8-pin 12Fxxx Microchip PICs; Very inexpensive, no PCB/stripboard and very few (if any) external components required for this application. I can't think of a cheaper solution, you could even control the lamp with the same device.

    Write a bit of code to provide a PWM output, generate a pseudo-random number, and slowly ramp the output up or down until it reaches that value, wait and repeat the process.

    http://uk.farnell.com/microchip/pic12f675-i-p/mcu-8bit-pic12-20mhz-dip-8/dp/9759018
     
    Last edited: Aug 20, 2015
    Roderick Young and OBW0549 like this.
  3. paulktreg

    Distinguished Member

    Jun 2, 2008
    611
    120
    Use the outputs of a (or several) slow clocked 4017 to provide a different sequence of current outputs?
     
  4. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    Thanks, Blocco! That is an interesting little chip with a lot jammed into t. I'm still digesting the spec sheet.

    Completely new horizon for me. Since you seem familiar with the chipset... Do you know if there is a developer kit for it?

    I prefer snorting solder fumes to writing code... but if writing code is what I gotta do, well, I'll just have to Better Myself! :)
     
  5. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    Paulktreg - again, 4017's are outside my pure-analog experience. But - looking at the spec sheet, Great Idea!! I assume that would be pin 12. Is that correct?

    And if so- does anyone know what happens if you combine multiple pin-12's from multiple 4017's? Do you need to capacitively-decouple them from each other?

    I'm not so cheap as to mind frying a chip or two in the learning process, but would like some idea of what to expect, so I know how many to order at first!

    Thanks, guys, for the feedback!!
     
  6. blocco a spirale

    AAC Fanatic!

    Jun 18, 2008
    1,438
    368
    All the software you need (the MPLAB IDE) can be downloaded free from Microchip's website and inexpensive PIC programmers can be found on ebay.

    There's a very good 'getting started' tutorial here:

    http://www.markhennessy.co.uk/pic/
     
    Roderick Young likes this.
  7. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,532
    1,249
    Moving through a multi-minute pattern is all about resolution. How smoothly do you want the needle to move? A purely analog white noise generator with a sub-1 Hz bandwidth is tough. Enter the Linear Feedback Shirt Register (LFSR):

    https://en.wikipedia.org/wiki/Linear_feedback_shift_register

    Snort this: 2 or 3 or 4 8-bit shift registers plus one quad X-OR gets you a very long pattern that you can clock as slowly as you want. For an output, you can take the last bit through a single R-C lowpass, but you'll get a more random-looking waveform if you pick off a few bits into an R-2R D/A. A possible problem with this approach is that the register might start up with all zeros, and the output won't change for a bit. OK, for a few hours. But if you change the registers to a loadable kind, you can force a random-looking bit pattern into the string at power-up.

    Of course, all of this can be done inside an 8-pin PIC, but where's the fun in that? Paraphrasing Frank Burns: I love programming, except for all of the typing.

    ak
     
  8. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    [QUOTE="AnalogKid, post: 893352, member: 213444]How smoothly do you want the needle to move? A purely analog white noise generator with a sub-1 Hz bandwidth is tough. [/QUOTE]

    AK, You summed up the problem very elegantly, here. (And BTW, your moniker says it all. There us something about discrete analog design that just appeals to me.)

    I'll look into this. The downside is, now you've got me chasing rainbows! :) In a "perfect completed design" world, I'd like (for example) the needle to rest at "8" for 20 seconds, then swing to "30" over a period of 7 seconds, stay there for 15 seconds, drop to "17" over a period of 3 seconds...

    With Peer Review comes Amplified Ambition, dammit! :)
     
  9. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,026
    3,789
    Frank Burns eats worms.
     
    #12 likes this.
  10. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,026
    3,789
    Have you thought of making it interactive? Hide an IR LED Emitter pulsed at 38kHz behind a pin hole in your device and a 38k IR receiver behind another pinhole. Causes one needle to flip as someone approaches or moves. Add a high gain amplifier circuit to make a capacitive sensing or a Theramin-like proximity sensor as some one moves around it. You could add a high pitch tone generator in the box that fluctuates with one or more needles. A ring modulator would make really interesting sounds. I would think a price of 30-40 would be more appropriate.
     
  11. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    Thanks, GopherT. Yep, I played with that (proximity-sensing via optical - photoresistors and diodes), which was what led me to want an independent, non-user-influenced response. Peoples' natural curiosity led them to quickly determine cause and effect, and thus limited what I could label the meter.

    Oh, by the way - that's also what is driving me toward the 3+ minute cycle. I found that nobody stared at the meter longer than a maximum of 3:14... Coincidentally, the length of an average AOR pop song!
     
    Last edited: Aug 22, 2015
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,532
    1,249
    I've been thinking about this. While nothing will give you the guaranteed performance of a digital pattern generator followed by an analog shaper, there is another way. I've never messed with a very low frequency white or pink noise generator based on a junction noise source, but it could work. A noisy transistor junction followed by a CMOS opamp with a very large R and C followed by a pink shaper would get you true sinusoidal transitions among the peaks and valleys and eliminate all amplitude and temporal quantizing, IF they behave at .001 Hz the way they behave at 1000 Hz. Hmmm......

    ak
     
  13. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    I started the beginnings of a ckt., 2-4022 or 4017's & 2- 555's or a 556, some 20 R's & diodes, & a few caps. Meter moves from one random setting ( 8 to10 steps ) over a period of 3 sec. Length of time at new setting randomly selected from maybe 2 sec. to 20 sec., a 10:1 range. What I missed reading was linear move from one step to another. Maybe adding a 4066 & we can have that also for some of the timed steps.
    The more steps, the more parts; can we do with fewer- say 5 or 6?
    Should I continue?
     
  14. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    I hadn't ruled that out, AK. I'll try to think that though. Similar, in a way, to another idea I had last night, which suggested I'm working the wrong-end of the problem, and should start with the meters, working backward.

    Maybe I should not worry about the slew rate of the voltages coming from the generator circuit, and focus on just the periodicity there... Damping the meters another way. So the 'generator" becomes a simple "timer".

    Capacitors the size of oil drums! or smaller caps in parallel, lined up like rows of little soldiers on parade.

    So, assuming that, and assuming a simple multi-tap voltage divider...put a super-cap on the bottom so the meter never drops to zero when switched-on. Additional Authenticity. And use pots to set the divider points. Given that - how could a gent devise a circuit to slowly and randomly switch the tap points to pass the "real" voltage (versus the Vcc of the timer chip) on to the damping bank?

    Or am I back where I started?
     
  15. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    I think trying to do this in analog (or with a board full of small-scale digital CMOS chips) would be a great way to drive yourself insane. I'll second blocco a spirale's advice about using a PIC: you can program a LOT of intriguing, mystifying, baffling behavior into your device with one of these things.

    With a PIC you can easily delay your device's response to the the photoresistor, or to the rotary switch; put a 20-30 second time lag in there, and the user will be left scratching his/her head wondering what the heck the gadget is doing.

    With a PIC you can have as long a sequence as you want, and it can be driven by a pseudo-random number generator (a 16-bit, 4-tap linear feedback shift register takes only about a dozen CPU instructions) whose output selects one out of a number of meter/lamp "routines." These can be as elaborate as you want, and if the LFSR picks a new routine every few seconds or so it'll be days before the pattern repeats.

    Cost and complexity are minimal. A PIC12F1572 (http://www.microchip.com/wwwproducts/Devices.aspx?product=PIC12F1572) in 8-pin DIP, a photoresistor, and a handful of resistors and caps will probably total up to no more than $2.00.

    The PIC12F1572 has several 16-bit PWM outputs. You could use one of them to drive your analog meter (through a resistor to set the full-scale current), and another one to drive your jeweled panel lamp.

    It also has a 10-bit A-to-D converter. You could use one A/D channel to read the output voltage of a voltage divider made up of a photoresistor and a fixed resistor, and the other channel to read the voltage picked off by the rotary switch from a multi-tap voltage divider made up of a string of resistors.

    Between the LFSR pseudo-random generator, the rotary switch, and the photo sensor, there's no end to the interesting patterns you could generate.

    Of course, there's the small matter of programming... :cool:
     
  16. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    Yeah, man! I completely agree, OBWO549, and with Blocco too. That PIC is cute. But the "programming" part remains the elephant in the room.

    A winter project, at best, if I go that route.
     
  17. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    True; and the learning curve can be significant, especially if you work in assembly language. But once learned, and with a bit of experience, PICs can be a darned handy thing to have in your "bag of tricks."
    The ones I've found most useful for my hobby stuff are the PIC10F322, the PIC16F1847, the dsPIC30F3012/3013, and the dsPIC33EP256GP502.
     
  18. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    Bernard - thanks a million... And please DO continue. Can show share (schemie-wise) what you did?
     
  19. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    Pulled ckt. out of file & breadboarded 1 mA meter back thru switchable time delays & first MPSA14, next comes 5 steps from 4017.
    Will finish on Monday.
     
  20. Dibubba

    Thread Starter New Member

    May 15, 2015
    16
    2
    OBW0549 and Blocco:

    All day long, when not actively-engaged with the Honeydew Subroutine, I've had my head stuffed into the iPad, reading-up on the links you sent. Lots to Learn.

    So neither of you have a link that shows a PIC IN A CIRCUIT, and text that treats the programming and shows the IO of the chip in context? I am getting CLSE to the most rudimentary grasp of these, but would like to see one actually doing something that looks like "analog". Just the way my brain learns.

    I'll keep reading in the meantime... But thanks to you (and all others here!) for your support!! :)
     
Loading...