Hi all,
I'm a retired baby-boomer. As the years have added up, my body has less ability to generate needed hormones. What's surprising about this is my increased difficulty to fall asleep, stay asleep, attain REM sleep and to re-acquire sleep if awakened. Year after year, the problem grows worse.
I've tried using white noise, pink noise and raindrop sonic generators which helped for a while. Still, I wasn't getting the restorative sleep I experienced in my teens and twenties.
Investigating what others were doing, I discovered numerous Sleep-inducing Solutions on Patent and other web sites.
My intent has been to create a platform for realizing the various (brain entrainment) pulse signals these patents describe.
I bought my first Arduino around May 2013 to generate the needed signals.
Being a Visual-Studio user, it was a natural to get the Visual-Micro addin. When I discovered the VM-debugger, I set about using it to help me understand why certain sections of code were not working (all my fault with poor coding).
NOTE: The following was accomplished using a long USB cable to access the Arduino Nano. I had to manually disconnect the +5 assembly pin for this to work. Said another way, I was powering my Nano by hooking it to a +5 volt power supply. It was necessary to disconnect from +5 in order to avoid "USB Device Not Recognized" messages from Windows. According to info found on the web, the internal +5 system powered thru the USB cable can get loaded down -- causing this message. I experienced the same problem using the Vin Pin with +11 volts! My solution was to manually disconnect +5 from the Nano pin (before) inserting the USB mini-connector. This allowed me to use a longer USB cable. I used the VM-Addin to upload my Sketch code to the Nano and the VM-Debugger to troubleshoot mistakes I made. Eventually I had my Nano accurately generating all intended signals. Being able to inspect what was happening at critical junctures made all the difference!
I needed an external interrupt to help me schedule planned signal arrangements. Using VM Debugger Breakpoints, I was able to examine variables set *within* the Interrupt Service Routine.
At first I had problems achieving useful results with the breakpoint in the ISR. But setting
Throttle=False, I was up and running no problem.
I chose External Interrupt-0 driven by a real-time clock signal wired to Digital-Pin #2. My scope shows all signals delivering precise Frequency, Duty-Cycle with
no detriment from the 1-second interrupts executed
(while reporting back to the Expressions window in my IDE!).
I have yet to deploy my project. Its scheduling will be tested using empirical methods as I hopefully find the magic combination of signals to get me a good nights sleep. Using VM's super Debugger, I have overcome both hardware and software issues in record time. This is the way to go!
Jul 2
nd, 2013 at 3:20pm
UPDATE: One of four output channels now working as hoped!
Gelius warnings well founded, the Inducer effects stronger than anticipated. (Thanks Gelius)
PROJECT DIRECTION CHANGE I was originally going to write code and add hardware to support 'configuration' but after reviewing Arduino Serial Comm capabilities, have decided to purchase 'USB extender' devices for a long-run USB cable. Then use my development PC to control the Arduino once deployed. Using a PC app (for Arduino serial comm) would allow easy ways to test protocols as well as capture sensor results.
sv