Buonasera.
Ho un problema legato all'alimentazione esterna del mio arduino. Premetto che deve alimentare una easy 3.0 e dei relè. Ho provato ad alimentarlo con il jack, quello che si trova al fianco dell'ingress usb, ma il regolatore NCP1117 si surriscalda troppo; uso un normale alimentatore che ha come output 12v 1.0a
Sí possibile. Alimenta Arduino con 7V.
Ciao Uwe
In che modo posso alimentare se non dispongo di 7v?
Puoi usare un normalissimo convertitore step-down come QUESTO qui e dandogli in ingresso i 12V regoli l'uscita sul valore che ti serve ... che più vicino è ai 7V e meglio è per il regolatore a bordo di Arduino, oppure, meglio ... separi le alimentazioni e con i 12V alimenti solo Arduino e con lo step-down ti ricavi la tensione che ti occorre per tutto il resto (immagino 5V) senza caricare il regolatore di Arduino.
Guglielmo
Mmmmmm capito, quindi separo arduino con lo shield e li alimento diversamente, giusto?
Sicuro che il problema sia lo shield e non i relè che assorbono troppo ?
Guglielmo
Se provo ad alimentare il tutto con un convertitore 220v con uscita da 5 v 2a. Siccome collegato tutto a un caricabatteria per telefono all'ingresso usb 5v 2a /9v 2a e tutto funziona
Non ho capito e ... come è legato con la mia domanda al post #5 ? :o
Guglielmo
Devo provare ad usare i 12 v senza relè.
Sono i relè che consumano troppo. Devo alimentarli esternamente
... mi sembrava strano che fosse lo shield ... considerà che ciascuno di quei relè, come minimo, si mangia 70 - 90 mA :
Guglielmo
tutti questi???
Il gnd lo metto in comune? Mentre i 5v esterni.
Se invece lo alimento via usb Non ho questo problema. Lo collego con un alimentatore per cellulari, solo non capisco; sta scritto output: 5v 2 a 9v 2a. Non so se usa 5v o 9v
Per i relé metti il link al modello esatto che vediamo lo schema, perché potrebbe NON essere necessario il GND in comune, dipende da come sono controllati ...
Per l'alimnetatore, stai attento, ho idea che stai usando uno di quelli a carica rapida (ce l'ho anche io) ...
... prendo un VERO alimentatore 5V 2A e lascia stare i carica telefonini, dai retta.
Guglielmo
questi sono i relè: http://4.bp.blogspot.com/-tBnPee3u9QI/VArJx9l_dOI/AAAAAAAABEI/LZru8r5fDuU/s1600/Relay_LED_Circuit_with_Arduino.png
Volevo comprare un convertitore 220v che ha come output 5v 2a.
Hai esattamente quella scheda Relè ?
O è una simile ?
Sono proprio quelli.
Ho comprtato il trasformatore che mi da 12v 2 a, collegato attraverso il jack il tutto funziona egregiamente, per il momento
.
Alimentatore dici? Ma non scalda il regolatore un po' troppo?
No, per niente proprio;
Solo che secondo me 2 a sono pochi per i modulini che ho vicino, siccome non mi risponde ai comandi. Sarà lo sketch??
ve lo scrivo :
#include "Arduino.h"
#if !defined(SERIAL_PORT_MONITOR)
#endif
#if defined(SERIAL_PORT_USBVIRTUAL)
// Shield Jumper on HW (for Leonardo and Due)
#define port SERIAL_PORT_HARDWARE
#define pcSerial SERIAL_PORT_USBVIRTUAL
#else
// Shield Jumper on SW (using pins 12/13 or 8/9 as RX/TX)
#include "SoftwareSerial.h"
SoftwareSerial port(12, 13);
#define pcSerial SERIAL_PORT_MONITOR
#endif
#include "EasyVR.h"
//==========================
int8_t group, idx;
int Relay = 9;
int f = 1 ;
int calibrationTime = 30;
long unsigned int lowIn;
long unsigned int pause = 10000;
boolean lockLow = true;
boolean takeLowTime;
#define potPin A1
const int sensorLuce = A0;
int sensorValue = 0;
int aRead = 0;
int pirPin = 3; // PIR sensor's output
int ledPin = 4;
//-------------------
EasyVR easyvr(port);
//Groups and Commands
enum Groups
{
GROUP_1 = 1,
GROUP_16 = 16,
};
enum Group1
{
G1_APRI = 0,
G1_ACCENDILUCE = 1,
G1_SPEGNILUCE = 2,
G1_CHIUDI = 3,
G1_CIAO = 4,
G1_TEMPERATURA = 5,
};
enum Group16
{
G16_PASS = 0,
};
void setup()
{
// setup PC serial port
pcSerial.begin(9600);
//=========================
pinMode(pirPin, INPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(pirPin, LOW);
for (int i = 0; i < calibrationTime; i++)
delay(50);
pinMode(Relay, OUTPUT);
//----------------------------
// bridge mode?
int mode = easyvr.bridgeRequested(pcSerial);
switch (mode)
{
case EasyVR::BRIDGE_NONE:
// setup EasyVR serial port
port.begin(9600);
// run normally
pcSerial.println(F("---"));
pcSerial.println(F("Bridge not started!"));
break;
case EasyVR::BRIDGE_NORMAL:
// setup EasyVR serial port (low speed)
port.begin(9600);
// soft-connect the two serial ports (PC and EasyVR)
easyvr.bridgeLoop(pcSerial);
// resume normally if aborted
pcSerial.println(F("---"));
pcSerial.println(F("Bridge connection aborted!"));
break;
case EasyVR::BRIDGE_BOOT:
// setup EasyVR serial port (high speed)
port.begin(115200);
// soft-connect the two serial ports (PC and EasyVR)
easyvr.bridgeLoop(pcSerial);
// resume normally if aborted
pcSerial.println(F("---"));
pcSerial.println(F("Bridge connection aborted!"));
break;
}
while (!easyvr.detect())
{
Serial.println("EasyVR not detected!");
delay(1000);
}
easyvr.setPinOutput(EasyVR::IO1, LOW);
Serial.println("EasyVR detected!");
easyvr.setTimeout(1);
easyvr.setLanguage(1);
group = 1; //<-- start group (customize)
}
void action();
void loop()
{
if (easyvr.getID() < EasyVR::EASYVR3)
easyvr.setPinOutput(EasyVR::IO1, HIGH); // LED on (listening)
Serial.print("Say a command in Group ");
Serial.println(group);
easyvr.recognizeCommand(group);
do
{
// can do some processing while waiting for a spoken command
}
while (!easyvr.hasFinished());
if (easyvr.getID() < EasyVR::EASYVR3)
easyvr.setPinOutput(EasyVR::IO1, LOW); // LED off
idx = easyvr.getWord();
if (idx >= 0)
{
// built-in trigger (ROBOT)
// group = GROUP_X; <-- jump to another group X
return;
}
idx = easyvr.getCommand();
if (idx >= 0)
{
// print debug message
uint8_t train = 0;
char name[32];
Serial.print("Command: ");
Serial.print(idx);
if (easyvr.dumpCommand(group, idx, name, train))
{
Serial.print(" = ");
Serial.println(name);
}
else
Serial.println();
// beep
easyvr.playSound(0, EasyVR::VOL_FULL);
// perform some action
action();
}
else // errors or timeout
{
if (easyvr.isTimeout())
Serial.println("Timed out, try again...");
int16_t err = easyvr.getError();
if (err >= 0)
{
Serial.print("Error ");
Serial.println(err, HEX);
sensorValue = analogRead(sensorLuce);
if (sensorValue < 40) {
digitalWrite (ledPin, HIGH);
} else if (digitalRead(pirPin) == HIGH) {
digitalWrite(ledPin, HIGH); //the led visualizes the sensors output pin state
if (lockLow) {
//makes sure we wait for a transition to LOW before any further output is made:
lockLow = false;
}
takeLowTime = true;
}
if (digitalRead(pirPin) == LOW) {
digitalWrite(ledPin, LOW);
}
{
aRead = analogRead(potPin);
float tempC = aRead * 0.48875;
}
}
}
}
void action()
{
switch (group)
{
case GROUP_1:
switch (idx)
{
case G1_APRI:
// write your action code here
// group = GROUP_X; <-- or jump to another group X for composite commands
break;
case G1_ACCENDILUCE:
if (f == 0) {
(f = 1);
} else {
(f = 0);
}
digitalWrite(Relay, f);
easyvr.playSound(1, EasyVR::VOL_FULL);
break;
case G1_SPEGNILUCE:
digitalWrite(Relay, LOW);
easyvr.playSound(4, EasyVR::VOL_FULL);
break;
case G1_CHIUDI:
// write your action code here
// group = GROUP_X; <-- or jump to another group X for composite commands
break;
case G1_CIAO:
// write your action code here
// group = GROUP_X; <-- or jump to another group X for composite commands
break;
case G1_TEMPERATURA:
if(aRead==37){
easyvr.playSound(5, EasyVR::VOL_FULL);
}
else if(aRead==39){
easyvr.playSound(6, EasyVR::VOL_FULL);
}
else if(aRead==41){
easyvr.playSound(7, EasyVR::VOL_FULL);
}
else if(aRead==44){
easyvr.playSound(8, EasyVR::VOL_FULL);
}
else if(aRead==46){
easyvr.playSound(9, EasyVR::VOL_FULL);
}
else if(aRead==48){
easyvr.playSound(10, EasyVR::VOL_FULL);
}
else if(aRead==50){
easyvr.playSound(11, EasyVR::VOL_FULL);
}
break;
case GROUP_16:
switch (idx)
{
case G16_PASS:
easyvr.playSound(0, EasyVR::VOL_FULL);
group = GROUP_1; //<-- or jump to another group X for composite commands
break;
}
break;
}
}
}
Prima racchiudilo nei TAG code però! Comunque ti ricordo che più di 800mA non possono "uscire" dal jack di alimentazione della Arduino e comunque Arduino deve consumare sotto i 200mA, se no si brucia, ovvero si brucia l'Atmega, basta leggere i datasheet
In realtà già 1A sarebbe il massimo che ti serve per l'alimentatore, 2A è solo roba che non usi, figuriamoci di più...
QUI PAGINA 365 leggi le specifiche elettriche dell'Atmega
QUI le specifiche del regolatore di tensione montato su Arduino, ovvero quello che hai usato tu alimentando arduino tramite jack con alimentatore.
quindi è lo sketch...