Notifications
Clear all

Cannot get a square wave unless using test probes  

Page 1 / 2
  RSS

Skip_Evans
(@skip_evans)
Active Member
Joined: 2 months ago
Posts: 7
2020-10-25 12:49 am  

I am new to the hobby. I bought a Hantek DSo5102p oscilloscope just to learn it. I am unable to get a square wave when connected to a battery or my Uno when using ground and 5V. I do not know if I am doing something wrong or I have a bad product. Is there a contact somewhere that help me thru this?


Quote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-25 9:23 am  

Start by testing your oscilloscope. On the front panel, there should be connections for a square wave and ground. If you attach your probes to these connections and press the "automatic" button, the oscilloscope should show you a clean calibrated square wave. If this signal is not a clean square wave adjust the 10x button on your probe.

If you are still not getting a square wave, consider sending it back!


ReplyQuote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-25 9:26 am  

By the way, you won't get a square wave from a battery or from the 5V and Gnd connections on your Uno.

You need to program a digital output pin to achieve this!


ReplyQuote
Skip_Evans
(@skip_evans)
Active Member
Joined: 2 months ago
Posts: 7
2020-10-25 12:36 pm  

@pugwash

I have used the test contacts on the oscilloscope. A square wave does appear. I can use the controls to modify the wave. This is why I believe I have a problem when trying to test the Uno voltage.

 

Skip....


ReplyQuote
Skip_Evans
(@skip_evans)
Active Member
Joined: 2 months ago
Posts: 7
2020-10-25 12:40 pm  

@pugwash

This statement I do not understand. The videos I have watched especially the  "Bald Headed Engineer" demonstrate using the oscilloscope to look at the 5v on the Uno.


ReplyQuote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-25 12:50 pm  

@skip_evans

I don't wish to sound condescending but I don't know whether I am talking to an absolute novice or not but, the quickest way to create a square wave on the Uno is to take the blink sketch, change delay(1000) to delay(10), attach Gnd lead to Gnd and probe pin 13.

I am pretty sure that James "The Bald Engineer" was not probing the 5V pin.


ReplyQuote
Skip_Evans
(@skip_evans)
Active Member
Joined: 2 months ago
Posts: 7
2020-10-26 12:17 am  

@pugwash

I do not consider anything condescending. You ARE talking to a complete novice. I am 70 years old. I got tired of my expensive and exasperating hobby of long range rifle shooting.

I decided I needed a new hobby. So, I chose electronics and Arduino. Actually, I want to automate some processing in my woodshop and thought the Arduino would do the trick. The reason for the oscilloscope is, I have always wondered what the did, so I bought one.

If I sound like an idiot, it probably because with this subject, I am..

I am trying to learn and I know I will be asking some pretty stupid questions. I just ask for patience and guidance thru this maze.

Start looking at 2:00 minutes  on this video.

https://www.baldengineer.com/videos/learn-oscilloscope-basics-with-an-arduino-uno

 I watched a few other videos today and learned about coupling. Looks like I need slow things down and       re-watch the video.


ReplyQuote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-26 8:30 am  

@skip_evans

I wouldn't normally consider using a scope as entry-level to electronics but now you have got one, let's see!

I took a look at the YouTube video and I guess, you are not referring to noise measurement, but instead the first square wave that James demonstrates, that he creates using PWM (Pulse Width Modulation). I played around with an Arduino for at least a year before stumbling across PWM.

Best to look around for a good tutorial on PWM, but in the video, James assumes that you already know the basic principles.

Here is my short and simple (KISS) explanation. By creating a high-frequency square wave 0 to 5V, due to latency, the output pin can be fooled into thinking that the voltage is actually lower than it really is. If you use a multimeter to measure to the voltage on a pin set to 50% PWM, it will show 2.5V.

James set up digital pin 3 as his output pin and set its value to 128. As this pin can be anything from 0 to 255, the math is simple.

128/255 *100 = 50% i.e. 2.5V

Hope this helps a bit!


ReplyQuote
Skip_Evans
(@skip_evans)
Active Member
Joined: 2 months ago
Posts: 7
2020-10-26 1:40 pm  

@pugwash

Thanks for the advice. Yesterday, I found a set of videos that work at a more basic level. I will be watching those today....

I know an oscilloscope is really above my paygrade right now, but I am curious.

 

Thanks again. I am sure I will have more questions.


ReplyQuote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-26 1:46 pm  

@skip_evans

I set up an Arduino with the same configuration as James this morning, and I got the same results, 50% duty cycle at 490Hz.

There is nothing wrong with curiosity, except that it kills cats! 🤣 🤣 


ReplyQuote
Skip_Evans
(@skip_evans)
Active Member
Joined: 2 months ago
Posts: 7
2020-10-26 9:47 pm  

@pugwash

Finished my Function generator (Kit). Got the scope working.. Not sure what it is telling. Progress.. Now what?😋 😋 


ReplyQuote
frogandtoad
(@frogandtoad)
Honorable Member
Joined: 1 year ago
Posts: 540
2020-10-27 7:44 am  

@pugwash

Posted by: @pugwash

James set up digital pin 3 as his output pin and set its value to 128. As this pin can be anything from 0 to 255, the math is simple.

128/255 *100 = 50% i.e. 2.5V

Hope this helps a bit!

I could be completely wrong, but shouldn't the voltage still be at 5V?
As far as I understand it, that calculation of 50% refers to the "on time", i.e:- "duty cycle"?

Cheers.


ReplyQuote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-27 9:40 am  

@frogandtoad

Oh! Silly me!

I guess I should have used the phrase "apparent" or "effective" voltage.

Try it! Measure the voltage on the output pins with a multimeter at 50% duty cycle. I did and the meter showed 2.45V.


ReplyQuote
Pugwash
(@pugwash)
Noble Member
Joined: 1 year ago
Posts: 1008
2020-10-27 1:00 pm  
Posted by: @skip_evans

@pugwash

Finished my Function generator (Kit). Got the scope working.. Not sure what it is telling. Progress.. Now what?😋 😋 

Well done, getting it all to work!

If your intention is to do some automation in your workshop, then you are going to have to get your head around rudimentary programming of the Arduino with C++. Initially, all the tools you need are on the Arduino website language reference section.

Try not to run before you can walk, that is really too tempting and have some patience, you are only 5 years my senior and I know how frustrating it can be to learn something only to have forgotten half of what you have learned by the following day. You are not alone!

Try running up a concept and let the forum kick it around a bit. There are enough people here to give you tips and pointers, and who will tell you where you are going wrong. Don't be discouraged by criticism, some of it may be positive.


ReplyQuote
frogandtoad
(@frogandtoad)
Honorable Member
Joined: 1 year ago
Posts: 540
2020-10-27 2:49 pm  

@pugwash

Posted by: @pugwash

Try it! Measure the voltage on the output pins with a multimeter at 50% duty cycle. I did and the meter showed 2.45V.

Oh, I trust you may well be getting that output on the pin @ 50% duty cycle, but maybe (and I'm just guessing), that it may be due to some latency, and possibly from the multimeter itself?

Anyhow, I just wanted to clarify that the duty cycle [1], referred to the "on time" per one full cycle, rather than a change in voltage.

[1] - I would also like to note that I'm not 100% sure if the percentage "on time" should actually be referred to as the duty cycle in this context?... I guess it can be, but for one cycle of the wave only.  Reason is that I know that duty cycle is also taken at a 10 minute period for say a welder, where a 60% duty cycle means that it can run continuously for 6 of the 10 minutes before it overheats and shuts down.

Cheers.


ReplyQuote
Page 1 / 2