Show Posts
Pages: [1] 2 3 ... 304
1  Using Arduino / Sensors / Re: Rotary encoder - values aren't set to "notches" on: Today at 02:28:18 pm
Have a look at my "tutorial"- I use the word loosely....

The snippet from a datasheet bears out what you say, and the serial output and the LEDs agree with each other. That is, the switches A and B are off at a detent then as you turn CW, A goes on before B does- that's how it knows which way the knob is turning, If you went CCW from that first detent, B goes on before A.

As you turn the knob sloooowly between detents, you can see the LEDs react to the changes in A and B.

I don't know if you have the datasheet for your actual model, but I suspect it will have a "wave diagram" showing exactly how the outputs change as you turn the knob in either direction.


edit.... all of which might be irrelevant for your grey code device  smiley-confuse
2  Using Arduino / Project Guidance / Re: Arduino motor control. on: Today at 01:36:43 pm
Your circuit as shown is incomplete anyway. Regardless of where the motor power comes from, it has to go to Vcc2 which is pin 8, lower left. The power that you have to the chip, top right pin 16 is Vcc1 which is the logic supply to run the chip.

Might be an idea to check the chip datasheet. The L293 which is pin-for-pin functionally the same as that SN754410 loses a couple of volts. I'm not sure if that one suffers the same. But if it does, it means you have to throw 5 or so in, to get 3 out.
3  Using Arduino / General Electronics / Re: Arduino gets restart when operating 12V Solid State Relay on: Today at 08:17:07 am
I have drawn only that part of my schematic where i am getting problem..

And what about the possibility (speculation) that all of the other items draw just too little current to cause a problem, and when you switch the relay, that takes it over some limit so the board resets?

If you go to the doctor with a cough (the relay) almost the first thing he does is auscultate your chest (the rest of the circuit).....
4  Using Arduino / Motors, Mechanics, and Power / Re: Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks on: Today at 08:11:32 am
Ha, that looks great. Might be a good alternative if I can find one for the UK.
Is that not just using the same type of relay module inside?

I'm pretty sure that's all it is, done up in a fancy (read as: safe, certified, insurance approved (I seem to remember it's UL)) box.

Almost certain there has been discussion about the lack of a 220 version or equivalent which is a shame.
5  Using Arduino / Motors, Mechanics, and Power / Re: Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks on: Today at 07:54:17 am
Subject:

Quote
Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks

If you have to ask, you are.

Great input mate

I'm assuming that's sarcasm. In fact I believe it is great input, so thanks: no matter how many questions you ask here, and how many answers you get (assuming the answers are correct, and I don't doubt that many members here do know about this stuff), you are endangering human life.

My first reaction was that "hmmm, at least he's asking, that's good", but on reflection I think asking a few questions here is actually a case of a little knowledge being more dangerous than none.... at least with no knowledge, and assuming you know you know nothing, you probably know not to mess with it.

I can't recall, nor can I be arsed to look, if you said you're in a 110 or 220 VAC part of the world. If 110, get a https://www.adafruit.com/products/268 ... I don't think they come in 220.

edit... 220v, right, so no powertail. Some time back there was a discussion pondering whether there was a similar item in 220 but afaik, there's nothing. Using a device like that, apart from simple safety, keeps the user on the right side of the law and insurance etc.
6  Using Arduino / Motors, Mechanics, and Power / Re: Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks on: Today at 07:34:46 am
It's not called "Live". It's called either "Line" or "Hot".

In UK-topia they do call it "Live", that's their term.

I grew up in the UK late 50s / early 60s and I'm certain my Dad called it LINE...  He had done his apprenticeship in the 30s in His Majesty's RAF.
7  Using Arduino / General Electronics / Re: Arduino gets restart when operating 12V Solid State Relay on: Today at 07:27:54 am
hello everyone,

I have attached schematic of my circuit in this post. Please suggest me what's wrong.

Ok well I see pin 1 switching the relay, but what about the solenoids and what do the buttons do? What sensors?

Quote
I am using 16x2 LCD (6 pins), memory card (4 pins), buttons (4 pins), 2 solenoid pin, 3 pin for sensor so  have only one pin left to use,i.e.,digital pin 1
8  Using Arduino / Project Guidance / Re: Debugging on: Today at 07:10:27 am
Good incentive to get code "right first time"  smiley-cool
9  Using Arduino / Project Guidance / Re: Debugging on: Today at 06:54:25 am
Ah ok, that could be what he meant, yep.
10  Using Arduino / Motors, Mechanics, and Power / Re: Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks on: Today at 06:51:46 am
Subject:

Quote
Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks

If you have to ask, you are.
11  Using Arduino / Project Guidance / Re: Debugging on: Today at 06:46:09 am
Not sure exactly what you mean: the serial conn is exactly what you need.... the common approach is to use Serial.print(variablename) and Serial.print("some helpful text") to give you feedback on the serial monitor.

You can see what the variables are up to, and the text can tell you where you are in the flow... eg you can see which branch in an if/else or case is being actioned, has setup() finished, are you back at the top of loop(), etc etc

It's not ideal, by any means, but it works.....

edit....  Another approach, if you have spare pins, is to have some LEDs going on or off to indicate what's happening inside.
12  Using Arduino / Sensors / Re: PIR Sensor: LED keeps blinking non-stop although no detection on: Today at 04:00:09 am
Er , Generally speaking, there are 2 protentiometers on the back of the module,  to adjust the duration time and sensitivity.

It's not "generally speaking" at all.... mine doesn't, for example. Mine has neither pots nor jumpers to set the mode.

It depends entirely on how the manufacturer designs the raw sensor into a module.
13  Using Arduino / Sensors / Re: Temperature & Gas Sensor on: Today at 02:39:52 am
That depends what sensors you have in mind....
14  Using Arduino / Project Guidance / Re: Robot not turning anymore on: Today at 01:30:28 am
This code does a toggle from a momentary switch.

The switch I have is really bouncy: invariable gives 2-3 clicks for the price of 1 so I debounced it in software.

Each click toggles the LED on=>off or off=>on.

Code:
// simple toggle
// switch to ground from pin, internal pullup
// switch is debounced in sw with bounce2 library
// lines marked //** debounce are to do with debouncing
// comment out or delete those lines if not using debouncing
// and uncomment the line marked //** uncomment me.

#include <Bounce2.h> //** debounce

byte buttonPin=2;
byte ledPin=13;

byte ledState = 0;
byte buttonState = 0;
byte lastButtonState = 0;

Bounce dbbuttonPin = Bounce(); //** debounce

void setup()
{
  pinMode(buttonPin, INPUT_PULLUP);
  
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);
  
  dbbuttonPin.attach(buttonPin); //** debounce
  dbbuttonPin.interval(5); //** debounce

  
}

void loop()
{
  dbbuttonPin.update(); //** debounce
  buttonState=dbbuttonPin.read(); //** debounce
  //buttonState = digitalRead(buttonPin); //uncomment me if not using s/w debounce.
  
  if (buttonState != lastButtonState) //switch changed
  {
    if (buttonState == 0) //0= pressed becuse of pullups ("active low")
    {
      ledState = !ledState; //changed and pressed => toggle led
    }
  }
  
  digitalWrite(ledPin, ledState);
  lastButtonState = buttonState;
  
}
 
  
  
  
15  Using Arduino / Programming Questions / Re: Global Variable Not Initializing? on: August 31, 2014, 11:43:19 pm
Quote
by the time my serial console box opened, the menu had already been "shown"

Hmmmm.... opening the console resets the board though, so the whole thing runs from the top anyway.

(Unless you're not using the IDE's console.... but you say you are.)

Quote
I am looking at the serial monitor on the Arduino IDE
Pages: [1] 2 3 ... 304