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

djsfantasi

Joined Apr 11, 2010
9,163
Just to muddy the situation further, have you considered the Adafruit Trinket? It is a $7 Arduino compatible microprocessor. Add in an USB cable for programming, your code (compatible with C) and you're good to go. It has limited IO, but you only need one pin, maybe a second for controlling the code. The programming IDE is free.

https://www.adafruit.com/products/1501
 

OBW0549

Joined Mar 2, 2015
3,566
So... On the digital front - an area I have never been to - I'm faced with differing technologies (PICs vs. PICAXE vs. BASIC-stamp vs. Arduino vs...). Upon which should I focus my learning curve? Arduino is out, just because of costs for this one project. But in general?
For this project, I like Roderick Young's suggestion of the PICAXE: simple hardware (it's just a PIC chip pre-programmed with a bootloader and a BASIC interpreter), very inexpensive, and a relatively painless learning curve to come up to speed with the programming.

You can get a good introduction to the PICAXE from these articles:

http://www.allaboutcircuits.com/technical-articles/intro-to-picaxe/
http://www.allaboutcircuits.com/technical-articles/picaxe-to-pc-connections/
http://www.allaboutcircuits.com/technical-articles/picaxe-programming-basics-part-1/
http://www.allaboutcircuits.com/technical-articles/picaxe-programming-basics-part-2/
http://www.allaboutcircuits.com/technical-articles/writing-picaxe-basic-code-part-1/
http://www.allaboutcircuits.com/projects/picaxe-micro-controller-read-and-display-temperature/

Working with a bare PIC chip would be even cheaper, but you'd have a major amount of work learning to program it, whether in C or in assembly language. But in the long term, I think the effort it takes to become proficient at using PICs is well worth it because of their simplicity and flexibility, and because you can do so many things with them.

My least-favorite approach would be building something out of discrete CMOS digital logic chips, because of the difficulty of making modifications. I only use CD4xxx-series stuff (or 74HCxxx) anymore if I need to implement a very high-speed logic function, and for the stuff I do that's not very often.
 
Last edited:

atferrari

Joined Jan 6, 2004
4,771
Working with a bare PIC chip would be even cheaper, but you'd have a major amount of work learning to program it, whether in C or in assembly language. But in the long term, I think the effort it takes to become proficient at using PICs is well worth it because of their simplicity and flexibility, and because you can do so many things with them.
Certainly biased because my long time using them, I tend to agree. Maybe learning the simplest PIC could not take much and would be the start to climb the never ending ladder.

Using internal clock, if you manage to initialize it properly, with most (if not all peripherics disabled - which is, by the way, their natural (reset) condition, off you go.
 

Bernard

Joined Aug 7, 2008
5,784
I watched the meter dance but there is still glitch in the filter. Now using 4022, 4066, & 555, not to forget the 24 diodes.
 

Bernard

Joined Aug 7, 2008
5,784
Dancing Meter #, Fig A, bottom, fixed time & no filter, to show what different preprogrammed levels might look like with 8 periods available from 4022, 4017 would have 10. Not shown is a second 555 with a period longer than U2's 8th count that could reset U2 to give a semblance of randomness. Fig B adds 3 step variable timing & filtering. Large meter swings allow more time & longer filter setting. Or as at step 4, a shorter filter allows meter to rise to set point & remain there for remainder of period.
U5, 4066, is a digital or analog switch which will pass a signal of either polarity when a control V is applied to pins 6, 5, 13, or 12. If control pins are left floating , the switch may assume any state hence the pull down Rs , R18,19 & 20.
Contact resistance is in 200 ohm range.
R10, 39k, selected to pre bias U3 & U4 so meter rests at 0 with no signal, otherwise signal must rise 1.6V before meter starts to move.
The diodes preform as OR gates, top D's control meter levels, center control timing, & bottom control 4066 control inputs.
Parts of ckt. were breadboarded & worked but there are still some self induced wiring errors along with some mismarked diodes
But it something to get ideas from, hopefully.DANCING METER #3 00000.jpg DANCING METER #4 00000.jpg
 

Thread Starter

Dibubba

Joined May 15, 2015
16
All, this is some REALLY cool stuff, and thanks to each of you for chiming in. :)

Now, I'm awash with options... and believe me, I'm reading and investigating them all!
 

#12

Joined Nov 30, 2010
18,224
I think Bernard has a good one. I was thinking of attaching some feedback to pin 5 of the timer to change the clock frequency (dwell time).
 

Bernard

Joined Aug 7, 2008
5,784
I may go back to Dancing Meter #3 & change levels & times to more closely match your thoughts. from post #8, 3 V levels,2 filters, & 4 time steps. It just seemed like a lot of stuff, but still only 3 ICs, 2 transistors, & small parts. Not so bad if stuffing a PC board, & around US $ 10. inc. board, pure guess.
 

Bernard

Joined Aug 7, 2008
5,784
I think for analog, I like this 555 ring counter even better. Only 2 stages shown but can be expanded to any desired length by adding a 555, 2 caps & 4 resistors for each additional stage. Every 4 stages needs a 4066 switch IC. In example, on power-up, U 1 is triggered by C 2 holding pin 2 low, all other 555s have pin 4 held low by C 6 ( may need larger C or a transistor to hold pin 4 below .7 V for a fraction of a second. ). Each stage controls M level & filter TC. On BB, breadboard R 7 tap is full up ( R 7 removed ) & R 11, 5 k pot adjusted for M full scale.
U 1, R10 pot adjusted for near 0 on M & replaced with 9.1 K & 2.2k V divider. On power-up, U 1 went high, M to 1 for 15 sec. U2 triggered. M started climbing, reaching 7 on M in 7 sec. full scale in 14 sec, then coasted for 8 sec. U 1 then triggers, M fall rapidly to 1 & holds for 15 sec. then repeats the cycle.
My cost for 555s about US $ .39. With 6 stages averaging 15 sec. = 90 sec, 2 cycles =Dancing Meter # 4r 00000.jpg our magic 3 min.
 

dannyf

Joined Sep 13, 2015
2,197
I would start with a micro, like those 8pin dip types (12F675 or Attiny25). Generating a random number and based on that drive the movement through a resistor is a piece of cake. All for $2/unit tops.
 

blocco a spirale

Joined Jun 18, 2008
1,546
I would start with a micro, like those 8pin dip types (12F675 or Attiny25). Generating a random number and based on that drive the movement through a resistor is a piece of cake. All for $2/unit tops.
We've already been there on several occasions; and during the time this thread has been running the TS could have learned to program a PIC and implemented such a solution:rolleyes:
 

dannyf

Joined Sep 13, 2015
2,197
would like to see one actually doing something that looks like "analog"
The mcu doesn't need to generate an analog signal (to drive the movement) for it to appear "analog": you can simply turn a pin on or off, and connect the movement to that pin. The duration by which the pin stays on or off can be random.

That generates random movements of the needle.
 
Top