Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Nederlands / Re: IRremote.h library werkt n...
Last post by MAS3 - Today at 04:12 pm
Graag niet een hele post quoten in de eerstvolgende reply AUB.

De laatste regel die sterretje schreef is het antwoord op wat je je afvraagt.
Het heeft niets met eerder of later starten van een timer te maken.
12
Project Guidance / Re: Two H-Bridges for one moto...
Last post by sterretje - Today at 04:10 pm
@Jiggy-Ninja; thanks for one of the most detailed explanations that I have seen in a long time. Please consider the below track layout.

Code: [Select]

                               [Z]     [Y]     [X]     [W]
                            +-------|-------|-------|------- [3]
                           /
                        ---
                        /
[1] -------|-------|---+---|-------|-------|-------|------- [2]
      [A]     [B]     [C]     [D]     [E]     [F]     [G]


There are two trains:
1) train AA moving from [1] to [2]; let's assume that section A's module provides the PWM for the full path through the multiplexers in the consecutive modules ([A] .. [G])
2) train BB moving from [3] to [1]; let's assume that section W's module powers that path [up to Z] through the ([W] .. [Z]).

The train BB coming from [3] will stop in [Z] to let the train AA from [1] pass the turnout. Once the train AA from [1] has passed, we now need to supply PWM from [Z] [or from [W] through [X], [Y] and [Z]] to [C], [B] and [A] though their multiplexers for train BB to continue it's route. However the multiplexers of [A], [B] and [C] are currently in use to provide PWM to the train from [1] that is somewhere in [D] or [E] or ... and can not be used for this purpose.

To overcome this, the train from [1] should receive the PWM signal from one of the sections after the turnout; [D] or [G] are the most likely candidates. This allows to free the controller of each section from its current duty; once the train has left [A], it no longer has to pass the PWM from [B] to the track, same when the train has left [B] and so on.

So it's now clear that logically the start section can not provide the PWM for the path; let's pick the end section [G] [for train AA from [1] to [2] and [A] for the train BB moving from [3] to [1]. In which case we have the problem that while train AA is still in [A], [B] or [C] we can not get the PWM signals routed to [Z], {Y], [X] and [W]. So we can't have two trains moving at the same time till the train AA has cleared the sections [A], [B] and [C], something that one actually does not want.

So the end section is the wrong choice. Let's try [D] and [Z] as the sections that provide the PWM signals. Train AA from [1] to [2] can freely go and train BB from [3] to [1] can freely go (up to [Z]). Both will release the sections that they have passed. Once the train AA from [1] to [2] has passed the turnout, the signal from [Z] will be routed to [C], [B] and [A]. Note that section C requires a more extended mutiplexer to connect [B] to [D] or [B] to [Z] and vice versa. Once the train from [1] to [2] has reached section [D] the signals must be routed forward; they however can not be released once the train has passed the section because it will cut off the PWM signal to sections further ahead.

Now lets assume that [1] is an endpoint and the train BB from [3] will turn around and will go to [2] following train AA. This is where I see that the problem comes in. Train AA from [1] to [2] is still happily on it's way to [2] (somewehere in e.g. [F] or [G]) receiving PWM signal from [D]. Earlier logic said that thet sections for the train from [1] to [2] should receive the PWM signal from [D], but [D] is still in use by a train AA. The question arises which module will provide the PWM signal for the path?

13
Generale / Re: Costruzione Orologio a led...
Last post by ghezzia - Today at 04:10 pm
Se impostato in quel modo hai provato anche solo un'attimo a misurare la tensione, probabilmente hai bruciato il fusibile interno da 200mA del tester (lo vedi subito, metti su continuita' e vedi se suona, o su ohm e vedi se unendo i puntali misura il corto ... se no, il fusibile e' da sostituire)
Mi pare che il corto lo misuri: sulla scala dei 200 ohm il corto mi da 0,6... sulla scala hFE (che non so cosa sia :)) mi da variabile tra 770 e 785... Gli altri tutti zero :(
puoi comperare (o riciclare da un vecchio alimentatore per PC bruciato) quei pad di tessuto siliconato grigio (piu raramente trovi la mica, ma ormai non la usa quasi piu nessuno) che ci sono fra i transistor e le alette di raffreddamento ... inclusa la vite con la rondella di nylon o teflon, ovviamente ...
forse ne ho uno ora provo a guardare :)
14
Generale / Re: Libro Arduino PDF
Last post by gpb01 - Today at 04:10 pm
... Non c'è alcuna differenza tra Arduino e Genuino?
E' a causa di una diatriba "legale" sul uso del nome, ma, a partità di modello, sono esattamente la stessa cosa ...
... se vuoi divertirti e sapere di più sulla suddetta diatriba ... QUI. :D

Guglielmo

P.S.: Prima di Natale hanno annunciato di aver trovato un accordo e di "aver fatto pace", ma, al momento, le due società continuano ad operare separatamente ... ::)
15
Software / problema su programma
Last post by Analfabeta - Today at 04:09 pm
ciao...

sto cercando di creare un menù su uno schermo oled... per il momento è all'inizio e trovo già difficoltà
 1- devo tenere premuto per qualche secondo prima che mi faccia entrare nel menu e i pulsanti "su" e "giu" non funzionano sempre, cioè fanno un ciclo e poi più niente...

il programma dovrebbe farmi leggere nella schermata iniziale temp e umidità, poi entrando nel menù dovrei cambiare i parametri in base hai quali data una certa temperatura mi fa scattare un relè che accende una ventola....

di seguito il codice

Code: [Select]
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#include <dht11.h>
dht11 DHT;
#define DHT11_PIN 4
#define rele 7
char str[10];
int  val = 0;
int stato = 0;

#define butUp     8     //pulsante SU al pin 8
#define butDown   9     //Pulsante GIU al pin 9
#define impostazioni     10
void changeMenu();
void dispMenu();

char menu = 0x01;
char set1 = 0x00, set2 = 0x00 , set3 = 0x00;
boolean t_butUp, t_butDown, t_butP, t_butM;
int sensorValue = 0;
int reading = 0;
int sensorPin = A0;

void setup() {
  Serial.begin(9600);
  pinMode( rele, OUTPUT );
 
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);
  display.clearDisplay();

  for (char i=8; i<10; i++){        //Ingresso dei pulsanti
   
      pinMode(i, INPUT_PULLUP);
      }

      t_butUp   = 0x00;             //Inizializza le variabili come ZERO
      t_butDown = 0x00;
      pinMode(impostazioni, INPUT);     // imposta il pin digitale come input
}



void loop() {
 int chk;
  float u = DHT.humidity;
  float t = DHT.temperature;
  delay(2000);

val = digitalRead(impostazioni);  // legge il valore dell'input e lo conserva

   if (val == HIGH) { 
    stato = 1 - stato; 
   }   
   if (stato == 1) {
    dispMenu();
    changeMenu();                //Menu di scambio
                   //Selezionare il menu
   }
 else {
 
  chk = DHT.read(DHT11_PIN); 
  switch (chk) {
    case DHTLIB_OK:
      Serial.print("Temperatura : ");
      Serial.print(t);
      Serial.print("\t");
      Serial.print("Umidità : ");
      Serial.println(u);
      display.setTextSize(1);
      display.setTextColor(WHITE);
      display.clearDisplay();
      display.setCursor(0,8);    display.print("Temperatura: ");
      display.setCursor(80,8);  display.print(t);
      display.setCursor(0,20);    display.print("Umidita': ");
      display.setCursor(80,20);  display.print(u);
      display.display();
      break;
    case DHTLIB_ERROR_CHECKSUM:
      Serial.print("Checksum error,\t");
      display.setCursor(0,8);    display.print("Checksum error,\t ");
      display.display();
      break;
    case DHTLIB_ERROR_TIMEOUT:
      Serial.print("Time out error,\t");
      display.setCursor(0,8);    display.print("Time out error,\t ");
      display.display();
      break;
    default:
      Serial.print("Unknown error,\t");
      display.setCursor(0,8);    display.print("Unknown error,\t");
      display.display();
      break;
      }
if ( t > 23 && chk==DHTLIB_OK) {
    digitalWrite( rele, HIGH );
  }
  else {
    digitalWrite( rele, LOW );
  }


  // Wait for two seconds so the output is viewable
  delay(2000);

}
}



void changeMenu(){
  if(digitalRead(butUp) == 0x00){        //Setta la variabile in 1 se si preme il pulsante UP
    t_butUp = 0x01;
  }
  if(digitalRead(butDown) == 0x00){      //Setta la variabile in 1 se si preme il pulsante DOWN
    t_butDown = 0x01;
  }
  if(digitalRead(butUp) && t_butUp){
    t_butUp = 0x00;
    display.clearDisplay();
    menu++;
    if(menu > 0x04){
    menu = 0x01;
    }
  }
  if(digitalRead(butDown) && t_butDown){
    t_butDown = 0x00;
    display.clearDisplay();
    menu--;
    if(menu < 0x01){
      menu = 0x04;
    }
  }   
}

void dispMenu(){
    switch(menu){
      case 0x01:
        controlLed();              //Funzione controllo  led1
      break;
      case 0x02:
         controlRele();               //Funzione controllo  relè
      break;
  }
}

void controlLed(){
      display.setTextSize(1);
      display.setTextColor(WHITE);
      display.clearDisplay();
      display.setCursor(0,8);    display.print("menu ");
      display.display();
}

void controlRele(){
   display.setTextSize(1);
      display.setTextColor(WHITE);
      display.clearDisplay();
      display.setCursor(0,8);    display.print("ciccio ");
      display.display();
}



grazie in anticipo
16
General Electronics / Re: Control VCC supply
Last post by ricky101 - Today at 04:08 pm
Think this is what you are wanting to do ? as the jpeg in entry #19 of this link shows.

A transistor could be used along with a base resistor, but there is a .6v drop across the transistor  so you end up with the output VCC  being  4.4V instead of 5.0v.

The Mosfets do not suffer from this big drop.

No need to use PWM, just output pin  HIGH or LOW

http://forum.arduino.cc/index.php?topic=313450.msg2173989#msg2173989
17
Deutsch / Bluetooth Modul HC-05 Knopfdru...
Last post by GreehN - Today at 04:08 pm
Hallo zusammen,

ich wollte einen Sketch programmieren, der mir auf Knopfdruck einen String an ein Bluetooth Terminal auf meinem Android Smartphone sendet.
Das ist der Quellcode:
Code: [Select]

#include <SoftwareSerial.h>

#define rxPin 10
#define txPin 11
int button = 7;
int buttonPosition = 0;

SoftwareSerial btSerial(rxPin, txPin);  
String btData;

void setup() {
  btSerial.begin(9600);
  btSerial.println("bluetooth available");
  pinMode(button, INPUT);
}

void loop() {
  if(btSerial.available()) {
    buttonPosition = digitalRead(button);
    btData = btSerial.readString();
    
    if(buttonPosition == HIGH) {
      btSerial.println("Button has been pressed!");  
    }
    if(btData == "check") {
      btSerial.println("Connection works");  
    }    
  }
  delay(100);
}


Bei Eingabe von "check" im Terminal bekomme ich die Antwort, die Verbindung steht also. Jedoch bekomme ich nichts gesendet, wenn ich den Knopf drücke.

Nachdem ich die if-Abfrage von check folgendermaßen abgeändert habe:
Code: [Select]
if(btData == "check" && buttonPosition == HIGH) {
      btSerial.println("Connection works");  
    }

bekam ich als Antwort vom Arduino sowohl "Button has been pressed!" als auch "Connection works", wenn ich den Knopf gedrückt und gleichzeitig "check" gesendet habe. Jedoch hat er nichts gesendet, wenn ich nur den Knopf gedrückt habe.

Habt ihr eine Idee, woran das liegen könnte und wie man es richtig macht?

Vielen Dank schon mal im Voraus,
GreehN  :)
18
Hello!

I am facing the below detailed issue when I try to use my motors with the controllers. A have read lots of forums articles, but did not found the solution jet...

Problem:
I can not drive the motors with A4998 and DRV8825 but with EasyDriver4.4 working properly. (fast, powerfull, silence, dont skip steps, but I have to cool the driver with a fan)

I do not understand why EasyDriver is working well, because based on datasheets and forums EasyDriver current capacity is much smaller, what my motors needed. Everywhere on internet can I read the appropriate driver for my motors are A4998 and DRV8825, but those not working for me, just jumped the axis left-right and give noise....
Has somebody any idea what could be the cause of the problem? Many thanks in advance for the advises.

I have made some measurement, i share the infos too, because I found interesting the current and voltage details.
I checked the cable of the coils, wiring is OK (in theory).I attached the wiring and the code too.

br
szalczim



Details:

EasyDriver working well:
adjusted VREF on 3V it's mean -> 0,06A on coiles, and 0,7 V (17HS4401 and 17HS8401 working properly)

A4998:
adjusted VREF on 0,95 V it's mean -> 1,7 A on coil by google, but in practice 0,9 A. Voltage on coil 0,3V  (17HS4401 and 17HS8401 axis left-right and give noise)

DRV8825:
adjusted VREF 0,85 V it's mean -> 1,7 A on coil by pololu, but in practice 0,1 A (17HS4401 and 17HS8401 axis left-right and give noise) During the lots of testing I damaged 3 driver, so I do not have any at this time. shipping is still in progress :)


I don't understand why working well the motor with EasyDriver on 0,06A. The advanced current for this motors is around or more then 1A. or am I wrong?



I have 3 stepper motor from 3 different supplyer and many motor drivers. All of them(drivers too) come from china(aliexpress)

Datasheet the motors:
17HS4401 1,7 A;1,8ohm (3ohm in practice) phase resistance;4 wire
17HS8401 1,7 A;1,8ohm (3ohm in practice) phase resistance;4 wire


Datasheet my power supply:
19V 4,7 A (notebook supply), but the voltage stepped down till 12 V.



Code: [Select]

int dirPin = 9;
int stepperPin = 8;
int led=13;
void setup() {
 pinMode(dirPin, OUTPUT);
 pinMode(stepperPin, OUTPUT);
 pinMode(led, OUTPUT);
}
 void step(boolean dir,int steps){
 digitalWrite(dirPin,dir);
 delay(50);
 for(int i=0;i<steps;i++){
   digitalWrite(stepperPin, HIGH);
   //delay(2000); //for the current and voltage measurement on the coil
   delayMicroseconds(60);
 
   digitalWrite(stepperPin, LOW);

   delayMicroseconds(60);
   //delay(2000)  ;
 }
}
void loop(){
 step(true,15000);
 delay(150);
 step(false,12000);
 delay(50);

}


19
Generale / Re: [OT] Eagle 7.1.0
Last post by dally - Today at 04:07 pm
su stazioni dedicate HP
Che versione? e sopratutto, stazioni HP-x86 o HP-RISC? PA o Itanium?
Questa cosa, essendo uno sviluppatore PA-v2, mi interessa molto :D
20
thanks for your answer!

I removed all irrelevant info out of my sketch...
I googled for converting byte array to char array, and i found sprintf.

But i can`t find an example that does what i need.

as you can see in my sketch, i define pin numbers in a byte array, and with a for loop cycle through all elements of buttons array.
the index variable is also of byte type. Could you point me to an example where i can convert an element of byte array to char array, and use that in the publish function?

Code: [Select]


// here is where we define the buttons that we'll use. button "1" is the first, button "6" is the 6th, etc
// the analog 0-5 pins are also known as 14-19

byte buttons[] = {14, 15, 16, 17, 18, 19};

#define NUMBUTTONS sizeof(buttons)

void check_switches()
{
  boolean retained = true;
  static byte previousstate[NUMBUTTONS];
  static byte currentstate[NUMBUTTONS];
  static long lasttime;
  byte index;
 
  for (index = 0; index < NUMBUTTONS; index++) {
    currentstate[index] = digitalRead(buttons[index]);   // read the button

    if (currentstate[index] != previousstate[index]) {
      if ((currentstate[index] == LOW) && (previousstate[index] == HIGH)) {
          client.publish(buttons[index], "0");
      }
      else if ((currentstate[index] == HIGH) && (previousstate[index] == LOW)) {
         client.publish(buttons[index], "1");
      }
     }
    previousstate[index] = currentstate[index];   // keep a running tally of the buttons
  }
}
Pages: 1 [2] 3 4 ... 10

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy