Recent Posts

Pages: [1] 2 3 ... 10
1
2
Project Guidance / Re: How can I get my linear ac...
Last post by MB94 - Today at 11:26 am
Thanks, would there not be a simple way just to simply code ' move until reach force=10' etc ?
3
Français / Re: batterie pour alimenter un...
Last post by ewaca - Today at 11:25 am
J'ai reçu toutes mes pieces, j'en suis a regarder comment faire fonctionner tout ça depuis un arduino uno classique.
Et en regardant de plus pret comment alimenter le arduino mini pro, je me suis rendu compte d'un truc...

La pin raw permet de l'alimenter avec un tension située entre 3.4 et 12V, quand la pin VCC nécessite une tension de 3.3V régulé.

Je pars pour le moment sur 2 accu 18650 (en dérivation) dont la tension varie entre 2.5 et 4.2V (2.5 étant la limite basse fixée par le TP4056 avant de couper l'alimentation).

Ma tension n'étant pas régulée, je me retrouve dans cette configuration a devoir alimenter l'arduino pro mini sur la pin Raw, et je peux exploiter les piles que sur la tranche 3.4-4.2V, me privant ainsi de la partie 2.5-3.3V.

Est ce que la tranche 2.5-3.3V d'une pile est négligeable, où est ce que je gagne a utiliser un régulateur/booster comme celui ci pour exploiter le max des accu ? (dans la limite des 2.5V mini)
4
Hardware / Problemas con Adafruit Motor S...
Last post by jjcarles - Today at 11:24 am
Hola a todos.

Estoy realizando un proyecto que consiste en un carril para macrofotografía controlado por Bluetooth. Para el proyecto, utilizo un arduino uno, el adafruit motor shield, para controlar un Nema17, y el HC-06.





Las conexiones del HC-06 son:

    HC-06       Arduino
    RX ------> TX (cable marrón)
    TX ------> RX (cable rojo)
    GND ----> GND (cable negro)
    5V ------> Pin 11 (cable blanco)

La razón por la que alimento el HC-06 por un pin es por que si lo hacia directamente por el pin de los 5V de arduino, cada vez que tenía que actualizar el código me decía que el puerto estaba ocupado y tenía que desconectar el bluetooth.
   
Las pruebas las hago por el puerto USB del arduino pero el problema también lo tengo si alimento el sistema con una Lipo de 7.4V.

El montaje funciona si pruebo el motor y el bluetooth por separado. Es decir, si modifico el código para que sólo avance y retroceda sin tener en cuenta el bluetooth, funciona sin problemas y si modifico el código para que sólo lea la información recibida por bluetooth, me la muestra corractamente. Pero si quiero que el motor avance o retroceda en función de una orden enviada por bluetooth, falla el bluetooth se apaga del todo o, en el mejor de los casos, se desvincula del teléfono.

La secuencia de lo que sucede es la siguiente:

1) Enciendo el sistema y el bluetooth se pone en espera (la luz parpadea)
2) Emparejo el teléfono (la luz es continua)
3) Envío la orden de avanzar el motor
4) El motor avanza pero el bluetooh se apaga!!!.

Aquí lo podeis ver en video:



Le he estado dando vueltas y mirando los muchos tutoriales que existen sobre el control de motores por bluetooth pero no doy con la solución.

¿Que estoy haciendo mal? Gracias por la ayuda.

Este es el código fuente que estoy utilizando:

Quote
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"

const char nameBT[10] = "MACROBT";
const char bpsBT = '4'; // 9600 bps
const char pinBT[5] = "0000";

const int RAIL = 50;        // mm
const float M8STEP = 0.04;  // mm
const int MOTORSTEPS = 200; // units

int pinBTPWR = 11;
int pinPHOTO = 7;

int currentPhoto;
int maxPhotos;
int steps;

bool bRun;

char blueToothVal;           //value sent over via bluetooth
char lastValue;              //stores last state of device (on/off)

Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);

void setup() {
  pinMode(pinBTPWR, OUTPUT);
  pinMode(pinPHOTO, OUTPUT);

  digitalWrite(pinBTPWR, HIGH);

  Serial.begin(9600);

  Serial.print("AT");
  delay(1000);

  Serial.print("AT+NAME");
  Serial.print(nameBT);
  delay(1000);

  Serial.print("AT+BAUD");
  Serial.print(bpsBT);
  delay(1000);

  //Serial.print("AT+PIN");
  //Serial.print(pinBT);
  //delay(1000);

  bRun = true;

  currentPhoto = 0;
  maxPhotos = 200;
  steps = 20;

  AFMS.begin();
  myMotor->setSpeed(10);  // RPM
}

void loop() {
  if (Serial.available()) {
    blueToothVal = Serial.read();
  }

  if (blueToothVal == 'b') {
    if (lastValue != 'b') Serial.println(F("Backward"));
    moveBackward(steps);
    lastValue = blueToothVal;
  }
  else if (blueToothVal == 'f') {
    if (lastValue != 'f') Serial.println(F("Forward"));
    moveForward(steps);
    lastValue = blueToothVal;
  }

  blueToothVal = 0;
 
  delay(1000);


  /*
    if (currentPhoto < maxPhotos && bRun) {
    moveForward(steps);
    takePhoto();
    currentPhoto++;
    }
    else {
    if (bRun) {
      moveBackward(maxPhotos * steps);
      currentPhoto = 0;
      bRun = false;
      myMotor->release();
    }
    }
  */
}

void moveForward(int steps) {
  myMotor->step(steps, FORWARD, MICROSTEP);
}

void moveBackward(int steps) {
  myMotor->step(steps, BACKWARD, MICROSTEP);
}

void takePhoto() {
  delay(1000);
  digitalWrite(pinPHOTO, HIGH);
  delay(1000);
  digitalWrite(pinPHOTO, LOW);
  delay(1000);
}
5
General Electronics / Re: Level shifter 5V to 24V
Last post by jgrovan - Today at 11:24 am
Hi,

I was too fast in modifying my diagram, please see the attached.

Regarding the P-Mosfet;  My guess is the 24V current needed to start your motor is not very high.  I would look for a P Mosfet that is easy to get and if hand soldering has leads.  Likely at TO-220 case.  The P Mosfet  in a TO-220 case is probably overkill but is likely to be the most common.


REVISED With R4 in its previous location one could loose ~9% of the gate voltage, with low voltage processors this would not be the optimum case.

Looks good! I've seen other circuits that uses a zener diode to drop the voltage from 24V to the desired voltage to the gate of the PFET. Do ou know if theres a reason for this, rather than using a common voltage devider, as you have in your circuit?

Also, if the PFET fails closed, do anyone have a clever way of making the output go to 0V?
6
Hi guys, we are new in this websites.
We are students and we don't know much about arduino. We have to send some informations from arduino to our database or our php page. First of all we searched the hardware as gps module and sim900 to send our data.
The problem is how  to send information with remote connection from arduino to mysql database or php page.
How is it possible? Can you help us with code? Pls help us.
thanks  :)
7
Arduino Due / 3rd Party DUE compatible
Last post by gcharles - Today at 11:23 am
Hello I have been developing my project with an original  Arduino DUE , I have 2 of them but now , once I go to the final Board design It might be an issue with Space therefore I was checking online if they are any smaller DUE compatible boards.

I have found one the link is below http://www.inhaos.com/uploadfile/otherpic/DOC-DUE-CORE-V02-20180113.pdf


Before I order I would like to know if anyone of you have ever used suck boards ad if the are compatible with Arduino IDE & Atmel Studio

Thanks
8
Hardware / Re: Aiuto Antifurto semplice c...
Last post by gpb01 - Today at 11:22 am
Non uso librerie per i SIM, uso direttamente i conadi AT, quindi non ho "consigli" da dare su una libreria, ma ... basta fare una ricerchina su Google per "arduino sim800l library" e ne trovi quante ne vuoi ... poi tocca ovvamente studiarsele !

Come fare te l'ho indicato ...
... quando devi inviare le chiamate userai il comando della libreria (... a te vedere, in funziona della libreria, quale chiamata/chiamate alle sue funzioni sono necessarie) per fare la chiamata, al termine, se non devi fare altro, userai una delay() per l'attesa (... se devi fare altro, implementerai un meccanismo di ritardo tramite la funzione millis()) e poi, sempre con lo stesso comando di libreria, invierai la seconda chiamata. :)

Comunque, se guardi negli esempi che, di solito, accompagnano le librerie, sicuramente trovi come effettuare una chiamata ;)

Guglielmo
9
Move the actuator position 1 degree.  Wait a moment for the actuator finish the move.  Read the force sensor. If the force is equal to or over the force, stop, else increment the position and repeat.

10
Quote
@GolamMostafa, there is no such thing as waiting after a Wire.requestFrom(). You should not do this:
I have the following reasons to say so:
1. The 2nd argument of Wire.requestFrom(deviceAddress, n) is a pre-negotiated value with the slave. The designer knows (must know), how many data bytes the Slave will send to Master after arriving at the Wire.onRequest() ISR. In the present case, it is one word (2-byte data).

2.  In the Wire.onRequest() ISR, the Slave transmits data byte-by-byte, which is not an instant transmission.

3.  At the Master side, the Master must receive data on polling (as it is not configured to work as Slave) just after the issuance of the command -- Wire.requestFrom(deviceAddress, 2).

4. Because the data are yet to arrive from the slave, I prefer to wait and let the buffer get filled up with the requested amount of data bytes.

5. In the command (while(Wire.available() != 2), I am testing a condition; so, I have preferred to wait until the condition is satisfied.

6.  When someone using the command while(Wire.available()), he is checking the TRUE/FALSE condition of a boolean variable. One danger is here and it is that the condition will stand TRUE even when 1-byte data has arrived; whereas, the expected number of data byte are 2.

I hope you will a thought on my reasoning; I could be incorrect and even wrong!    
Pages: [1] 2 3 ... 10