Possibly, but you take what you have at hand, and I had a bunch of zener diodes. In all honesty, the likelihood that this would generate anything appreciable which would be even remotely close to damaging an Arduino, even if you run it straight into the atmega328 chip without the built in protection, is pretty slim. Still, it's good practice to have a diode there.
yes, I just comment as people will more commonly have something like 1N4148 at hand so don't need to go out and buy a zener which they're less likely to have.
Read up on the PWM function provided on the Arduino. It already provides the variable "duty cycle" (on-time/off-time) output which is what you're doing in code.
That's exactly what the code does. It takes the potentiometer value (0-1023), maps it to a format (0-255) which is used for PWM duty cycle, and outputs it through analogWrite() which is quite literally how you alter the duty cycle of the PWM on the Arduino. 0 being 0 duty cycle, 128 being half duty cycle, 255 being full, and so forth.
A VU meter is used to monitor audio levels, this tutorial doesn't even touch the issue - this is like a tutorial for cooking an apple pie that just shows you what an oven looks like.
I guess you missed the point of the video then. It’s not about driving a VU meter to monitor audio levels, it’s to drive it with an Arduino do measure whatever you want with it. I have a video where I measure TH-cam subscriber count with an old oil cistern gauge as well, I guess you would have a similar problem with that 😂
@@SwitchAndLever _"I guess you missed the point of the video then"_ Basically, yes I did, I read the title expecting it be a tutorial on how to set up a VU with Arduino for it's standard/expected use . . . but I don't think that's an unreasonable assumption . . . to me 'using a VU meter' means getting it to respond to audio, of course you can use it as a doorstop or to measure temperature, but I think most people would think this was a tutorial about using it to track audio levels . . . anyhow, thanks for the tutorial nonetheless, there is some useful info in there regardless.
Dave Lordy If you want to use the VU meter to react appropriately to sound using an Arduino would be entirely superfluous, it’s just adding a layer of obfuscation you don’t need in the circuit, not to mention as you have to do a analog to digital conversion on a reasonably slow IC to then actuate the small motor in the meter will both reduce fidelity and introduce lag. Hope that answers your question why this is not the tutorial you thought it was 🙂
@@Twhite97 _"Your mistake is assuming a VU meter can only be used to measure audio amplitude levels._ Nope, didn't assume that. _"Your third mistake is bashing Switch & Lever for not following YOUR assumption. In the end, he delivered exactly what was promised and did so it a clear, concise manner."_ Are you wearing a feddora ?
Use what you have, I had a bunch of zeners. I’d rather use what gets the project done rather than waiting for parts, which has no real functional difference for the end result 🤷♂️
@@SwitchAndLever I fully agree with that sentiment and often do the same. It's just that a standard or shottky diode is often more plentiful than zeners (especially at a specific breakdown voltage), so someone less experienced watching may erroneously think they need to purchase a zener to make the circuit work properly, when in fact they don't, and that was the point of my original comment. Thank you for your reply. (BTW subscribed)
THANK YOU! I love the explanation, which really helps make some connections in my brain. It's nice knowing WHY to put a resistor or a diode, not just that you should. Do a million more videos exactly like this. :)
Outstanding job! Folks with no electronics background may want to look up info elsewhere on why there's a reverse current when the meter is returning to the home position, or how a resistor limits current, or how the C code does what it does, but such sources are all available on the web with a quick search. Those with at least basic Ohm's Law, physics of conductors, and Arduino programming understanding should have little trouble following this very professionally done video. When will you be doing the video on making a knife with an Arduino-powered birdhouse in the grip? :-) -- Mike
Oh, you mean the Birdhouse Kill-o-Matic 2000? Yeah, I had to scrap those plans after a couple of guys in black suits and Ray-Bans from PETA showed up, they mumbled about cruelty to animals or somesuch before flapping their arms and flying away.
I leave the diode and use two resistors a 1K ohm .trim pot. over meters and another on 20K ohms in series with meters maybe a small cap over meters. when the digital output becomes high it takes some time to charge the capacitor(voltage), and if longer the digital output is high the higher the voltage over the meter.
Wouldn't that result in the meter being less sensitive though, with more sluggish movements as the cap takes time to charge and discharge? Or are you talking small cap as in pF rather than uF?
Switch & Lever : yes you are right, but with a small capacitor, mabe nf/pf, but in pwm to analog you have to use a capacitor to store , let say 3,7 volt, and the use of a resistor 10k , it take a little time to rise the volt on the capacitor, i think it will work just fine.
Your zener will never approach its knee or foldover value just use a small signal diode! You could have said "you need a signal diode, but a zener will work if that's all you have."
Thank you for the video. I apologise for the naive question, but will I need two Arduino Unos to work a pair of VU meters for a Stereo and how would it be connected from the stereo amp to the Arduinos? Thanks again for the video.
I don’t think feeding an amplified signal directly into the Arduino is a terribly good idea. If you’re going to be driving them from an amp why even use Arduino? You could just use the meters directly, that’s what they are designed for.
@@SwitchAndLever Excuse me, but your answer is misleading, if somebody connect meters directly to output of an amp, VU meters will show exactly 0, because audio signal is alternating voltage. There is a lot of various circuits on the web how to hook up a VU meters to amps, lot cheaper then with Arduino.
You need to treat it like a tool in your toolbox. You don't learn a tool just to learn a tool, you learn a tool to do something with it. It's by far easier to learn to code if you have a goal, a project to work on. In that sense it becomes just like any tool. If you have the patience to work on anything for a long time you can have the patience to code.
@@SwitchAndLever that's honestly a great point. I always had a hard time with math until physics gave uses that I could wrap my head around. I always treated it like boiled broccoli or something. Like, "this will be good for me someday." 😁 I guess I should find a problem to solve instead of making it 1/3 of the way through another "C++ in 30 days!" book. Thanks for the video, btw
+Switch & Lever It actually is. It takes a very tiny amount of power to move the needle. Just hook it up to an audio output of a MP3 player or media player of choice, and it will run fine.
+Chicken Curry this one didn't at least. I tried hooking it up to the output of my laptop and the needle barely twitched even on full volume. Maybe there are VU meters that do what you describe, but this one ain't it.
Gosh darnit, you are correct! I soldered it in correct (off camera) but I guess I made a booboo drawing up the schematic. Will make a small annotation to the video about that, thank you!
you don't need a zener diode. a reverse biased signal diode such as 1N4148 should work fine for clamping the mechanism's back EMF.
Possibly, but you take what you have at hand, and I had a bunch of zener diodes.
In all honesty, the likelihood that this would generate anything appreciable which would be even remotely close to damaging an Arduino, even if you run it straight into the atmega328 chip without the built in protection, is pretty slim. Still, it's good practice to have a diode there.
yes, I just comment as people will more commonly have something like 1N4148 at hand so don't need to go out and buy a zener which they're less likely to have.
hi send ur number
You just need a silicone diode
Read up on the PWM function provided on the Arduino. It already provides the variable "duty cycle" (on-time/off-time) output which is what you're doing in code.
That's exactly what the code does. It takes the potentiometer value (0-1023), maps it to a format (0-255) which is used for PWM duty cycle, and outputs it through analogWrite() which is quite literally how you alter the duty cycle of the PWM on the Arduino. 0 being 0 duty cycle, 128 being half duty cycle, 255 being full, and so forth.
@@SwitchAndLever Sorry - I should have paid closer attention! ;)
A VU meter is used to monitor audio levels, this tutorial doesn't even touch the issue - this is like a tutorial for cooking an apple pie that just shows you what an oven looks like.
I guess you missed the point of the video then. It’s not about driving a VU meter to monitor audio levels, it’s to drive it with an Arduino do measure whatever you want with it. I have a video where I measure TH-cam subscriber count with an old oil cistern gauge as well, I guess you would have a similar problem with that 😂
@@SwitchAndLever _"I guess you missed the point of the video then"_
Basically, yes I did, I read the title expecting it be a tutorial on how to set up a VU with Arduino for it's standard/expected use . . . but I don't think that's an unreasonable assumption . . . to me 'using a VU meter' means getting it to respond to audio, of course you can use it as a doorstop or to measure temperature, but I think most people would think this was a tutorial about using it to track audio levels . . . anyhow, thanks for the tutorial nonetheless, there is some useful info in there regardless.
Dave Lordy If you want to use the VU meter to react appropriately to sound using an Arduino would be entirely superfluous, it’s just adding a layer of obfuscation you don’t need in the circuit, not to mention as you have to do a analog to digital conversion on a reasonably slow IC to then actuate the small motor in the meter will both reduce fidelity and introduce lag. Hope that answers your question why this is not the tutorial you thought it was 🙂
@@Twhite97 _"Your mistake is assuming a VU meter can only be used to measure audio amplitude levels._
Nope, didn't assume that.
_"Your third mistake is bashing Switch & Lever for not following YOUR assumption. In the end, he delivered exactly what was promised and did so it a clear, concise manner."_
Are you wearing a feddora ?
I think a standard diode should work as a flywheel diode just as would be done for any inductive load such as a motor or coil. No need to use a zener.
Use what you have, I had a bunch of zeners. I’d rather use what gets the project done rather than waiting for parts, which has no real functional difference for the end result 🤷♂️
@@SwitchAndLever I fully agree with that sentiment and often do the same. It's just that a standard or shottky diode is often more plentiful than zeners (especially at a specific breakdown voltage), so someone less experienced watching may erroneously think they need to purchase a zener to make the circuit work properly, when in fact they don't, and that was the point of my original comment. Thank you for your reply. (BTW subscribed)
THANK YOU! I love the explanation, which really helps make some connections in my brain. It's nice knowing WHY to put a resistor or a diode, not just that you should. Do a million more videos exactly like this. :)
The intro got a hearty laugh from me!
Looked like a waste of a decent old mechanical switch keyboard though.
Outstanding job! Folks with no electronics background may want to look up info elsewhere on why there's a reverse current when the meter is returning to the home position, or how a resistor limits current, or how the C code does what it does, but such sources are all available on the web with a quick search. Those with at least basic Ohm's Law, physics of conductors, and Arduino programming understanding should have little trouble following this very professionally done video.
When will you be doing the video on making a knife with an Arduino-powered birdhouse in the grip? :-)
-- Mike
Oh, you mean the Birdhouse Kill-o-Matic 2000? Yeah, I had to scrap those plans after a couple of guys in black suits and Ray-Bans from PETA showed up, they mumbled about cruelty to animals or somesuch before flapping their arms and flying away.
I leave the diode and use two resistors a 1K ohm .trim pot. over meters and another on 20K ohms in series with meters maybe a small cap over meters. when the digital output becomes high it takes some time to charge the capacitor(voltage), and if longer the digital output is high the higher the voltage over the meter.
Wouldn't that result in the meter being less sensitive though, with more sluggish movements as the cap takes time to charge and discharge? Or are you talking small cap as in pF rather than uF?
Switch & Lever : yes you are right, but with a small capacitor, mabe nf/pf, but in pwm to analog you have to use a capacitor to store , let say 3,7 volt, and the use of a resistor 10k , it take a little time to rise the volt on the capacitor, i think it will work just fine.
How do you do the drawing of the connections on the Arduino? Do you use Fritzing?
this scheme is used to control the cla2a plugin ?
how accurate is this meter compared to an actual VU found on older analog equipment
Any ideas on how can i use this for audio?? I want to make an actual vu meter
may sound silly but were are the audio inputs plz?
Your zener will never approach its knee or foldover value just use a small signal diode! You could have said "you need a signal diode, but a zener will work if that's all you have."
Why? Then I'd never get nitpickers like you commenting!
This video is not for using VU meter for its intended purpose - monitoring music. This is rather an experiment.
Yes? You summed up the video. Good on ya, I guess?
Thank you for the video. I apologise for the naive question, but will I need two Arduino Unos to work a pair of VU meters for a Stereo and how would it be connected from the stereo amp to the Arduinos? Thanks again for the video.
I don’t think feeding an amplified signal directly into the Arduino is a terribly good idea. If you’re going to be driving them from an amp why even use Arduino? You could just use the meters directly, that’s what they are designed for.
@@SwitchAndLever Excuse me, but your answer is misleading, if somebody connect meters directly to output of an amp, VU meters will show exactly 0, because audio signal is alternating voltage. There is a lot of various circuits on the web how to hook up a VU meters to amps, lot cheaper then with Arduino.
does this VU meter work with music?
Nice. But i just dont get why u use a zener diode. Would not a normal diode do the same job?
Yep, but you gotta use what you have available, and that's what I had available.
Ah, ok. But a Zener can work as normal diode too. As far as i learned ;-) But hey, as long its working... who cares ;-)
Awesome! 👍 I wish I had the patience/desire to do even minimal coding. I've been trying to for YEARS but I just can't force myself to GAF😄
You need to treat it like a tool in your toolbox. You don't learn a tool just to learn a tool, you learn a tool to do something with it. It's by far easier to learn to code if you have a goal, a project to work on. In that sense it becomes just like any tool. If you have the patience to work on anything for a long time you can have the patience to code.
@@SwitchAndLever that's honestly a great point. I always had a hard time with math until physics gave uses that I could wrap my head around. I always treated it like boiled broccoli or something. Like, "this will be good for me someday." 😁 I guess I should find a problem to solve instead of making it 1/3 of the way through another "C++ in 30 days!" book. Thanks for the video, btw
@@els1f yeah, I can't learn like that either, I have to put it into practice.
Just for the intro I couldn't help but sub ;)
same here...
can you just put a VU meter parallel to the output of an MP3 player without additional circuitry?
I'm afraid not, the audio signal is simply not enough to move the needle of the meter.
Thanks!
+Switch & Lever It actually is. It takes a very tiny amount of power to move the needle. Just hook it up to an audio output of a MP3 player or media player of choice, and it will run fine.
+Chicken Curry this one didn't at least. I tried hooking it up to the output of my laptop and the needle barely twitched even on full volume. Maybe there are VU meters that do what you describe, but this one ain't it.
It did come out of a higher-end unit that probably has a fine tuned drive for these guys, makes sense.
Smashing that silicone graphics keyboard hurts me
I don't get it, but I love it.
Nice Post
i want to monitor music with my meter .
You should have put a warning before smashing the keyboard. I'm scarred for life.
Didn't you see on the screen - it said: "Press ANY Key to Continue..."
You turned the diode the wrong way.
Gosh darnit, you are correct! I soldered it in correct (off camera) but I guess I made a booboo drawing up the schematic. Will make a small annotation to the video about that, thank you!
Switch & Lever No problem and for anybody that is wondering its a 5V zener diode.
This makes me want to make a Give-a-Fxxk-O-meter
Fail. Did not like the computer voice either.
Computer voice? What?
Hahahaha! Good one!