Live data from Hacker News

A nicer voltmeter clock

lcamtuf.substack.com

41–50 of 53 posts

Re: A nicer voltmeter clock

#41
post #30

Earlier quoted context omitted.

If you have a feedback loop I'm sure you can still do it with an either implicitly or explicitly filtered PWM. Remember we're talking averages not instantaneous, so the average current through the bulb should be proportional to the average voltage across it, though the resistance will change as the bulb heats hence the feedback. You could also do this with a buck/boost regulator and current sense resistor plus op amp…

"average current through the bulb should be proportional to the average voltage across it" That is exactly correct, the reason they were seeking clarification, and the core of suggested solution. V=I*R If V = Hours and I = Minutes, then by necessity R=Hours/Minutes. Typically a light bulb has mostly fixed resistance (R). Adding a potentiometer to the circuit allows you control the value of R.

Oh maybe I misunderstood. I thought they meant separate meters, so I didn't understand what was hard about that

Re: A nicer voltmeter clock

#43
post #2

Nice! Needs just a tweak to prevent the overshoot and bounce when going from high to low.

For that, you just need to not make the transition from 100% duty cycle to 0% duty cycle instantaneous, but to ramp down linearly the duty cycle over a large fraction of a second or even an entire second. As another poster said, the overshoot may look cool, but I would be worried that a cheap panel voltmeter would not survive a very large number of such shocks.

You can do better: cut to 0%, let the needle fall, go back to 100% for a moment to catch the needle as it approaches the bottom of the scale. If you want to be fancy, add some quick sinusoidal ramps to smooth out the derivative.

Re: A nicer voltmeter clock

#44
post #41

Earlier quoted context omitted.

"average current through the bulb should be proportional to the average voltage across it" That is exactly correct, the reason they were seeking clarification, and the core of suggested solution. V=I*R If V = Hours and I = Minutes, then by necessity R=Hours/Minutes. Typically a light bulb has mostly fixed resistance (R). Adding a potentiometer to the circuit allows you control the value of R.

Oh maybe I misunderstood. I thought they meant separate meters, so I didn't understand what was hard about that

Oh - it didn't occur to me that the original poster might have thought about three different circuits - one with a voltmeter, one with an amperemeter, and one driving the light bulb. Maybe that was their intention.

I originally assumed that the bulb would be somehow connected to voltmeter and amperemeter.

Re: A nicer voltmeter clock

#46
post #20

Earlier quoted context omitted.

Transistors are much more efficient full on or full off. So for the most part for transistor based voltage control they pulse the transistors with a duty cycle equivalent to the voltage needed and integrate it with capacitors, keep the pulse on 25% of the time you have 25% of the voltage sort of thing. Thus the acronym PWM (Pulse Width Modulation) Note that transistors can be controlled to directly regulate the volta…

Essentially how a Class D amplifier[1] works, and part of the reason you can get so much sound out of tiny portable speakers for so long. [1]: https://en.wikipedia.org/wiki/Class-D_amplifier

PWM is used in pretty much everything.

Any power supply, any voltage regulation (A cpu has multiple voltages, e.g. core, SoC, cache,), most LED brightness control, lots of motor speed controls and so on.

Like mentioned transistor (esp FETs) like to be fully open or fully closed. Class-D amplifier requires to convert the naturally analog signal, unlike say a power supply that has a voltage ref. on/off, with sampling 1st. It makes it for a relatively poor example of PWM use.

Re: A nicer voltmeter clock

#47
post #2

Nice! Needs just a tweak to prevent the overshoot and bounce when going from high to low.

For that, you just need to not make the transition from 100% duty cycle to 0% duty cycle instantaneous, but to ramp down linearly the duty cycle over a large fraction of a second or even an entire second. As another poster said, the overshoot may look cool, but I would be worried that a cheap panel voltmeter would not survive a very large number of such shocks.

A linear ramp would work, but you can probably get to the end-point quicker if you're not going linearly. Something like

needle_position = needle_position * 0.9 + desired_needle_position * 0.1

is very easy to implement, easier than linear if you ask me, and should give it a nice damped movement. The constants can be tuned to go as quick or as slow as you like of course.

Re: A nicer voltmeter clock

#48
post #32

I saw somebody's arduino based voltmeter clock way back around 2014, I think here: https://maniacallabs.com/2014/07/08/meter-clock-pt1/ I thought it was pretty cool, but a bit expensive for what it was. So I made my own with a PIC chip: https://www.n1kdo.com/meter-clock/index.html Mine is more of a novelty than a accurate clock. It is a interesting desktop geegaw to invite discussion.

> https://www.n1kdo.com/meter-clock/index.html Can't access it. Connection attempts time out.

https://web.archive.org/web/20250410222119/https://www.n1kdo...

Your AS might be blocked by firewall rules. The Wayback Machine can show you the page.

Re: A nicer voltmeter clock

#50
post #48

Earlier quoted context omitted.

> https://www.n1kdo.com/meter-clock/index.html Can't access it. Connection attempts time out.

https://web.archive.org/web/20250410222119/https://www.n1kdo... Your AS might be blocked by firewall rules. The Wayback Machine can show you the page.

Good luck with random AS blocks. Sounds thoughtful.
Post reply on HN