electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Paia EK-7 Digitizer (4 Bit ADC)
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Ruebezahl



Joined: Mar 09, 2014
Posts: 104
Location: Taiwan
Audio files: 4

PostPosted: Mon Dec 18, 2023 9:09 am    Post subject: Paia EK-7 Digitizer (4 Bit ADC)
Subject description: after some correction i made it work
Reply with quote  Mark this post and the followings unread

Ever since i came across the ingenious Electro Harmonix Clockworks, an kind of analogue clock divider link
, i was trying to take this concept of using a potentiometer as a voltage divider and kind of quantize the output to control digital chips, like for example the 4089, to make cool beats or other things in the spirit of lunetta. basically what i need is a low resolution ADC. While an DAC is kind of simple with the classic R2R ladder, the go to way to make an ADC with discrete components seems to be a comparator stage for every digital value followed by an En5coder. For a 4 bit word that already needs 15 comparators plus the encoder, so at least 5 chips, so not as simple as i hoped. But in this thread here somebody posted an article that was originally published in the polyphony magazine, complimenting a kit by Paia. I think the kit doesn't exist anymore, but it looked much simpler than the classic way. The Digitizer, how they call it, achieves 4 bit ADC with only four comparators and a couple resistors (almost 30), so one chip! Phobos said he tried it and it didn't work, which was a bit discouraging, since i trust his skills a lot Laughing

article:
https://paia.com/manuals/docs/EK-7_200.pdf

original thread:
https://electro-music.com/forum/viewtopic.php?highlight=adc&t=73314

Anyway i am a big boy and i found i actually have all the resistor values needed lying around so i gave it a try and... it kind of worked. Well i had to fix some obvious mistakes, but after i double triple checked, there was one last bug i just couldn't find an error: the last step was missing, it always froze at 1110 and never jumped to 1111, even if i connected the reference voltage right to the positive rail. so i figured there must be something wrong with the least significant digit and randomly swapped resistors around there. And it turns out if i swap the resistor R6 that is pulling the output D3 up for a much bigger number (100k worked for me), everything works now! i don't really know why the value is soo off the schematic, but to be honest i am also not 100% sure about a few things in the schematic, like why there are all this 39k resistors before the inputs, or those pullup resistors in general. in the 2 bit version they are not there. Actually i might try a version omitting them, might work just as well Laughing

Anyway, sorry for the wall of text, i am a bit excited. So long story short: I can confirm this schematic works, but i had to swap the R6 for 100k. Also i used an LM339 as a comparator, if anyone was wondering.

but: i only tested it with LEDs so far and it is obvious it's not a clear cut digital robot, but rather a wonky wannabee. the digital states represented by the LEDs were actually fading in and out each other, which is very interesting, especially since i buffered all the ouputs. Definitely looking forward to do more experiments. I can quite appreciate this remaining analogue ambiguiness! Smile


paia 4 bit digitizer.png
 Description:
Paia 4 Bit "Digitizer" aka Analog to Digital Converter
 Filesize:  104.56 KB
 Viewed:  70 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

paia 4 bit digitizer.png



_________________
https://soundcloud.com/ruebezahl
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5810
Location: Moon Base
Audio files: 709

PostPosted: Mon Dec 18, 2023 11:18 am    Post subject: Re: Paia EK-7 Digitizer (4 Bit ADC)
Subject description: after some correction i made it work
Reply with quote  Mark this post and the followings unread

ah yes that quirky thing, with it's magical, somewhat fractal like, resistor network.

Ruebezahl wrote:
basically what i need is a low resolution ADC. While an DAC is kind of simple with the classic R2R ladder, the go to way to make an ADC with discrete components seems to be a comparator stage for every digital value followed by an En5coder.

I know the struggle, I still haven't come across an easy to use, cheap, parallel output 3/4-bits ADC in a regular DIP package. This did seem like an attractive alternative.

Quote:
] Phobos said he tried it and it didn't work, which was a bit discouraging, since i trust his skills a lot Laughing

right,. that makes at least one of us Wink
I did have a look back at the thread and yes, as I recalled that last output had some issues. It was useful for 3 bits but with its amount of resistors and
(for good measure) extra buffers on the outputs it's not really much less inconvenient than the more standard comparators + encoder approach.
I think it was also a little bit unreliable around the transition points but don't trust me on that Wink

Quote:
And it turns out if i swap the resistor R6 that is pulling the output D3 up for a much bigger number (100k worked for me), everything works now!

That's great and not what I would expect. The LM339 has open collector outputs and it shouldn't have a problem pulling it low enough with a 2K2 pullup,
needing a much larger values is odd. I checked a schematic I drew of it and I did decrease R1 to 390 (from 470) to adjust the range and instead of those
2 diodes I seem to have used a single 2.7V zener diode.


Quote:
i don't really know why the value is soo off the schematic, but to be honest i am also not 100% sure about a few things in the schematic, like why there are all this 39k resistors before the inputs, or those pullup resistors in general.

I think on the non-inverting inputs those 39K resistors make the hysteresis possible that is created with the 2M2 feedback resistors (R5/R12/R19/R27).
They're probably placed on the other inputs to match the inputs to reduce errors but since those inputs are already fed through a network of (higher value)
resistors I don't think that will work properly. Maybe there is some more info to be found in a MC3302P datasheet.


I do like the setup of the circuit and if you did get it to work reliable to 4 bits than it could actually be useful.


20231218 - PAiA 4bit Digitizer (folding ADC) r.jpg
 Description:
my stripboard version including all the dust (and hairs) it gathered over the years.
 Filesize:  1.34 MB
 Viewed:  78 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

20231218 - PAiA 4bit Digitizer (folding ADC) r.jpg



_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Ruebezahl



Joined: Mar 09, 2014
Posts: 104
Location: Taiwan
Audio files: 4

PostPosted: Tue Dec 19, 2023 2:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ahaha, you just got me with the diodes! I just straight ignored them, i thought it is just for reverse polarity protection, never even thought about why they stuck two in there Laughing

So it turns out they actually have a function: After studying the PCB layout i realized that the Comparators are powered by the 5V and the rest of the circuit takes its positive rail from the (diode dropped) voltage (8.8V but my supply voltage is 10V, i just tried 5V just in case and it works pretty much the same).

I do think it is not so clear in the schematic, since it doesn't say where the comparators power supply is coming from, but still, i could have thought about that earlier...

And moreover, it works now with the proper R6=2.2k, so basically all my pondering and experimenting was "for the cat", as we would say in German. Laughing

Speaking of cat, i shot a video of the operation, including my cat jumping in and stopping my operations for one hour, taking apart my breadboard to find the error. And in the end realizing i just turned the pot to one of the gaps between logic states and kept it there for the whole time i was trouble shooting!!!

So yeah, that is definitely a little annoying, between a few states (but only at two points actually) instead of giving out a clear cut 1 or 0, the outputs start to wildly oscillate (several megahertz sometimes), which is also audible in the sound in the end. Maybe i could just filter it out? But would be even nicer i could find a way to make the transition smoother, i mean it works for most of them!


So i have to correct myself:
Quote:
Anyway, sorry for the wall of text, i am a bit excited. So long story short: I can confirm this schematic works, but i had to swap the R6 for 100k. Also i used an LM339 as a comparator, if anyone was wondering.


The schematic works just as it should! No changes needed! Very Happy

Changing R6 to 100k doesn't change anything now, and so do all the other pull up resistors, 2.2k works and 100k works just as well...

But if i find a way to make it more reliable, i let everyone know!

Quote:
That's great and not what I would expect. The LM339 has open collector outputs and it shouldn't have a problem pulling it low enough with a 2K2 pullup,
needing a much larger values is odd. I checked a schematic I drew of it and I did decrease R1 to 390 (from 470) to adjust the range and instead of those
2 diodes I seem to have used a single 2.7V zener diode.


Uhm, maybe that might actually be the reason why it didn't work? Seems like those diodes are pretty essential! i used 1N4148 and they worked fine as a replacement (both with 5V and 10V), but a zener diode might as well be the difference that made it behave weirdly!


Quote:
I think on the non-inverting inputs those 39K resistors make the hysteresis possible that is created with the 2M2 feedback resistors (R5/R12/R19/R27).
They're probably placed on the other inputs to match the inputs to reduce errors but since those inputs are already fed through a network of (higher value)
resistors I don't think that will work properly. Maybe there is some more info to be found in a MC3302P datasheet.


ah yeah, makes sense, kind of, but i share your doubt that they do what they are supposed to do, i think i will play around and see if they are necessary, or if i can maybe even improve the circuit by replacing them! I checked the datasheet and was surprised to see that the LM339 and the MC3302 share the same datasheet, so the differences might not be so big. But maybe the little weird behaviour is due to that differences... brb studying datasheets, if somebody ask for me, i am in an important meeting! Wink

Anyway, its good to get some feedback, and like so often that and also typing out my thought helps a lot to bring those projects forward instead of letting them be halfbaked breadboard circuits that i never properly finish and then after one year find in the drawer and try to figure out what it was Laughing So thanks!

_________________
https://soundcloud.com/ruebezahl
Back to top
View user's profile Send private message
Ruebezahl



Joined: Mar 09, 2014
Posts: 104
Location: Taiwan
Audio files: 4

PostPosted: Tue Dec 19, 2023 3:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Quote:
Speaking of cat, i shot a video of the operation, including my cat jumping in and stopping my operations for one hour, taking apart my breadboard to find the error. And in the end realizing i just turned the pot to one of the gaps between logic states and kept it there for the whole time i was trouble shooting!!!


Here is the promised cat video!

Seems like there is no way to embed external videos?



Aaaand:

Quote:
Maybe there is some more info to be found in a MC3302P datasheet.


you were right (see screenshot straight from the datasheet)


Bild_2023-12-20_065728632.png
 Description:
Screenshot from LM339 Datasheet
 Filesize:  90.18 KB
 Viewed:  78 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Bild_2023-12-20_065728632.png



_________________
https://soundcloud.com/ruebezahl

Last edited by Ruebezahl on Tue Dec 19, 2023 7:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24420
Location: The Netherlands, Enschede
Audio files: 297
G2 patch files: 320

PostPosted: Tue Dec 19, 2023 4:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ruebezahl wrote:
Seems like there is no way to embed external videos?


Right click on the youtube, select "copy embed code" then paste that into the post ... did this for the previous post.

The cat did not do it Cool

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Ruebezahl



Joined: Mar 09, 2014
Posts: 104
Location: Taiwan
Audio files: 4

PostPosted: Tue Dec 19, 2023 7:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
Ruebezahl wrote:
Seems like there is no way to embed external videos?


Right click on the youtube, select "copy embed code" then paste that into the post ... did this for the previous post.

The cat did not do it Cool


ah thanks, i found it now too! And yes, the cat did indeed not do it, after finding the error, i think it is obvious that it stops working just after i turned the pot a little bit!!! But it took me one hour switching out chips, measuring every possible connection, before it came to my mind to turn the pot a little bit Rolling Eyes Laughing

_________________
https://soundcloud.com/ruebezahl
Back to top
View user's profile Send private message
Ruebezahl



Joined: Mar 09, 2014
Posts: 104
Location: Taiwan
Audio files: 4

PostPosted: Wed Dec 20, 2023 3:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

A little update!

I did the following revisions:

-Omitting all resistors on the inverting inputs (so far i couldn't see any bad influence from that), just to lower the parts count

-Changing some values of the resistors at the non inverting inputs (R4 and R9 in my new schematic), in order to make it more stable around the transition points

A bit about why i changed those: First of all, there where two transitions that were especially prone to self oscillation of the comparators:

0011-->0100
0111-->1000

so basically the two times D2 and D3 turned on respectively, so i was trying to change something about those two stages. In the datasheet of the LM339 is actually a nice graphic explaining how the feedback and input resistor set the hysteresis. So making the input resistor bigger results in a bigger hysteresis. Of course it shouldn't be too big, otherwise the jumping will be too off when the counting goes up or down respectively. But i found those values give me the best results in killing the oscillation without influencing other factors. Feel free to experiment with other values. Alternatively i guess one could also raise the feedback resistor values, but not many people have a varied assortment of >Megaohm Resistors, so i guess its easier that way.

Long story short: I got it working pretty smoothly, and even managed to lower the parts count a little, if you feel anxious about that you can also put them back in. The response might not be 100% linear, but for my purposes it is good enough and i think this circuit is pretty neat for what it is!


lm339 datasheet example.jpg
 Description:
 Filesize:  38.85 KB
 Viewed:  14443 Time(s)

lm339 datasheet example.jpg



4 bit adc.jpg
 Description:
 Filesize:  71.97 KB
 Viewed:  74 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

4 bit adc.jpg



_________________
https://soundcloud.com/ruebezahl
Back to top
View user's profile Send private message
PHOBoS



Joined: Jan 14, 2010
Posts: 5810
Location: Moon Base
Audio files: 709

PostPosted: Wed Dec 20, 2023 4:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

nice work!


I honestly have no idea why I used a zener or if I even used it to separate the power. I probably did test with ordinary diodes first though.



Ruebezahl wrote:

A bit about why i changed those: First of all, there where two transitions that were especially prone to self oscillation of the comparators:

0011-->0100
0111-->1000

That makes sense as it has to change 3/4 outputs at the same time and the signals are directly fed back without any latches.
Makes me wonder if it is possible to construct something like this but with a gray code output.

_________________
"My perf, it's full of holes!"
http://phobos.000space.com/
SoundCloud BandCamp MixCloud Stickney Synthyards Captain Collider Twitch YouTube
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Grumble



Joined: Nov 23, 2015
Posts: 1310
Location: Netherlands
Audio files: 30

PostPosted: Thu Dec 21, 2023 3:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Why don’t you use a TLC0820, that is an 8 bit flash ADC.
Sample time max. 2.5uSec, 5 volt supply.
Use the 4 highest bits…


tlc0820a.pdf
 Description:
8bit flash adc

Download (listen)
 Filename:  tlc0820a.pdf
 Filesize:  1.16 MB
 Downloaded:  65 Time(s)


_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
Ruebezahl



Joined: Mar 09, 2014
Posts: 104
Location: Taiwan
Audio files: 4

PostPosted: Thu Dec 21, 2023 4:49 am    Post subject: Reply with quote  Mark this post and the followings unread

Grumble wrote:
Why don’t you use a TLC0820, that is an 8 bit flash ADC.
Sample time max. 2.5uSec, 5 volt supply.
Use the 4 highest bits…


Thanks, to be honest i just didn't know if it's existence lol I tried before to find something like this, but felt like it was mostly stuff that was supposed to directly connect to some computer-like thing, so serial.

That chip indeed looks pretty useful! Although it has a few downsides, like:

-It's not DIP. I am used to breadboarding, and although this problem can be solved with breakout boards, and are a non issue with printed circuit boards, i still prefer DIP if possible.

-It seems to work only with 5V, so i might have to attenuate signals to work with it. Definitely possible, but this circuit so far seemed to be really unimpressed by changes in supply voltage, with behaviour not changing between 5V and 10V, so it is a bit more flexible

-Availability. Well i didn't do too much searching yet, but at least on my local sources i couldn't find it immediately. I always have some comparators lying around

-Price. Well this one i am not sure. On classic sites like mouser it is rather expensive from 4 to 6 Dollar, while i saw it on alibaba for 10cent, so it might actually be not so expensive. But also, an LM339 and a couple of resistors are also quite cheap Smile

Well, all things said, i think i will actually check that one out, and if i can find a good source i might give it a try, but for now, i am pretty happy that i made this one work, even just for the fact that i learned quite a bit in the process.

edit: oooh, never mind, i think i found a DIP version Smile would have to order from china, but perhaps worth a shot!




Quote:
That makes sense as it has to change 3/4 outputs at the same time and the signals are directly fed back without any latches.
Makes me wonder if it is possible to construct something like this but with a gray code output.


huh? not sure what THAT is, but now i want to build it Laughing

_________________
https://soundcloud.com/ruebezahl
Back to top
View user's profile Send private message
elektrouwe



Joined: May 27, 2012
Posts: 146
Location: Germany

PostPosted: Tue Jan 09, 2024 8:33 am    Post subject: Reply with quote  Mark this post and the followings unread

PHOBoS wrote:

Makes me wonder if it is possible to construct something like this but with a gray code output.


https://www.analog.com/media/en/training-seminars/tutorials/MT-025.pdf
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [11 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use