AD9833

Post and discuss new components that you have created.
chipfryer27
Valued Contributor
Posts: 1147
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

Further to above posts I tried to get both modules running using Martin's code, again as a known good example.

Not a great success. If I had either module connected all went well but when both were connected, module 1 just went crazy. It didn't matter if I swapped CS pins. Either worked alone but when both were connected module 1 wasn't happy.

Further testing showed that the CS pin on module one was constantly held low, meaning any and all activity on the SPI pins would be getting through whether intended to or not. Looking at the module through a magnifying lens it appears there is a solder bridge behind the chip pins.


Picture.jpg
Picture.jpg (94.3 KiB) Viewed 2859 times


New on order.

Regards

kersing
Valued Contributor
Posts: 157
Joined: Wed Dec 02, 2020 7:28 pm
Has thanked: 64 times
Been thanked: 58 times

Re: AD9833

Post by kersing »

Does the second module look the same? It could be intentional.

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi Kersing

I did check thanks, and the other also appears to be soldered better too. Guess this one fell through whatever passes for their QC...

I'm still impressed enough with the modules to order up another couple from same vendor. Using these modules will be a lot easier than trying to generate a signal from scratch, so I'm hopeful the next two will be problem free.

Regards

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

Managed to get a 'prototype' working.

Actually second attempt - first didn't give an output on oscilloscope (and I was using the digital inputs and 655mV wasn't enough. Realised after much testing of SDATA, SCLK and FSYNC - then pulling it apart and putting it back together - oh how we laughed!)

I have a potentiometer to set frequency (actually the value from the ADC fluctuates - so any suggestions as to avoiding frequency changes (second button?)) The pot was the first that came to hand (1k)
The button - top right - changes program alpha-beta-theta-delta. I use Martin's excellent Map component - to map 0-5V to 20 - 20000Hz (and assume the pot gives 0..5V) - both assumptions (that the pot is perfect and that I have the ears of a bat) may be false I 'experimented' with the value to test the change against before changing frequency.

i2c display shows current program and frequency.

Probably should use an inbuilt pull-up/pull-down resistor on D2 rather than the resistor (first to hand) connected to ground (but this would make the code AVR specific) Pin 8 - is set high and provides power for the switch.

Headphones to attach to both OUTs and one AGND.

Note - I linked all the pins on the two ad9833 modules except FSYNC and OUT - colour of wire only signifies length :-(
At the bottom is my i2c memory bank for Arduino - I'm not brave enough to take it apart - so space a little limited by this...

Oddly - both ad9833s now seem to give 5v (actually 6.6v which is odd!) on sine wave and the signal is much 'noisier' than it was? This is suspiciously like 10 x 665mv - but not sure what I changed on the 'scope.

binaural.jpg
binaural.jpg (104.04 KiB) Viewed 2836 times
Beats.fcfx
(35.96 KiB) Downloaded 114 times
Next flashing lights. Or maybe a little lie down?

Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi Martin

My new modules arrived yesterday.

A bit better quality than before

Picture.jpg
Picture.jpg (55.46 KiB) Viewed 2806 times

I put proper headers on them and tested both individually, working OK straight away with known good jumpers. I then connected them both up, much like you did and downloaded some of my own code I was using to test with.

However I still had problems with the first module (connected to Ch1 of scope). I could not get a trace on that channel at all. Swapped modules over but nothing at all. Problem down to lack of colour perception.... On both modules I'd used yellow/green jumpers for Analogue Out / Ground but on Ch1 I'd connected probe to green and ground to yellow... I won't tell you how long that took to figure out....

Once connected correctly I could then obtain traces on two modules (delta 10Hz) being accessed via separate CS pins.

Traces.jpg
Traces.jpg (99.41 KiB) Viewed 2806 times

I'd set ch1 for 435Hz and ch2 for 445Hz but now being pushed for time I just grabbed a quick single shot.

As I have some cheapo KY-040 Rotary Encoders somewhere I think I'll use one to input parameters which should make things a bit easier. Rotating will increase / decrease digit (0-9) and a press will set it and move the cursor to next position etc.

I'm toying with the idea of using an array to store "program" variables. For example I will perhaps use "carrier" for the centre frequency, "beat" for the frequency of the binaural beat, and "length" for the duration of the program. That way I can create a sweep using multiple beats.

If I had the array populated with reference,carrier,beat,length :-

0,440,10,5
1,440,8,5
2,440,6,5
3,400,6,5
4,330,4,20

Grabbing the details from reference 0, the carrier and beat would be used to calculate Left/Right frequencies (335/445, delta 10) and run for 5 minutes. It would then move to reference 1 etc before terminating after outputting 328/332 for twenty minutes (total length forty minutes).

Just a thought and as I now have an extra module I might create a set of LED glasses that pulse at the beat frequency, or maybe use for Isochronic tones?

Won't get a chance to play for a few days though.

Regards

PS
Did you accidentally switch the Probe to 10x or tell the scope you were using a 10x probe or the like?

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

Like the idea of a rotary encoder and of the programs running through several 'phases'. There must be some info on suitable programs?
I suppose these are less common now - it's easier to get your phone / pc to add beats to some music?
The flashing lights must add something to the experience - but again should they just flash on sync with the beats or is there some other pattern/rate/colour that will help?

I'm heading away for a few days camping on Fetlar - so after a week of stunning weather it's just starting to rain ☔

Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

Truly envious of your trip and as I'm sure you know you can never ever predict weather in the islands, and you should also take sunscreen and snow shoes, well it is summer.... :)

The links I posted earlier provide an insight into "beat" frequencies but not too much is documented on "carrier" (again sorry for bad analogy). Machines can cost many hundreds of dollars/pounds (or dollarpounds if a fan of Red Dwarf). Some do dual binaural beats, others include Isochronic and others include a background of surf/tree hugging.

My Halcyon swept, and that included the carrier too, getting progressively lower as the program progressed. The lights however just flashed at the "beat" frequency.

Enjoy the break.

Regards

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: AD9833

Post by mnfisher »

Thanks - beat frequency it is.

It would be good to get some tree hugging or whale song mixed in too.

Looking forward to the trip - yesterday I 'made' an auto-watering system for the garden (okay it's a solenoid valve and a timeswitch but MCU control might come later) - so I'm expecting rain...

Martin

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

As mentioned much research has gone into Binaural Beats and it isn't mumbo-jumbo snake oil. The beat frequencies are well documented in the scientific world but the "carrier" (I really should find a better analogy) is very much open to interpretation. Some swear by 500Hz, others the obvious 440Hz and yet more use sub 100Hz. Some systems sweep both the beats and carriers during the program.

The ones that use or incorporate Isochronic Tones use the beat to modulate the carrier. Many options to do that (e.g. 440@10 or 70@4) which could be combined with BB or perhaps incorporated into the glasses. With the glasses, when on the LEDs are emitting whatever wavelength they emit, being switched on/off at the beat. Perhaps having them instead running at the carrier with intensity controlled by the beat may prove beneficial? In case it isn't obvious to anyone reading this, you keep your eyes shut when using the glasses. The light intensity is adjusted so you "see" the led's flash at a comfortable level. Close your eyes and move your hand over your eyes and you will get what I mean.

You can download .mp3's of tree hugging sounds freely on the web, which could be incorporated into the background, or and I guess depending on sounds, pulsed at beat. Decades ago I obtained a couple of CD's. Carmel by the Sea was just a recording of the sounds at Carmel beach, surf, birds etc. I can't remember the name of the other but it was rainforest related. I didn't like that much as having lived in a few rainforests I didn't think it sounded much like any I'd been in so was just annoying.

The BB CD's that are available, at considerable cost, contain tracks claimed/aimed at whatever and I guess these would be easy to create if you had an audio mixing desk to hand. Generate whatever with whatever background and record the output. However I'm sure we could incorporate audio mixing into the outputs even if it is a bit of "wibbly-wobbly" electronics (to quote the great "Max the Magnificent" providing the best description of analogue circuits ever, from EE/PE magazine).

Many options to experiment with, especially if in full control of every aspect. I'm now considering building a "bigger" machine than intended. I thought to just make a small machine that perhaps lay in a beside drawer (as my Halcyon did and incidentally anyone that borrowed it did report good results) but now maybe a machine that incorporates everything and can control each aspect is perhaps a better option to experiment with. The only downside is trying to persuade my girlfriend that the small rack mounted kit is really the new fashion in bedside tables.... :)

Regards

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: AD9833

Post by chipfryer27 »

Hi

A further thought. I've seen a few Stereo BT transmitter boards on the usual sites and they look easy enough to use. They would eliminate the need for a cable from unit to you, assuming you had BT headphones. Glasses would probably be better remaining tethered though.

Regards

Post Reply