News

moodlite - Coming soon


Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Coolstuff55

Pages: 1
1
moodlite Software / Help to connect
« on: November 16, 2019, 03:33:40 AM »
Hi guys,
I've been trying for many weeks with no success. I have moved to V2 as many people have had more success. The first time it is run, I only see "ESP30xxxx" in my wifi list, but can connect to it with the password "Moodlite". The page then displays for me to input my Wifi details which I do. But it wont connect to my Wifi, and debug shows
Code: [Select]
Wifi status: 6
--- initWiFi - End ---
I have tried many static IP addresses and DHCP but no luck. Any help would be much appreciated.
Also, I have some experience in C programming and networking, so its not all totally new to me.
Cheers,
Matt

2
moodlite Software / Re: Rhythm function and PCB update
« on: October 10, 2019, 03:42:44 AM »
Sweet as. My components arrived this week for the PCB, so I should get it built up in the next week and then I can have a play too.
I also discovered mDNS which would be cool to add to the code too. It would mean instead of typing an IP address, you could just type "moodlite.local" and it will come up. Looks quite simple too. More info here -> https://tttapa.github.io/ESP8266/Chap08%20-%20mDNS.html

Cheers
Matt

3
moodlite Software / Re: Rhythm function and PCB update
« on: October 05, 2019, 09:09:28 AM »
Sweet, just attached as an image for now. Let me know if you need anything more.
On the right side of the schematic is the reset switch, PIR sensor and LED output (what exactly does the rst switch do in the software?).
On the left side is the microphone and amplifier circuit. The opamp used is the common LM386 audio amplifier. R5 is a pot that is used to adjust the volume if necessary. It should be adjusted once at setup and then left. C3 sets the gain of the amplifier. The 10uF that I've put in there sets it to its max of 46dB, or x200. This should be fine for our application. If necessary, this can be adjusted to x50 or x20 with different values.
Hopefully the components all arrive this week, so I can put it together and test some code.
I think that's all... If there are any details I've missed or any questions feel free to ask.
Cheers,
Matt.

4
moodlite Software / Re: Rhythm function and PCB update
« on: October 04, 2019, 11:12:53 AM »
Cheers! I have no idea if it will work either, its just a simple mic and amplifier circuit. I'll post the schematic tomorrow, whats the best format for you? I designed in Altuim. I would really appreciate it if you could help with the code side, I think it would make an awesome feature.

Matt

5
moodlite Software / Re: Rhythm function and PCB update
« on: October 03, 2019, 10:31:34 PM »
Forgot to add PCB images... attached.

6
moodlite Software / Rhythm function and PCB update
« on: October 03, 2019, 11:27:54 AM »
Hi all,
I have received my PCBs back and are ready to assemble. I have attached some photos below.
I have also added a microphone circuit with a small amplifier connected to the analog pin of the ESP8266,
with the hope of adding a rhythm function later.
I have found a piece of code online called soundbracelet that looks great for this task.
A demo of the code can be seen here :
&feature=youtu.be

I have tried adding the code to a moodlite function, but my arduino coding is relatively limited.
Heres what I've got so far. Any help would be much appreciated. MIC_PIN etc is defined on the main page
Cheers,
Matt

Code: [Select]
void three_sin()  //just overwriting an exsisting function as a test
{
  #define DC_OFFSET  0                                         // DC offset in mic signal - if unusure, leave 0
                                                                // I calculated this value by serialprintln lots of mic values
  #define NOISE     30                                         // Noise/hum/interference in mic signal and increased value until it went quiet
  #define SAMPLES   60                                          // Length of buffer for dynamic level adjustment
  #define TOP (iNrOfLeds + 2)                                    // Allow dot to go slightly off scale
  #define PEAK_FALL 10                                          // Rate of peak falling dot
 
  byte
    peak      = 0,                                              // Used for falling dot
    dotCount  = 0,                                              // Frame counter for delaying dot-falling speed
    volCount  = 0;                                              // Frame counter for storing past volume data
  int
    vol[SAMPLES],                                               // Collection of prior volume samples
    lvl       = 10,                                             // Current "dampened" audio level
    minLvlAvg = 0,                                              // For dynamic adjustment of graph low & high
    maxLvlAvg = 512;


 
  uint8_t  i;
  uint16_t minLvl, maxLvl;
  int      n, height;
   
  n = analogRead(MIC_PIN);                                    // Raw reading from mic
  n = abs(n - 512 - DC_OFFSET);                               // Center on zero

  Serial.println(n);
 
  n = (n <= NOISE) ? 0 : (n - NOISE);                         // Remove noise/hum
  lvl = ((lvl * 7) + n) >> 3;                                 // "Dampened" reading (else looks twitchy)
 
  // Calculate bar height based on dynamic min/max levels (fixed point):
  height = TOP * (lvl - minLvlAvg) / (long)(maxLvlAvg - minLvlAvg);
 
  if (height < 0L)       height = 0;                          // Clip output
  else if (height > TOP) height = TOP;
  if (height > peak)     peak   = height;                     // Keep 'peak' dot at top
 
 
  // Color pixels based on rainbow gradient
  for (int k=0; k<iNrOfLeds; k++) {
    if (k >= height)   crgbLeds[k].setRGB( 0, 0,0);
    else crgbLeds[k] = ColorFromPalette(crgbCurrentPalette, 255, 255);
  }
 
  // Draw peak dot 
  if (peak > 0 && peak <= iNrOfLeds-1) crgbLeds[peak] = CHSV(map(peak,0,iNrOfLeds-1,30,150), 255, 255);
 
  addEffect();

// Every few frames, make the peak pixel drop by 1:
 
    if (++dotCount >= PEAK_FALL) {                            // fall rate
      if(peak > 0) peak--;
      dotCount = 0;
    }
 
  vol[volCount] = n;                                          // Save sample for dynamic leveling
  if (++volCount >= SAMPLES) volCount = 0;                    // Advance/rollover sample counter
 
  // Get volume range of prior frames
  minLvl = maxLvl = vol[0];
  for (i=1; i<SAMPLES; i++) {
    if (vol[i] < minLvl)      minLvl = vol[i];
    else if (vol[i] > maxLvl) maxLvl = vol[i];
  }
  // minLvl and maxLvl indicate the volume range over prior frames, used
  // for vertically scaling the output graph (so it looks interesting
  // regardless of volume level).  If they're too close together though
  // (e.g. at very low volume levels) the graph becomes super coarse
  // and 'jumpy'...so keep some minimum distance between them (this
  // also lets the graph go to zero when no sound is playing):
  if((maxLvl - minLvl) < TOP) maxLvl = minLvl + TOP;
  minLvlAvg = (minLvlAvg * 63 + minLvl) >> 6;                 // Dampen min/max levels
  maxLvlAvg = (maxLvlAvg * 63 + maxLvl) >> 6;                 // (fake rolling average)

}


7
moodlite Design / Re: Nanoleaf like PCBs
« on: September 12, 2019, 01:32:38 PM »
I'm brand new to this forum, but have been looking into nanoleaf-like modular lights for some time. After many hours of research and trials, I found the ESP8266 board, perfect, followed by the WS8212B LEDs. Those two led me to here, which is exactly what I was after. Anyway, I am an electrical engineering student, and I have learnt schematic and PCB design, using the professional software Altuim. I'm not exactly sure what you are asking for, so some more specifics would be good, but I may be able to help. I am in the process of designing a PCB for my own project, however the power module case will be a different design as I want some different features and to reduce the size. My pcb will hopefully have include: A power input socket, a usb input socket (to change code without opening case), a switch, a motion sensor, and a microphone. I will let you know how I get on. Sorry for the long post! Cheers.

Pages: 1

SMF spam blocked by CleanTalk