Show Posts
Pages: [1] 2 3
1  Using Arduino / Project Guidance / Re: Problem with PushButton on: November 19, 2013, 06:12:29 pm
I think the problem is with the breadboard. I placed a temp sensor where previous not working button was, and it did not work too. Placed near where buttons are now, it works. Now I have to figure out what's wrong with the breadboard smiley
2  Using Arduino / Project Guidance / Re: Problem with PushButton on: November 19, 2013, 10:12:32 am
What model lcd are you using, can you provide a link or picture?

I am using a standard HD44780 black and green LCD + LCM1602 A1 A2 A3 I2C backpack converter.


What does the serial monitor print? Does it show the correct state of button A, or not?
A state is wrong: I have added delay to look carefully at serial monitor. It shows two lines each second: first one is A state, second is B state. When B is unpressed, it's always 0; when pressed becomes 1. A values float between 0 and 1 as I do nothing. If I push A button, nothing happens. If I keep pressed B, it shows always 1; if I keep pressed A, it keeps floating between 0 and 1.

Are you SURE the 10K resistor(s) are connected properly? Doublecheck! It seems like you have a floating input picking up noise...
I am sure. They are connected in the exact same way, only difference being button A connected to pin 4, button B pin 5. I have tried to swap components: wires, buttons, 10k resistors, between A and B circuit. I have changed button and resistor (I have many). Nothing matters: B works as expected, A does not.
Also, I have tried to swap pins, still B circuit works, A doesn't. Tried to connect A to pin 9 or 11, nothing happens. B circuit on ) and 11 works well.
Powered by PC USB, Arduino Micro.
http://arduino.cc/en/Main/arduinoBoardMicro

EDIT
I don't know why, but I take it as a general rule from now on: disassembled buttons circuit, reassembled in exact same way, with same components, now it works.
Maybe I was unluky with the breadboard (maybe previous hole was broken, if that makes any sense...)
Now everything works as expected, on LCD also is shown which button is pressed, even if both are.
Thanks for the support.
3  Using Arduino / Project Guidance / Problem with PushButton on: November 18, 2013, 05:22:39 pm
Hello everyone
I am having problems here with something that is really simple. I have 2 push buttons and an Arduino Micro.
this is the sketch
Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

const int buttonA = 4; // button A wired to pin 4
const int buttonB = 5; //button B wired to pin 5


//                                  addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address, I have an I2C packpack converter

int buttonAstate = 0;  //declaring button state variables
int buttonBstate = 0;

void setup() 
{
  Serial.begin(9600);  // Used to check activity

  lcd.begin(16,2);         // initialize the lcd for 16 chars 2 lines and turn on backlight
  pinMode(buttonA, INPUT);
  pinMode(buttonB, INPUT);
// ------- Quick 3 blinks of backlight  -------------
  for(int i = 0; i<3; i++)
  {
    lcd.backlight();
    delay(250);
    lcd.noBacklight();
    delay(250);
  }
  lcd.backlight(); // finish with backlight on 

  lcd.setCursor(1,0); //Start at character 2 on line 0
  lcd.print("Press A or B");
  lcd.setCursor(0,1);
}

void loop() 
{
  buttonBstate=digitalRead(buttonB);  //check if button B is pressed
  Serial.println(buttonBstate);  //debug console check, it shows 0 if not pressed, 1 if pressed, correctly
  if (buttonBstate == HIGH){
    lcd.setCursor(15,1);  //writes which button is pressed, B here
    lcd.print("B");}
  else {
    lcd.setCursor(15,1);  //if released or not pressed, clear
    lcd.print(" ");}
  buttonAstate=digitalRead(buttonA);  //check if A is pressed, but it doesnt work
  Serial.println(buttonAstate);  //it changes between 0 and 1 all by itself
  if (buttonAstate == HIGH){ //if I press the button, nothing happens but it keeps blinking the A on bottom left corner
    lcd.setCursor(0,1);
    lcd.print("A");}
  else {
    lcd.setCursor(0,1);
    lcd.print(" ");}
    delay(1000);  //added for debug
}


Button B works as expected: when pressed, on bottom right corner of LCD a B letter appears, and disappears when not pressed.
Button A doesn't work: A letter keeps blinking (very fast with no delay) and nothing happens when button is pressed.
I have written buttonA code first, then pasted and changed to buttonB.
I have wired them the same way, as suggested on http://arduino.cc/en/Tutorial/Button, just doubling it.
I don't understand what is wrong...
4  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 24, 2013, 08:32:44 am
I mosfet non scaldano niente, ad esempio usa un IRLZ44, costano meno dei relè, sono più piccoli e più versatili, puoi variare la potenza dei tuoi led tramite pwm cosa che il relè non puoi fare, non c'è nessun motivo per usare il relè
Il relé mi serve come switch sulla 220 AC di casa, che io sappia il mosfet non può andare su AC. Inoltre il PWM non mi serve assolutamente a nulla in questo progetto smiley-wink

per farti un'idea sul dissipatore per il led osserva una lampada da 3watt a led con 3 led da 1 watt, spero che i tuoi led siano già montati su metal core altrimenti se è su FR4 sei costretto ad usare una ventola
Questo come faccio a capirlo? Sui led che ho comprato c'è solo scritto "with star PCB"
5  Using Arduino / LEDs and Multiplexing / Re: High Power LEDS Arduino controlled on: September 24, 2013, 08:30:06 am
I know setting up some series would help me save some money, but since I plan to "sell" some devices like this, I cannot afford the possibility to have one series of led not lighting up because only 1 may fail.
6  Using Arduino / LEDs and Multiplexing / Re: High Power LEDS Arduino controlled on: September 23, 2013, 08:02:09 pm
Ok, I'll do my researches.
But I need to ask one thing more: if I wanted to use AC/DC drivers, directly wired to 240 VAC, all in parallel and 1 for every led, would also the drivers need a heat sink?
If doing so, I would use relay modules instead of mosfets.
7  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 23, 2013, 07:58:52 pm
Si, certo. Sensore di temperatura e umidità. Non l'ho specificato poiché non mi sembrava inerente il problema.
A proposito del "problema", stavo riflettendo... Se io utilizzassi dei driver AC/DC direttamente attaccati alla corrente di casa, tutti in parallelo, pilotati a monte da relé al posto dei mosfet, questi si scalderebbero molto?
In caso di utilizzo di mosfet, è consigliato applicarvi un dissipatore?
A proposito di dissipatori, quanto dovrebbe essere grande quello per i led?
smiley
8  Using Arduino / LEDs and Multiplexing / Re: High Power LEDS Arduino controlled on: September 23, 2013, 11:40:05 am
I don't know since I still don't know my shifts, but I'd really like!

Talking about mosfets, do they need also a heat sink?

I was thinking about buying 240V AC/DC led drivers . Would they heat?
9  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 23, 2013, 11:38:06 am
Mi sono documentato sulle esigenze che hanno e sul posto dove crescono, quindi vorrei fare degli esperimenti per vedere se riesco a ricreare le condizioni originarie (o vagamente simili) dell'Arizona
10  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 22, 2013, 08:52:30 am
Scaldano così tanto?? Non ne ho mai usati prima di questi led, quindi sono totalmente ignorante a riguardo.
11  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 22, 2013, 08:14:45 am
http://www.ebay.it/itm/181110358020?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649
Un dissipatore così può bastare per un led?
12  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 22, 2013, 06:47:11 am
Ho predisposto un piccolo dissipatore per ogni led, sebbene siano star mounted.
Devo dire che, quando ho aperto questa discussione, avevo una MINIMA idea di cosa fare. Ora sono abbastanza confidente di aver capito (abbastanza bene) le opzioni che ho a disposizione. Per questo ringrazio tutti moltissimo, grazie per aver perso tempo a spiegarmi tutto.
Giusto per curiosità, non vorrei risultare invadente, ma come siete arrivati ad accumulare conoscenza in questi settori? Lavoro, studio o passione personale?
13  Using Arduino / LEDs and Multiplexing / Re: High Power LEDS Arduino controlled on: September 21, 2013, 05:04:32 pm
Thank you very much Mike, now I know a bit more about mosfets. I hope to find a good way to wire leds and power source: many possible ways, but I need to understand the differences and pick the right one smiley
14  International / Hardware / Re: Alimentare High Power LEDs controllati da Arduino on: September 21, 2013, 05:01:55 pm
L'idea di mettere un singolo driver per ogni singolo led è così tanto malsana? Tutti in parallelo e governati con 5 mosfet esattamente come ha detto paulus (che era ciò che avevo in mente), ognuno col suo regolatore di corrente.
Preferisco avere la certezza che se si brucia un led, si brucia un solo led; poiché alcuni di questi non costano proprio poco per essere dei semplici led, vorrei garantir loro la maggior autonomia possibile.
15  Using Arduino / LEDs and Multiplexing / Re: High Power LEDS Arduino controlled on: September 21, 2013, 10:57:33 am
As far as I know, also the N in IRF540N means that the mosfet can be turned on with arduino's 5v
Pages: [1] 2 3