Who wants a cheap, simple, Arduino-based LED controller?

a question...
There are free pins on the Atmega328 on the board typhon?

I would like to update this controller with fan control for DS18B20.
 
There is only one totally "free" pin on the AVR. In the 1.0 hardware I broke it out to a header pin next to the PWM headers. You could use that for a one wire network to read temps from a DS18B20.
 
There is only one totally "free" pin on the AVR. In the 1.0 hardware I broke it out to a header pin next to the PWM headers. You could use that for a one wire network to read temps from a DS18B20.
 
I have this board and has no free pins! you can give your board?
 

Attachments

  • typhon alt.jpg
    typhon alt.jpg
    110.5 KB · Views: 5
Then I'm assuming SPLC780D is HD44780 compatible. Good to know. I am surprised they don't come out and say that, since the HD44780 seems to be the name people recognize.


I have a TC1604A-01 display, and it uses the SPLC780D1 controller. Although it works fine in parallel mode and LiquidCrystal.. the 3rd and 4th lines start at 5th column.. unless address is stated at (-4,2) or (-4,3). It's "HD44780 compatible".. but it also doesn't work with the i2clcd backpack.. garbled text.

Will be getting an actual HD44780 display from AdaFruit instead.


But "trying" to play along with this project, and I'm getting errors.. thinking library issues...

It originally said no Wiring.h. Googling, someone suggested copying the Wiring.h from the arduino/hardware/cores directory.. so I copied the file from there to the Button library directory.

Now...

Code:
/home/spuzzum/arduino-0018/libraries/Button/Wiring.h:69: error: "˜uint8_t' does not name a type

/home/spuzzum/arduino-0018/libraries/Button/Wiring.h:70: error: "˜uint8_t' does not name a type

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp: In constructor "˜Button::Button(uint8_t, uint8_t)':

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp:41: error: "˜bitWrite' was not declared in this scope

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp: In member function "˜bool Button::isPressed()':

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp:87: error: "˜bitRead' was not declared in this scope

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp:87: error: "˜bitWrite' was not declared in this scope

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp: In member function "˜bool Button::wasPressed()':

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp:158: error: "˜bitRead' was not declared in this scope

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp: In member function "˜bool Button::stateChanged()':

/home/spuzzum/arduino-0018/libraries/Button/Button.cpp:168: error: "˜bitRead' was not declared in this scope


Using a more recent version of arduino.. arduino-0023 (linux) gives..

Code:
sketch_dec07a:85: error: "˜PULLDOWN' was not declared in this scope
sketch_dec07a:86: error: "˜PULLDOWN' was not declared in this scope
sketch_dec07a:87: error: "˜PULLDOWN' was not declared in this scope
sketch_dec07a:88: error: "˜PULLDOWN' was not declared in this scope


So sticking with arduino-0018... :D


I have the Button and EEPROMVar libraries installed ok.. would error on those otherwise. Are you guys using a modified Button library? I grabbed the one from the link in the typhon script.. is there something else I'm missing?
 
I can't tell what you're missing but it does look like a library issue. I would run a "hello world" sketch against each library in turn and just see if they compile.
 
I can't tell what you're missing but it does look like a library issue. I would run a "hello world" sketch against each library in turn and just see if they compile.

Thanks DWZM...


ok.. feeling like a noob :P

Seems I "didn't" have EEPROMVar in my arduino-0018 library directory.. only in my arduino-0023 directory... doh!

Added to the 0018 directory, now it's just 1 error...

Code:
error: "˜PULLDOWN' was not declared in this scope

Looking at the Button.cpp.. it has BUTTON_PULLDOWN.. tried that in the script..

Code:
error: "˜BUTTON_PULLDOWN' was not declared in this scope


That wasn't it. Did I put Wiring.h in the right place? I'm guessing it would error on that if it was though.


And LiquidCrystal works fine...

etphonehome-2.jpg
 
ALAS!!!


A few issues... the script calls "Wiring.h" but it's actually called "wiring.h". Changed in the script. I also directed the Button.cpp to the arduino cores directory...
Code:
#include "/home/spuzzum/arduino-0018/hardware/arduino/cores/arduino/wiring.h"


Then it gave the "PULLDOWN" error again.. changed to "BUTTON_PULLDOWN"...
Code:
// create the buttons
Button menu     = Button(12,BUTTON_PULLDOWN);
Button select   = Button(13,BUTTON_PULLDOWN);
Button plus     = Button(14,BUTTON_PULLDOWN);
Button minus    = Button(15,BUTTON_PULLDOWN);


Success!!
Code:
Binary sketch size: 16208 bytes (of a 30720 byte maximum)



Now I can play.............. :D
 
tweeking the sketch

tweeking the sketch

Hey all,

I want to alter the sketch so that the "On" and "%" overrides relate to the channel's MAX settings rather than full power. I think the following modification should work, but would appreciate it if more experienced eyes would confirm:

}
void ovrSetAll(int pct){
analogWrite(oneLed,map(pct,0,100,0,oneMax));
analogWrite(twoLed,map(pct,0,100,0,twoMax));
analogWrite(threeLed,map(pct,0,100,0,threeMax));
analogWrite(fourLed,map(pct,0,100,0,fourMax));
}​


I'd also like a add an additional override state of "actinic only" but haven't dug into what that might entail.

Is it feasible to have a very short ramp up/down (1 or 2 seconds) between these override states? This would give the controller a more polished feel, and help avoid startling the fish. I have a feeling it may be complicated to implement.

Thanks,
Mickey
 
There is only one totally "free" pin on the AVR. In the 1.0 hardware I broke it out to a header pin next to the PWM headers. You could use that for a one wire network to read temps from a DS18B20.

ok ...
One pin free is analog-in and it can only use to measure temperature with DS18B20.
if we use a DS18B20 to operate the fans we want to port digital I\O with relais or a PWM, but this is not available!
alternative solution is to change AVR ATMEGA328 with a 1280 or 2560.
must also change the design of the board, while the sketch remains the same, changing only the name at the pin.
is that correct?
 
You could also slave another 328 for more pins.. I've seen articles on instructables showing how called "Core2Duino". Can link as many as you can code for.. within reason.
 
You guys are thinking way too complicated for what he's trying to achieve.

Set up the free pin as a one-wire port. You now have one-wire, I2C, and serial available. Put a DS18B20 on the one-wire port and use it to sense temperature. Find a dedicated fan controller IC (or a generic PWM generator) that can work on one-wire or I2C and use that to control the fan. I don't think you need (or want) to switch AVRs or slave a second just to accomplish this specific goal.

If you DID want to break out a second AVR, you could just use another Typhon board and only populate the portions you need (i.e. you'd leave the RTC, buttons, and LCD header off.)
 
You guys are thinking way too complicated for what he's trying to achieve.

Set up the free pin as a one-wire port. You now have one-wire, I2C, and serial available. Put a DS18B20 on the one-wire port and use it to sense temperature. Find a dedicated fan controller IC (or a generic PWM generator) that can work on one-wire or I2C and use that to control the fan. I don't think you need (or want) to switch AVRs or slave a second just to accomplish this specific goal.

If you DID want to break out a second AVR, you could just use another Typhon board and only populate the portions you need (i.e. you'd leave the RTC, buttons, and LCD header off.)


True.. more work than benefit in the long run.

But if you wanted to free up 3 pins right away... convert the script for an ADC button pad that only uses 1 line for "all" buttons...

LCDshield.jpg


Code:
/*
  The circuit:
 * LCD RS pin to analog pin A1
 * LCD Enable pin to analog pin A2
 * LCD D4 pin to analog pin A3
 * LCD D5 pin to digital pin 12
 * LCD D6 pin to digital pin 8
 * LCD D7 pin to digital pin 7
 * LCD BL pin to digital pin 10 <-- not connected
 * KEY pin to analog pin A0
 */

#include <LiquidCrystal.h>

LiquidCrystal lcd(15, 16, 17, 12, 8, 7);

char msgs[5][16] = {"Right Key OK ",
                    "Up Key OK    ",               
                    "Down Key OK  ",
                    "Left Key OK  ",
                    "Select Key OK" };

int adc_key_val[5] ={50, 200, 400, 600, 800 };
int NUM_KEYS = 5;
int adc_key_in;
int key=-1;
int oldkey=-1;

void setup()
{
  pinMode(A1, OUTPUT); // analog 1 to digital 15
  digitalWrite(A1, HIGH);
  pinMode(A2, OUTPUT); // analog 2 to digital 16
  digitalWrite(A2, HIGH);
  pinMode(A3, OUTPUT); // analog 3 to digital 17
  digitalWrite(A3, HIGH);
  pinMode(A4, OUTPUT); // analog 4 to digital 18
  digitalWrite(A4, HIGH);
  
  lcd.clear(); 
  lcd.begin(16, 2);
  lcd.setCursor(0,0); 
  lcd.print("ADC key testing"); 
}

void loop()
{
  adc_key_in = analogRead(0);    // read the value from the sensor 
  key = get_key(adc_key_in);  // convert into key press
 
  if (key != oldkey)   // if keypress is detected
   {
    delay(50);  // wait for debounce time
    adc_key_in = analogRead(0);    // read the value from the sensor 
    key = get_key(adc_key_in);    // convert into key press
    if (key != oldkey)    
    {   
      lcd.setCursor(0, 1);
      oldkey = key;
      if (key >=0){
           lcd.print(msgs[key]);              
      }
    }
  }
 delay(100);
}

// Convert ADC value to key number
int get_key(unsigned int input)
{
    int k;
   
    for (k = 0; k < NUM_KEYS; k++)
    {
      if (input < adc_key_val[k])
 {
            return k;
        }
   }
   
    if (k >= NUM_KEYS)k = -1;  // No valid key pressed
    return k;
}

The LCD pinout can be changed to whatever you need.. this was just for testing. There's more examples here...
Code:
http://www.nuelectronics.com/estore/index.php?main_page=project_lcd
http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_(SKU:_DFR0009)
 
Yes, the pre-1.0 version of the hardware was released without an NC clause on the license. No one participating in this thread has any involvement with that particular vendor and this thread is not intended to support or promote the version that they commercially sell (I did not know they were selling it until after it appeared on their web store). The original intent of this project was to get people to pull out their soldering irons and build something useful themselves.
 
Can the project be re-released/updated with the clause? If not perhaps we should start a new thread (and oh what a pain - find a new name). Is it worth it?
 
Yes, the pre-1.0 version of the hardware was released without an NC clause on the license. No one participating in this thread has any involvement with that particular vendor and this thread is not intended to support or promote the version that they commercially sell (I did not know they were selling it until after it appeared on their web store). The original intent of this project was to get people to pull out their soldering irons and build something useful themselves.


That sucks...

I'm a die hard DIY'er, and I know the effort you put into this.. so seeing that was kind of an insult to the DIY community.
 
Back
Top