Recent Posts

Pages: [1] 2 3 ... 10
1
General Electronics / Re: Too many ohms??
Last post by LandonW - Today at 02:39 am
Yes, my apologies I suppose.
2
Hey, Mitov.  This  is super cool and I'm eager to try it out.
I have a suggestion which is to encourage you to port the program to Linux.
Thank you!
Working on MAC and Linux port, but since I am the only guy developing it, and I am already overloaded adding all the new modules and boards, not to mention the rest of my products, it takes time... :-( .
3
Sensors / The values ​​of a string cant ...
Last post by GabrielArDuino - Today at 02:35 am
Hello good afternoon.
I have a sensor that detects the humidity and the temperature, the detection by levels, so, it prints 3 humidity values and 3 temperature values, but it prints it in a chain that only separates with a + sign. So we will use the command: strtok. And then with a set of while a variable is assigned to each of the values that were between the plus signs (+). I did it in the values of temperature and operation, but at the moment of doing it I do not leave. To check the result of the printing, the values of the sensors were obtained from the variables of the temperature parameters and apparently. Help


Code: [Select]
#include <SDISerial.h>

#include "Arduino.h"


/*
I used a few devices with no problem using a MEGA 2560 as well as an UNO.
Sketch was built with Arduino 1.0.4, however I also tested it under 1.0.0
Place the SDISerial folder in    "<ARDUINO_ROOT>/libraries"
with the 5TE
the WHITE wire is power.
   - I hooked it up to the arduino 5v output pin, however you could also connect it to a pin and drive power only when you wanted it
the RED wire is the DATA_LINE.
   - you must hook it up to a pin that can process interrupts (see link below)
  
the remaining wire must be connected to ground
*/

//in order to recieve data you must choose a pin that supports interupts
#define DATALINE_PIN 2
#define INVERTED 1
#define BAUDRATE 1200

//see:   http://arduino.cc/en/Reference/attachInterrupt
//for pins that support interupts (2 or 3 typically)
char* templ1;//temperature level1
char* templ2;//temperature level2
char* templ3;//temperature level3

char* huml1;//moisture level1
char* huml2;//moisture level2
char* huml3;//moisture level3

char* value_temperature;
char* value_moisture;

SDISerial connection(DATALINE_PIN, INVERTED);

char output_buffer[125];

void setup(){
  connection.begin(); // start our SDI connection
  Serial.begin(BAUDRATE); // start our uart
  Serial.println("OK INITIALIZED"); // startup string echo'd to our uart
  delay(3000); // startup delay to allow sensor to powerup and output its DDI serial string
  char* sensor_address = connection.sdi_query("?!", 1000);
  sprintf(output_buffer,"Sensor address: %s",sensor_address?sensor_address:"No Response");
  Serial.println(output_buffer);

  char* sensor_info = connection.sdi_query("1I!", 1000);
  sprintf(output_buffer,"Sensor info: %s",sensor_info ?sensor_info :"No Response");
  Serial.println(output_buffer);
}

void loop(){
   char* start_measurements_m = connection.sdi_query("1M!", 2000);
  sprintf(output_buffer,"start measurements Moisture: %s",start_measurements_m ? start_measurements_m :"No Response");
  //Serial.println(output_buffer);
  delay(2000);

  char* moisture = connection.sdi_query("1D1!", 2000);
  sprintf(output_buffer,"Sensor Data Soil Moisture: %s",moisture ? moisture :"No Response");
  Serial.println(output_buffer);

  char* start_measurements_t = connection.sdi_query("1M4!", 2000);
  sprintf(output_buffer,"Start Data Soil Temperature: %s",start_measurements_t ? start_measurements_t :"No Response");
  //Serial.println(output_buffer);
  delay(2000);

  char* temperature = connection.sdi_query("1D0!", 2000);
  sprintf(output_buffer,"Sensor Data Soil Temperature: %s",temperature ? temperature :"No Response");
  Serial.println(output_buffer);
  
  //AT+SAPBR=3,1,"Contype","GPRS";
  //AT+SAPBR=3,1,"APN","internet.itelcel.com";

 char* command = strtok(temperature, "+");
 int counter=1;
while (command != 0)
{
  
    // Find the next command in input string
    command = strtok(0, "+");
    if(counter==1){
      templ1=command;  
      }
    else if(counter==2){
      templ2=command;
    }
    else if(counter==3){
      templ3=command;
    }
    ++counter;
}

 char* command2 = strtok(moisture, "+");
 int counter1=1;
while (command2 != 0)
{
  
    // Find the next command in input string
    command2 = strtok(0, "+");
    Serial.println(command2);
    if(counter1==1){
      huml1=command2;  
      }
    else if(counter1==2){
      huml2=command2;
    }
    else if(counter1==3){
      huml3=command2;
    }
    ++counter1;
    Serial.println(command2);
}

Serial.println("temperatura");
Serial.println(templ1);
Serial.println(templ2);
Serial.println(templ3);

Serial.println("humedad");
Serial.println(huml1);
Serial.println(huml2);
Serial.println(huml3);


}

Thanks in advance
4
For hints on how to use this forum, including how to use code tags, please read the "How to use this forum" post, at the top of every section.

Quote
Do you have any suggestions to solve my problem?
Not sure what your problem actually is. But you could reduce the delay(5000) to something more reasonable, like delay(600). That is about how long it takes the Tower Pro MG995 to traverse 180 degrees.

I hope you are NOT attempting to power the servo from the 5V Arduino output, as that will cause serious problems. Instead, use a 4xAA battery pack, and connect all the grounds.
5
Hardware / Re: Envió de datos vía MODBUS ...
Last post by rodsal13 - Today at 02:31 am
Ya logre enviar el dato que yo quiero en el TestHoldingReg, pase el

Code: [Select]
mb.addHreg(TEST_HREG, ZZZ );  // aca envia el dato

a mi programa y lo subi, el valor que yo le ponga en donde esta ZZZ me lo da sin ningún problema, pero si le pongo mi variable "distance " ya no me envía los números que pongo así:
 
  if(medida1 == HIGH){
  distance = 1111;}
  if(medida2 == HIGH){
  distance = 2222;}
  if(medida3 == HIGH){
  distance = 3333;}
  if(medida4 == HIGH){
  distance = 4444;}
  if(medida5 == HIGH){
  distance = 5555;}
  if(medida6 == HIGH){
  distance = 6666;}
  mb.task();
     if (millis() > ts + 200) {
       ts = millis();

Me eh puesto ah pensar y veo que  no estoy llamando estos valores cuando se activa una entrada del NodeMCU, y es que no se como hacerle, si por medio de una subrutina o como.
6
I would think you'd want some logic like:

     if((pirState==HIGH)&((millis()-lastLedTime)>ledOn)) {
        digitalWrite(relayPin, HIGH); // turn LED OFF
         pirState = LOW;
      }


7
General Electronics / Re: Too many ohms??
Last post by jremington - Today at 02:27 am
Quote
if you read the original post with LED A working then that already shoots down the rectifiers being wrong.
I already pointed that out, and postulated in reply #3 that you wired the LED backwards.

If you want to get correct answers on this forum, please post the correct information describing the problem.
8
Very happy :D

It was a huge learning experience to design a board from scratch and make it all happen the way I envisioned. A humbling experience, and it really makes you appreciate the level of technology we take for granted in today's world. I'm looking to make my work bigger and better all the time now!
I must say, the the display looks really cool in the video.
9
Project Guidance / Re: Good project box
Last post by sexiewasd - Today at 02:23 am
This is off topic, but try it out.  The touch interface works better than a mouse and keyboard. onshape is free for hobby use and it's made by the original team behind solidworks, so they have a very good idea of how to make a CAD program.
10
So for $0.30 I can switch 600v at 4 amps? With a 3.3v signal? Almost seems too good to be true haha

When you say "with optocoupler" what do you mean?

How do I figure out what sort of resisters I would need?

Where would they be wired in if they are being used for the triacs?

Pages: [1] 2 3 ... 10