Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Installation & Troubleshooting / Windows 8 x64 + Arduino UNO? on: January 13, 2013, 03:50:57 am
Ok, I have googled my problem. Found the solution to the digital driver signing problem, and got all my other Arduino boards working just fine. Arduino Diecemila, Mega, Nano etc etc.

But when connecting my Arduino UNO it just says:

Quote
The drivers for this device are not installed. (Code 28)

To find a driver for this device, click Update Driver.

I tried pointing it to the latest FTDI driver folder, but it just won't do the trick. So I'm hoping anyone here have a solution? Help?
2  Using Arduino / General Electronics / Re: RF Transmitter and Receiver WRL-10535 and WRL-10533 on: October 09, 2012, 02:31:49 pm
So, there are many other functions other than those listed on Arduino.cc-Reference?

Thanks so much for the help smiley I understand much much more than before I read your answers smiley-grin
3  Using Arduino / General Electronics / Re: RF Transmitter and Receiver WRL-10535 and WRL-10533 on: October 09, 2012, 01:55:19 pm
I'm getting the Ok. But I found an example on a blog:
http://genericnerd.blogspot.no/2012/07/arduino-sending-integers-over-rf-with.html

So I took it, and merged it with the DHT11.

Transmitter:
Code:
//
//   FILE:  dht11_test1.pde
// PURPOSE: DHT11 library test sketch for Arduino
//

//Celsius to Fahrenheit conversion

#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2

#include <VirtualWire.h>

// LED's
const int ledPin = 13;

// Sensors

int Sensor1Data;
//int Sensor2Data;
char Sensor1CharMsg[4];

double Fahrenheit(double celsius)
{
return 1.8 * celsius + 32;
}

//Celsius to Kelvin conversion
double Kelvin(double celsius)
{
return celsius + 273.15;
}

// dewPoint function NOAA
// reference: http://wahiduddin.net/calc/density_algorithms.htm
double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078);   // temp var
return (241.88 * T) / (17.558-T);
}

// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}


void setup()
{
  Serial.begin(9600);
   // LED
 pinMode(ledPin,OUTPUT);
  // VirtualWire setup
 vw_setup(2000);     // Bits per sec
 
}

void loop()
{

  
  
   // Read and store Sensor 1 data
  int chk = DHT11.read(DHT11PIN);
  Sensor1Data = DHT11.temperature;
  delay(2000);
  // Convert integer data to Char array directly
  itoa(Sensor1Data,Sensor1CharMsg,10);
  
  // DEBUG
  Serial.print("Sensor1 Integer: ");
  Serial.print(Sensor1Data);
  Serial.print(" Sensor1 CharMsg: ");
  Serial.print(Sensor1CharMsg);
  Serial.print("RawSensor: ");
  Serial.print(DHT11.temperature);
  Serial.println(" ");
  delay(1000);

  // END DEBUG
 
 digitalWrite(13, true); // Turn on a light to show transmitting
 vw_send((uint8_t *)Sensor1CharMsg, strlen(Sensor1CharMsg));
 vw_wait_tx(); // Wait until the whole message is gone
 digitalWrite(13, false); // Turn off a light after transmission
 delay(200);
}
//
// END OF FILE
//

Reciever:

Code:
/*

Sensor Receiver
By Markus Ulfberg 2012-07-06

Gets a sensor reading 0-1023 in a char array
from RF Transmitter unit via VirtualWire
converts char array back to integer

*/

#include <VirtualWire.h>

// LED's
int ledPin = 13;

// Sensors
int Sensor1Data;

// RF Transmission container
char Sensor1CharMsg[4];

void setup() {
  Serial.begin(9600);
  
  // sets the digital pin as output
  pinMode(ledPin, OUTPUT);      
    
    // VirtualWire
    // Initialise the IO and ISR
    // Required for DR3100
    vw_set_ptt_inverted(true);
    // Bits per sec
    vw_setup(2000);    
    
    // Start the receiver PLL running
    vw_rx_start();      

} // END void setup

void loop(){
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;
    
    // Non-blocking
    if (vw_get_message(buf, &buflen))
    {
    int i;
        // Turn on a light to show received good message
        digitalWrite(13, true);
    
        // Message with a good checksum received, dump it.
        for (i = 0; i < buflen; i++)
    {            
          // Fill Sensor1CharMsg Char array with corresponding
          // chars from buffer.  
          Sensor1CharMsg[i] = char(buf[i]);
    }
        
        // Null terminate the char array
        // This needs to be done otherwise problems will occur
        // when the incoming messages has less digits than the
        // one before.
        Sensor1CharMsg[buflen] = '\0';
        
        // Convert Sensor1CharMsg Char array to integer
        Sensor1Data = atoi(Sensor1CharMsg);
        
        
        // DEBUG
        Serial.print("Temp Outside: ");
        Serial.println(Sensor1Data);
        
      
        
        
        // END DEBUG
                
        // Turn off light to and await next message
        digitalWrite(13, false);
    }
}


Now it's working. smiley-razz Not sure I understand exactly how it parses the int over. I sure need to study arrays more. And just experiment with em.
4  Using Arduino / General Electronics / Re: RF Transmitter and Receiver WRL-10535 and WRL-10533 on: October 09, 2012, 01:16:06 pm
Hm, got no compiling errors, but it won't send. Led 13 won't even light up, so it can't have gotten that far into the program smiley-razz

Code:
#include <dht11.h>
dht11 DHT11;
#define DHT11PIN 2
#include <VirtualWire.h>

double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078);   // temp var
return (241.88 * T) / (17.558-T);
}

// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}

int tempsend;
char tempconv;
char diddle;

void setup()
{
    Serial.begin(9600);   // Debugging only
    Serial.println("setup");
    Serial.println("DHT11 TEST PROGRAM ");
    Serial.print("LIBRARY VERSION: ");
    Serial.println(DHT11LIB_VERSION);
    Serial.println();

    // Initialise the IO and ISR
    vw_setup(2000); // Bits per sec
}

void loop()
{
     Serial.println("\n");

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Read sensor: ");
  switch (chk)
  {
    case 0: Serial.println("OK"); break;
    case -1: Serial.println("Checksum error"); break;
    case -2: Serial.println("Time out error"); break;
    default: Serial.println("Unknown error"); break;
  }

  int convert = DHT11.temperature;

   char *msg;
   msg[0] = highByte(convert);
   msg[1] = lowByte(convert);

    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(2000);
}
5  Using Arduino / General Electronics / Re: RF Transmitter and Receiver WRL-10535 and WRL-10533 on: October 09, 2012, 12:39:55 pm
Hm, sorry for not understanding. But the value I'm sending could just be a normal int.

Code:
   Serial.print("Temperature (oC): ");
  int convert = DHT11.temperature;
  Serial.println(convert);


   char *msg[3] = convert;

    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(3));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(2000);

So after converting my float value to a int, it's basically the value of 23-25 around there. What do you mean by put 4 byte in msg[0] thru msg[3]?

Thanks for all the help so far! smiley
6  Using Arduino / General Electronics / Re: RF Transmitter and Receiver WRL-10535 and WRL-10533 on: October 09, 2012, 12:09:44 pm
Thanks!

But I've ran into another problem, the VirtualWire library is hard to understand.

I'm using a DHT11 to measure the temperature, now getting the readings from the DHT11 is easy, getting em shown in the serial monitor is easy.

Problem comes when I want to send the readings using VirtualWire, thats hard smiley-razz Or I'm sure I'm missing something...

This is my code:

Problems starts in "char *msg = char(DHT11.temperature);" it seems.

Code:
// transmitter.pde
//
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
//
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (mikem@open.com.au)
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

// dewPoint function NOAA
// reference: http://wahiduddin.net/calc/density_algorithms.htm
double dewPoint(double celsius, double humidity)
{
double A0= 373.15/(273.15 + celsius);
double SUM = -7.90298 * (A0-1);
SUM += 5.02808 * log10(A0);
SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
SUM += log10(1013.246);
double VP = pow(10, SUM-3) * humidity;
double T = log(VP/0.61078);   // temp var
return (241.88 * T) / (17.558-T);
}

// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(humidity/100);
double Td = (b * temp) / (a - temp);
return Td;
}


#include <dht11.h>

dht11 DHT11;

#define DHT11PIN 2

#include <VirtualWire.h>

int tempsend;
char tempconv;
char diddle;

void setup()
{
    Serial.begin(9600);  // Debugging only
    Serial.println("setup");
    Serial.println("DHT11 TEST PROGRAM ");
    Serial.print("LIBRARY VERSION: ");
    Serial.println(DHT11LIB_VERSION);
    Serial.println();

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000); // Bits per sec
}

void loop()
{
     Serial.println("\n");

  int chk = DHT11.read(DHT11PIN);

  Serial.print("Read sensor: ");
  switch (chk)
  {
    case 0: Serial.println("OK"); break;
    case -1: Serial.println("Checksum error"); break;
    case -2: Serial.println("Time out error"); break;
    default: Serial.println("Unknown error"); break;
  }

  //Serial.print("Humidity (%): ");
  //Serial.println((float)DHT11.humidity, 2);

  Serial.print("Temperature (oC): ");
  Serial.println(DHT11.temperature);


   char *msg = char(DHT11.temperature);

    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)msg, strlen(msg));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(2000);
 

}

Since it complains I can't do "'int' to 'char*'", I tried to set a char() conversion first. But then it complains about this "'char' to 'char*'". So I try to remove the * infront of MSG, but then I get the warning about a constant char...

I'm really confused here, anyone want to help me think this one out?

Sigh, I wish VirtualWire would have more examples showing how to send other values than 'const char'.
7  Using Arduino / General Electronics / Re: RF Transmitter and Receiver WRL-10535 and WRL-10533 on: October 08, 2012, 02:03:45 pm
So, I'm testing the RF434, with VirtualWire. And is there a way to make it translate what it recieved into a text? Instead of hex codes for each letter.
8  Using Arduino / Displays / Re: Any serial-LCD kits that are larger than 20x4 out there? on: October 07, 2012, 02:02:24 am
Quote
I've been looking for a serial lcd display that either has more lines, or more chars on each line than the regular 20x4 ones. and that comes bundled with a lcd driver.

Not sure "regular" you are referring to but many graphics lcds go (way) above that and many of them are serial.


Any recommendations for a "starter" graphic-LCD?
The GLCD? http://www.ebay.com/itm/Arduino-LCD-Shield-Pro-GLCD-128x64-LCD-/130567092608?pt=LH_DefaultDomain_0&hash=item1e6667b980
9  Using Arduino / Displays / Any serial-LCD kits that are larger than 20x4 out there? on: October 05, 2012, 04:01:23 pm
I've been looking for a serial lcd display that either has more lines, or more chars on each line than the regular 20x4 ones. and that comes bundled with a lcd driver.

Anyone know of some?
10  Community / Exhibition / Gallery / LEDs blinking to music beats on: December 20, 2011, 08:50:02 am
Made this simple yet cool led blinker, it just blinks several leds depending on how loud the sound is.
It's pretty neat and blinks perfectly to beats. It looks much better in real action rather than on the video
because of the fps. But you get the idea of how it looks.





I also did a quick tutorial on my blog for this: http://stigern.net/blog/?p=332
11  Topics / Education and Teaching / C# Communicating with Arduino over Serial on: December 20, 2011, 08:05:13 am
I've done a small tutorial on howto turn on and off a led with serial from C# to a Arduino.



Can be read here -> http://stigern.net/blog/?p=349
12  Using Arduino / General Electronics / Measuring it's own voltage from batteries 4,5 volts on: December 04, 2011, 10:30:42 am
Well, I'm working on a small robot, and I need a way to measure the voltage on the batteries. So far I've just hooked + up to the analog0, and gets a value. But it seems like the analog reference gets lowered to the voltage the arduino is getting fed with.

Are there a way around this?
13  Using Arduino / Sensors / Re: HC-SR04 & Arduino 1.0 with Ultrasonic library error compiling on: December 03, 2011, 09:25:31 am
Ah, found the solution here http://arduino.cc/pipermail/developers_arduino.cc/2011-September/005668.html

So I updated the library to work with 1.0. Get it here:
http://stigern.net/forum/viewtopic.php?f=5&t=34
14  Using Arduino / Sensors / [SOLVED] HC-SR04 & Arduino 1.0 with Ultrasonic library error compiling on: December 03, 2011, 08:40:39 am
Well, I've just downloaded the Ultrasonic library for the HC-SR04: http://iteadstudio.com/produce/cheap-cheap-ultrasonic-ranging-modulehc-sr04/

And in Arduino 022 it compiles perfectly with no errors, but when using the library in Arduino 1.0 I get this error:

Code:
In file included from UltrasonicDemoMod.cpp:1:
D:\Programming\Arduino\Arduino\libraries\Ultrasonic/Ultrasonic.h:11:22: error: WProgram.h: No such file or directory

My project code is the following:
Code:
#include "Ultrasonic.h"
Ultrasonic ultrasonic(12,13);

void setup()
{
  Serial.begin(9600);
  Serial.print("testing...");
}

void loop()
{
  Serial.print(ultrasonic.Ranging(CM));
  Serial.println(" cm.");
  delay(100);
}


How come WProgram.h is no more in Arduino 1.0? or maybe it has been renamed?
15  Using Arduino / Programming Questions / Re: Error when writing to arduino using the WebServer ethernet example. on: October 22, 2011, 02:17:32 am
I select that board type and compiled just fine. Perhaps you need to uninstall and reinstall the Arduino IDE.

This is strange, I decided to try and unpack the Arduino IDE one more time. But instead of overwriting the files, I deleted the old ones first. And now it's compiling ! Thanks for all the great help, and I'm sorry for not trying this in the first place smiley-razz
Pages: [1] 2 3 ... 6