Author Topic: ESP32 Oscilloscope Clock  (Read 5432 times)

0 Members and 1 Guest are viewing this topic.

Offline maurohTopic starter

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: it
    • Mauro Pintus
ESP32 Oscilloscope Clock
« on: November 26, 2018, 02:36:41 pm »
Hi, just for fun I made my own version of the famous Oscilloscope Clock and shared it so everyone can play and improve the code.

https://github.com/maurohh/ESP32_OscilloscopeClock

I've used an ESP32 under the Arduino IDE and since it is just a matter of providing to the Oscilloscope the X Y coordinates, you can display whatever you want.
My target was to keep everything as simple as possible, avoiding any additional hardware, so no external RTC, no external DACs.

Since the ESP32 has 2 internal 8 bit DACs and it can connect to an ntp server to gather the exact time, it was pretty straight forward  :)

I already shared it on twitter and I was really surprised for the iterest for such a toy
https://twitter.com/PintusMauro/status/1065563496421703680

Enjoy  :-+ and don't forget to share your results or suggestions.

Mauro

PS:
Thank you to http://www.dutchtronix.com/ScopeClock.htm for sharing the project I used as reference, also the XY tables are straight from this project.
Thank you to Andreas Spiess fot the Arduino NTP Library NTPtimeESP https://github.com/SensorsIot/NTPtimeESP
Thank you to everyone else who shared some piece of advise, code... that contributed to this fun project.



 
The following users thanked this post: oPossum, edavid

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: us
Re: ESP32 Oscilloscope Clock
« Reply #1 on: November 27, 2018, 02:19:33 am »
Maybe a dumb question, but how do you get separate, disconnected line and curve segments with only X and Y?  Don't you need a blanking signal too, to hide the trace as it moves between graphic elements?  Or can you just "move it really fast" when you don't want it to show up?  And would that work on a real CRT?

I have a mostly gutted Tek 2465 that I want to turn into a clock / generic vector display one of these days...
 

Offline maurohTopic starter

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: it
    • Mauro Pintus
Re: ESP32 Oscilloscope Clock
« Reply #2 on: November 27, 2018, 10:00:11 am »
Hi Mark,
   this is not a dumb question and it is actually the all challenge of this drawings on an oscilloscope.
There are several factors that will impact the final results and are specific on how you generate the image (R2R dac, PWM with rc filter, fast DAC...) and also specific of the type of oscilloscope (analog vs digital), in some case not obvious like selected memory depth or intensity grading capability.

I see this was already discussed here https://www.eevblog.com/forum/testgear/analog-vs-digital-x-y-mode/

On my project the trick is to spend more time drawing the segments I want, moving one bit at a time along two end points and jumping to the next segment as fast as possible.
The last one is hardware dependent and the internal DACs of the ESP32 are fast enouth.

With the ESP32 I was not able to assign the values of the 2 DACs simultaneously (as you can do with an external DACs like the MCP4802), but I had to write the 2 values one at a time.
This will generate several unwanted points that will appear on the drawing.
See the attached picture where you can see all the points generated by the code displayed using an Excel chart.
This was really useful during debbugging :)

Mauro

Offline maurohTopic starter

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: it
    • Mauro Pintus
Re: ESP32 Oscilloscope Clock and Christmas tree
« Reply #3 on: December 20, 2018, 10:17:03 am »
Merry Christmas from the bottom of my Oscilloscope  :)

ESP32 Oscilloscope Christmas tree

Mauro
 
The following users thanked this post: Ysjoelfir

Offline packetbob

  • Contributor
  • Posts: 47
  • Country: ca
    • zappedmyself.com
Re: ESP32 Oscilloscope Clock
« Reply #4 on: January 09, 2019, 07:28:42 am »
Thanks for posting this great project..
I built mine on a small perfboard and used BNC jacks..

I ran into two small issues with the NTP library that I'll mention to perhaps save others time.

1) Compile Error - The code would get a compile error complaining that it could not find "ESP8266WiFi.h". This line located in the NTPtimeESP.h file as "#include <ESP8266WiFi.h>". Looking around the code it appears it was perhaps based on some previous ESP8266 code. The ESP32 code I looked at seemed to reference "WiFi.h" instead. So if you have the same issue, open up the "NTPtimeESP.h" inside the library and replace the "#include <ESP8266WiFi.h>" with "#include <WiFi.h>".

2) TimeZone Change - I couldn't find any great info on the timezone setting for the NTP library (in the 5 minutes I spent looking) but did eventually determine that you needed to modify the "NTPch.getNTPtime(1.0, 1);" request. Simply change the first argument with your required GMT offset. So for me in the Pacific Coastal Zone (GMT -8), I changed "NTPch.getNTPtime(1.0, 1);"  to "NTPch.getNTPtime(-8.0, 1);" . This solved the timezone issue.

Anyways again thanks for posting your project.

 

Offline maurohTopic starter

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: it
    • Mauro Pintus
Re: ESP32 Oscilloscope Clock
« Reply #5 on: January 09, 2019, 10:32:22 am »
Thank you for the feedback and notes!!! Really appreciated :-+

I've got the same issue with the NTPlibrary but forgot to point it out.
I'll add your notes to GitHub/Readme....

To make up for it I attached couple of pictures of some company logos on the Oscilloscope  :)

Mauro

Offline Ironballs

  • Newbie
  • Posts: 1
  • Country: gb
Re: ESP32 Oscilloscope Clock
« Reply #6 on: February 08, 2019, 10:01:19 pm »
Mauro,

I had a similar idea to you, that is take an ESP32 and turn in into an ocilloscope clock using the DACs and a NTP Server.  My sofware, although worked, isn't as polished as yours.  I put your code on my scope clock and here are the results

Hope you don't mind me posting!

Garry
 

Offline maurohTopic starter

  • Frequent Contributor
  • **
  • Posts: 292
  • Country: it
    • Mauro Pintus
Re: ESP32 Oscilloscope Clock
« Reply #7 on: February 10, 2019, 07:39:56 pm »
Wow that is a nice clock!!!  :-+
Thank you Garry for sharing this piece of electronic art.

Mauro



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf