Entries tagged 'cat:incomplete' (Page 1)

USB/Serial PWM Fan Controller Using an Arduino Entry created on 2020-11-22 (edited 2021-10-15) Authors: steeph (370) Categories: Arduino (4) Case Modding (11) Code (31) Computer (78) DIY (16) Electronics (16) Fans (1) Hardware (16) Projects (41) incomplete (22) Languages used: en (255) Topics: Projects → Arduino (4) Projects → Case Modding (9) edit

I wanted to be able to control the speed of the fans in my big NAS, Fred, individually. Even though the mainboard in use has five PWM fan connectors, the chipset can only control the speed of all fans together. There are probably good fan controllers commercially available that solve this problem better than I did. But they seemed overpriced and it seemed like a fun learning project for me.

The fan controller that I made uses an Arduino Nano clone that listens to it's serial port, waiting for a command to change the speed of a fan. When a command is recognised the continuous PWM signal for that fan is changed accordingly. It's possible to control up to six fans this way with an Arduino Nano. I'm only using three though since I only have three fan groups that need to be controlled separately.

The Arduino sketch/C code for the Arduino Nano that I used is as follows.




//fan speed sensor wire attached to digital pin 2 with a 10kohm pullup resistor
//fan PWM control wire attached directly to digital pin 9

#include <PWM.h> //include PWM library http://forum.arduino.cc/index.php?topic=117425.0

volatile int half_revolutions1; //allow half_revolutioins to be accesed in intterupt
volatile int half_revolutions2; //allow half_revolutioins to be accesed in intterupt
int rpm1; //set rpm as an integer
int rpm2; //set rpm as an integer
int pwm=255;
const byte numChars = 5;
char receivedChars[numChars];

boolean newData = false;

void setup()
{
  InitTimersSafe(); //not sure what this is for, but I think i need it for PWM control?
  bool success = SetPinFrequencySafe(9, 25000); //set frequency to 25kHz
  pwmWrite(9, 51); // 51=20% duty cycle, 255=100% duty cycle

  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  analogWrite(5, 170);
  analogWrite(6, 255);
  pinMode(2,INPUT_PULLUP); //set RPM pin to digital input
  pinMode(3,INPUT_PULLUP); //set RPM pin to digital input
  half_revolutions1 = 0;
  rpm1 = 0;
  half_revolutions2 = 0;
  rpm2 = 0;

  Serial.begin(9600);
}



void loop()
{
  sei(); //enable intterupts
  attachInterrupt(0, fan_rpm1, RISING); //record pulses as they rise
  delay(1000);
  detachInterrupt(0);
  attachInterrupt(1, fan_rpm2, RISING); //record pulses as they rise
  delay(1000);
  detachInterrupt(1);
  cli(); //disable intterupts

  rpm1 = (half_revolutions1/2)*60;

  Serial.print("1");
  Serial.println(rpm1);

  rpm2 = (half_revolutions2/2)*60;

  Serial.print("2");
  Serial.println(rpm2);

  rpm1 = 0;
  half_revolutions1 = 0;

  rpm2 = 0;
  half_revolutions2 = 0;

  pwm = 255;
  recvWithStartEndMarkers();
  processCommand();
}

void fan_rpm1()
{
  ++half_revolutions1; //increment before returning value
}


void fan_rpm2()
{
  ++half_revolutions2; //increment before returning value
}


void recvWithStartEndMarkers() {
    static boolean recvInProgress = false;
    static byte ndx = 0;
    char startMarker = 's';
    char endMarker = '\n';
    char rc;
 
    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();

        if (recvInProgress == true) {
            if (rc != endMarker) {
                receivedChars[ndx] = rc;
                ndx++;
                if (ndx >= numChars) {
                    ndx = numChars - 1;
                }
            }
            else {
                receivedChars[ndx] = '\0'; // terminate the string
                recvInProgress = false;
                ndx = 0;
                newData = true;
            }
        }

        else if (rc == startMarker) {
            recvInProgress = true;
        }
    }
}

void processCommand() {
    if (newData == true) {
        Serial.print("s");
        Serial.println(receivedChars);
        switch (receivedChars[0])
        {
            case '1':
                receivedChars[0] = '0';
                sscanf(receivedChars, "%d", &pwm);
                analogWrite(5, pwm);
                break;
            case '2':
                receivedChars[0] = '0';
                sscanf(receivedChars, "%d", &pwm);
                analogWrite(6, pwm);
                break;
            case '3':
                receivedChars[0] = '0';
                sscanf(receivedChars, "%d", &pwm);
                
                break;
//            default:
//                Serial.println("I don't know what that means.");
        }
        newData = false;
    }
}

Well, how should I put it? It works, usually.

(tbc?)

(tba:photos)

Comment via email
USB Volume Control Knob Entry created on 2020-12-04 Authors: steeph (370) Categories: Arduino (4) Computer (78) DIY (16) Electronics (16) Projects (41) incomplete (22) Languages used: en (255) Topics: Projects → Arduino (4) edit

Volume control used to be a lot more responsive, quick and simple when the used potentiometers (analogue knobs or wheels). Just reach to the knob and the volume is at 0 or 100% almost instantly. No key combinations, no deactivated function keys, no switching tabs, no delay (!), no pressing the same botton multiple times or holding it down. I miss that.

(tba:content)

The WILD Ball Entry Permalink (edited 2020-03-06) Authors: steeph (370) Categories: Dreaming (9) Lucid Dream Induction (3) Lucid Dreaming (12) Projects (41) incomplete (22) Languages used: en (255) Topics: Projects (59) edit

WILD Ball - electronic DIY aid in WILD induction

What is a WILD Ball?

WILD Ball is the name I have given my little project to build a device that aids a person in falling asleep more consciously and possibly experience waking-initiated lucid dreams.

It is a tennis ball sized device that you hold in your hand while trying to fall asleep consciously (usually after a WBTB). WILD (waking-initiated lucid dream) is referring to my preferred way to experience dream consciousness.

(How) Does it work?

The most common reason why WILD attempts fail is that the critical moment - the exact moment where you start to perceive the dream instead of your physical surrounding enough to control the dream consciously - is simply missed. You stay awake for a while, and when/if you finally fall asleep, you don't notice it. It is important to stay aware until or become aware right at that moment where you already perceive a dream but are still conscious enough to control it. There is a variety of mental and a few physical techniques that are supposed to help one to accomplish just that. This device is an additional aid to mental techniques. As with other electronic devices made to aid lucid dream (LD) induction, it is expected to work best if you already have experience in successful LD induction. Of course it is not necessary to have experienced LDs before in order for this device to help accomplish this goal. I suggest its usage as a part of the WILD induction training of anybody who sees it as a fitting addition to their WILD practice. If you already have the ability to explore hypnagogic hallucinations extensively or sometimes experience the beginning of a dream without becoming lucid, this device might fill a gap in your LD practice.

The WILD Balll has two different usage modes. (More might be added in the future.) Both aim to remind its user of their intention to fall asleep consciously by sounding a buzzer whenever the muscle contraction of the hand that is holding it drops below a certain threshold. It is an old technique to hold something in one hand and let it fall on something that makes a noise, thus waking one up right at the moment where muscle contraction is too weak to hold the object. This technique is seldomly discussed in the lucid dreaming community though and I have found only a handful of reports of people experimenting with or using it. Using an electronic device instead of a heavy object and a noisy underground has some advantages which might overcome the limitations that the classical approach has.

  • The type of sound can be altered in software. The built presented here only provides a simple piezo buzzer. But the design can easily be extended to play more complex sounds or music.
  • The length and volume of the sound can be altered in software, making it easier to tune it to your personal requirements.
  • The device can be used at any sleeping place and does not need to be set up before use when travelling.
  • By using headphones or a speaker pillow a loud alarm sound can be played for the user without disturbing other sleepers in the same room.
  • Obviously it is cooler to do it this way than to rely on simple physics.

Mode 0 imitates the classical approach of letting the object fall when the muscle contraction becomes weak. The alarm sound is triggered when the device is moving at a certain speed or above. Movement is detected in three axes independently. The speed threshold can be simply set in software. If you want to move your hand or otherwise adjust your body during a WILD attempt without triggering the alarm, you can simply squeeze the device, which disables the sound until you let go and only hold it lightly again. For more uses of mode 1, see Ideas/modifications below.

Mode 1 follows a different approach to achive the same result. You steadily squeeze the device during your WILD aatempt. As soon as the pressure drops below a certain threshold the alarm sounds for the defined duration. Right now this a implemented with a binary switch which means the threshold can not be adjusted in software but only changing the the way the switch is built, by using a different pre-manufactured switch or by changing (the hardness of) its surrounding (the ball itself). The switch could be replaced with a preassure sensor to allow more gradual detection of preassure loss.

How to build one

(tba)

Challenges/known problems

(tba)

Getting used to holding the object, alarm sound too loud, getting used to the sound

The code

If you have a device built according to the above pictures then you can use the below Arduino sketch (download .ino file) as it is. Otherwise it should give you an idea of how to program the microcontroller used in your DIY built.

/*
    This is the Arduino sketch for the WILD Ball, a simple device that aids a person in falling asleep more
    consciously and possibly experience waking-initiated lucid dreams.
    More information at: https://steeph.de/projects/wildball/
*/

#include<Wire.h>
const boolean usageMode = 0; /*
    There are two different usage modes:
    0: The alarm is triggered when the device is moved unless the button is pressed. (The button can be pressed
       while adjusting the hand or lying position. When the button is let go the alarm is active again.)
    1: Movements are ignored. The alarm is triggered and will sound for toneDuration milliseconds when the button is not pressed. */
const boolean debugMode = 0; // Print messages to serial port if debugMode is enabled
int buzzerPin = 5;
int buttonPin = 4;
int threshold = 1000; // The smaller this value the more sensitive the device will be to movement
const int MPU=0x68;
int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ;
int toneDuration = 300; // Minimum duration of alarm sound in milliseconds
int toneFrequency = 250; // The frequency of the alarm sound
void setup(){
  Wire.begin();
  Wire.beginTransmission(MPU);
  Wire.write(0x6B);
  Wire.write(0);    
  Wire.endTransmission(true);
  if (debugMode) { Serial.begin(9600); }
  pinMode(buzzerPin, OUTPUT);
  pinMode(buttonPin, INPUT);
}
void loop(){
  if (!usageMode) {
    Wire.beginTransmission(MPU);
    Wire.write(0x3B);
    Wire.endTransmission(false);
    Wire.requestFrom(MPU,14,true);
    AcX=Wire.read()<<8|Wire.read();
    AcY=Wire.read()<<8|Wire.read();
    AcZ=Wire.read()<<8|Wire.read();
    Tmp=Wire.read()<<8|Wire.read();
    GyX=Wire.read()<<8|Wire.read();
    GyY=Wire.read()<<8|Wire.read();
    GyZ=Wire.read()<<8|Wire.read();
  }

  if (debugMode && !usageMode) {
    Serial.print("Accelerometer: ");
    Serial.print("X = "); Serial.print(AcX);
    Serial.print(" | Y = "); Serial.print(AcY);
    Serial.print(" | Z = "); Serial.println(AcZ);
  
    Serial.print("Gyroscope: ");
    Serial.print("X = "); Serial.print(GyX);
    Serial.print(" | Y = "); Serial.print(GyY);
    Serial.print(" | Z = "); Serial.println(GyZ);
    Serial.println(" ");
  }

  if (usageMode) {
    if (debugMode) { Serial.println("Usage Mode 1"); Serial.println(); }
    if (!buttonPressed()) {
      tone(5, toneFrequency, toneDuration);
    }
  } else {
    if (debugMode) { Serial.println("Usage Mode 0"); Serial.println(); }
    if (moved(GyX,GyY,GyZ) && !buttonPressed()) {
      tone(5, toneFrequency, toneDuration);
      if (debugMode) { Serial.println("Ha! You moved!"); Serial.println(); }
    }
  }

  delay(100);
}



boolean buttonPressed() {
  if (digitalRead(buttonPin)) {
    if (debugMode) { Serial.println("Button is pressed."); Serial.println(); }
    return true;
  } else {
    return false;
  }
}

boolean moved (int16_t x, int16_t y, int16_t z) {
  if(x > threshold || y > threshold || z > threshold || x < -threshold || y < -threshold || z < -threshold)
  {
    return true;
  }
  else {
    return false;
  }
}

Ideas/modifications

(tbc)

The device does not have to be placed inside a ball. You can built a case and place the components according to your personal needs. Because it does not have to drop on anything but only move it is also possible to use mode 1 with the device strapped to the hand if you prefer to hold up an arm instead of holding something in your hand. If you usually experience muscle twitches while falling asleep, e.g. in your legs or feet, as many people do, you can also experiment with the device strapped to your foot or leg.

Instead of sounding a buzzer for a pre-defined duration, you can experiment with different signals, be it blinking LEDs a playing an MP3 file from a different device or extension module. By adding a wave module the variety of sounds can be increased so that you can choose the best sound to make you aware quickly without waking you up completely. You yourself probably know best what sound that might be. But as with the rhythm nappping technique, short loud sounds are most likely to lead to a successfull LD induction attrempt.

FILD mode (tba)

Comment via email
Project: mixlog Entry Permalink (edited 2020-03-06) Authors: steeph (370) Categories: Blogs (5) Projects (41) Web Sites (8) incomplete (22) obsolete (4) Languages used: en (255) Topics: Projects → Web Sites → Discontinued (4) edit

I just canceled some domains that I had registered. Among them were the domain names mixblog23.de and mixlog.de. Both of which were once used for a blogging platform of mine that wasn't alive for a long time. But I kept the domains just in case. (I don't know which case that would have been.)

The platform was initially supposed to be called Mixblog, but I couldn't find a free domain name that I liked. So at some point I registered mixlog.de, which by now sounds better and more familiar to me anyway.

The point of mixlog was - apart from me having a website to build and something to learn on - to create personal feed of content from different blogs on that website and other sources (RSS feeds). It could essentially be used as a feed reader in a web browser with the ability to publish stuff on the same site. RSS aggregation wasn't scaling well, so it would have been difficult if many people would have used it as a feed reader for many feeds. But that wasn't its main purpose anyway. So, you could post blog posts, image galleries (which technically were blog posts too) and links to posts on other websites (which imported the content and worked as a repost). You could follow blogs and repost and fav posts from bogs on mixlog and from other blogs as well. Classic blog comments existed too. Pingbacks and RSS feeds were supported as I still liked to think was standard back then.

I saw the platform as like sort of a twitter with fewer members, more features and without contrains (no small character limit, reblogging and following blogs from other websites was supported). When I later learned about tumblr, I started to think of mixlog as like sort of a tumblr with more features and a less professional design and UI. But I don't think tumblr even existed when I stopped working on mixlog.

So why isn't mixlog around anymore? At its peak there were three active users on the platform (not daily active, far from, actually). That included me, a friend who tested it with me in the early development stage and another friend, who tried it out for a short while. Altogether there were four user accounts/blogs. And mine was the only one that showed sings of prolonged motivation to post stuff. So when it became clear to me that nobody but me would be using it I thought it to be overblown for a personal weblog, stopped adding features and eventually took it offline instead of fixing a potential vulnerability of the underlying framework.

I guess this here is just to say: R.I.P., mixlog! You will forever have a place on my backup RAID.

(tba: screen shot)

Comment via email
This SGI Indigo Entry Permalink Authors: steeph (370) Categories: Computers (19) incomplete (22) edit
Comment via email
Movies That Suddenly Change Genre After A While Entry Permalink Authors: steeph (370) Categories: Films (22) incomplete (22) Languages used: en (255) edit

I think that there should be more films that change genre in the middle of their story.

There are hardly any examples for movies that start out with one genre but suffenly change their tone entirely unexpectedly. At least once I would like to see a film that tells a family drama, then suddenly turns into a science fiction piece when somebody discovers a door into a parallel universe or something. Being John Malkovich comes close in a way. And that is part of why I like its weirdness. But it doesn't change it's mood, story telling style or subject matter at all at the time it gets weird.

There is a difference between a movie that changes its genre in the middle and a movie you watch expecting a different genre from what it's actually in. But that can work to give you the same confusing surprise. For example when I watched Victoria (2015) for the first time without knowing anything about it, I expected a mellow love story between a big-city boy and a foreigner new in the city and country. Everything was pointing towards this being the story of the film. And it is. But it's embedded in a crime story with more action than I saw coming. This dichotomy shaped my viewing experience very much, making it a trip where enything could happen and many extreme and unexpected things did happen.

I'll try to make a list of film that are actually split into two different genres. I don't know yet if I will find more than one.

  • Mickibo and Me (2005) - The lighthearted, childlike look at the political and social situation in of the young central characters' surrounding are what makes this story so nice to watch. Even as an adult who knows what's going on, it's easy to dismiss the anguish portrayed and focus on the adventue that the two kids are having. In the end the harsh reality comes too close to the story telling lead character to ignore it anymore. While I'd clearly classify the whole movie as a comedy, the sudden shift in tone for the tragic ending hits all the more and made me cry vewyond the closing credits.
Comment via email
Alternative Operating System: ToaruOS Entry created on 2022-03-29 (edited 2025-08-24) Authors: steeph (370) Categories: Computer (78) Operating Systems (23) Software (52) incomplete (22) Languages used: en (255) Topics: Software → Alternative Operating Systems (18) edit
This entry is referencing the entry 'Alternative Operating Systems'.

ToaruOS

This one I consider one of the more interesting ones. It has a modern, well-design desktop and windows manager. It's user-friendly in that it just start as expected with no need for settings or choices and has an introduction for newcomers. The well-rounded look makes it look very mature. In fact, the first time I booted it I checked that it really isn't "just" a Linux distribution that's trying to hide that fact on the surface. And it isn't. The person who developed ToaruOS over 13 years apparently focused on finishing the part that help create a good first impression before starting other features that might be expected from an OS.

The one feature that makes ToaruOS stand out among other hobbyist operating systems is one of its compositor: Windows can be rotated in any angle by dragging the window's title bar while holding down the ALT key.

Besides the usual UNIX-like command line utilities there are very few apps pre-installed on the live system. Not even a graphical text editor. There is a package manager. But since the NIC of my laptop is not supported, I couldn't try it out.

Overall this feels like a very promising project. An OS that is usable right now and would benefit the most by getting more apps written for or ported to. ALl tho more disappointing that the sole developer has abandoned the project recently.

Comment via email
Alternative Operating System: Snowdrop OS Entry created on 2022-03-29 Authors: steeph (370) Categories: Computer (78) Operating Systems (23) Software (52) incomplete (22) Languages used: en (255) Topics: Software → Alternative Operating Systems (18) edit
This entry is referencing the entry 'Alternative Operating Systems'.

Snowdrop OS

🚧

Comment via email
Go To Navigation Page
Show/Hide Navigation
Mastodon