Show Posts
Pages: [1] 2
1  Using Arduino / Sensors / Re: DS18B20 with Multiple I/O Lines on: March 18, 2014, 03:22:33 pm
Rob,

I am also new to Arduino and have a question about the code you posted for putting DS18B20 sensors on separate ports. I have tested your code and it does work, however, I would like for it to not only display in degrees C but if degrees F as well and have no idea how to do that. Can you help ?

Thanks
2  Using Arduino / Programming Questions / Display DS18B20 High and Low Temperatures on: March 11, 2014, 09:28:38 am
I am working with the following sketch and would like to be able to not only show the current temperature but the lowest and highest temperatures for that day. Can this be done from within the sketch and if so how ?

// This Arduino sketch reads DS18B20 "1-Wire" digital
// temperature sensors.
// Tutorial:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-tutorial.html

#include <OneWire.h>
#include <DallasTemperature.h>

// Data wire is plugged into pin 3 on the Arduino
#define ONE_WIRE_BUS 3

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// Assign the addresses of your 1-Wire temp sensors.
// See the tutorial on how to obtain these addresses:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

DeviceAddress insideThermometer = { 0x28, 0xEB, 0x34, 0x99, 0x05, 0x00, 0x00, 0x13 };
DeviceAddress outsideThermometer = { 0x28, 0x6B, 0xDF, 0xDF, 0x02, 0x00, 0x00, 0xC0 };
DeviceAddress dogHouseThermometer = { 0x28, 0x59, 0xBE, 0xDF, 0x02, 0x00, 0x00, 0x9F };

void setup(void)
{
  // start serial port
  Serial.begin(9600);
  // Start up the library
  sensors.begin();
  // set the resolution to 10 bit (good enough?)
  sensors.setResolution(insideThermometer, 10);
  sensors.setResolution(outsideThermometer, 10);
  sensors.setResolution(dogHouseThermometer, 10);
}

void printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  if (tempC == -127.00) {
    Serial.print("Error getting temperature");
  } else {
    Serial.print("C: ");
    Serial.print(tempC);
    Serial.print(" F: ");
    Serial.print(DallasTemperature::toFahrenheit(tempC));
  }
}

void loop(void)
{
  Serial.print("5 Minute Delay between Readings..\n\r");
  delay(300000);
  Serial.print("Getting temperatures...\n\r");
  sensors.requestTemperatures();
 
  Serial.print("Inside temperature is: ");
  printTemperature(insideThermometer);
  Serial.print("\n\r");
  Serial.print("Outside temperature is: ");
  printTemperature(outsideThermometer);
  Serial.print("\n\r");
  Serial.print("Dog House temperature is: ");
  printTemperature(dogHouseThermometer);
  Serial.print("\n\r\n\r");
}

As you will see in the sketch, I have a 5 minute delay between each reading. There is no need for it to display the temperatures every few seconds.
3  Using Arduino / Project Guidance / Re: Hardware Assistance on: January 16, 2014, 11:23:18 pm
Thanks guys, I appreciate the feedback. I have done an update and I believe I have it correct.  Take a peek.

Greg
4  Using Arduino / Project Guidance / Re: Hardware Assistance on: January 16, 2014, 04:32:58 pm
Thanks Paul,

This is what I came up with. Let me know what you think.


5  Using Arduino / Project Guidance / Hardware Assistance on: January 16, 2014, 02:53:20 pm
I am new to the Arduino and own an UNO.

I would like to attempt to connect a 12V, 10W LED Floodlight as shown in the link below and make it flash. My question is how to get enough current to drive it. The light itself has a 12V LED driver built-in so I don't think I need to change that part.

Should I use a FET or high power transistor ?  I am thinking of using an N-Channel FET and switching the negative side of the LED.

Any other ideas are appreciated.

http://www.ebay.com/itm/310472744321?var=610139277563&ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2648
6  Using Arduino / LEDs and Multiplexing / Re: WS2801 & WS2803 on: November 10, 2012, 10:20:08 am
Thanks for the reply. I either missed seeing Figure 8 or forgot it was there. Silly me. The MOSFET's I'm using are NXP SI2302DS. They come in a SOT-23 package and are capable of sinking up to 2.5A each. So there should be plenty of current to run several RGB LED's.
7  Using Arduino / LEDs and Multiplexing / WS2801 & WS2803 on: November 09, 2012, 05:34:48 pm
I have ordered a few samples of these chips but have a couple of questions.

The WS2801 requires 3 separate resistors to set the current. If I wanted to use one of these chips to drive an RGB LED strip, I would take the 3 outputs of the chip and use it to drive 3 MOSFET's. Since the strips are already current limited, do I still need to use the resistors ?


In regards to the WS2803, to use this chip with RGB strips I would do the same as above, however, does it make much difference which pins go to which color ? ie. If I had 6 RGB LED's could I take all the Red lines and run them to OUT1-OUT6, the Blue to OUT7-OUT12, and the Green to OUT13-OUT18  or do the have to be RGB, RGB, RGB, etc. ?
8  Using Arduino / Microcontrollers / Using Arduiuno UNO ISCP port on: December 14, 2011, 07:26:51 pm
Can I use the UNO to program a 2313 chip which is on an external board ? The board I am looking at is here: http://allgaiershops.com/product_info.php?cPath=22&products_id=34

9  Using Arduino / Microcontrollers / Re: ATTiny 25/45/85/2313 Pin numbers on: December 13, 2011, 11:55:11 am
Thanks charlie_dream now I understand. We aren't using the actual pin numbers of the chip itself. We're using the pin 'function'. In the case of the ATTiny 45, physical pin 5 is PB0. Therefore we're referencing 0 (zero) like digitalWrite(0, HIGH); zero referring to PB0 of the chip.

Duh on me. I guess I need to read a little better.  LOL
10  Using Arduino / Microcontrollers / Re: ATTiny 25/45/85/2313 Pin numbers on: December 13, 2011, 10:32:35 am
Thanks for the replies.

However, I still don't understand why the physical pin numbers of these chips aren't used in the sketch like they are if you are using the 328 on the main Arduino board ?
11  Using Arduino / Microcontrollers / ATTiny 25/45/85/2313 Pin numbers on: December 13, 2011, 02:13:18 am
I have successfully programmed ant ATTiny 45 with my Arduino UNO. Since I am new to the Arduino community I have a couple of questions to ask.

What I don't understand is why the chips physical pin numbers aren't used in the sketch ? When I programmed the Tiny 45, I used phydical pin 5 on the chip but in the sketch it's known as pin 0.

If I wanted to use the ATTINY 2313, ATTiny 84, ATTiny 85, what are the physical chip pins known as in the sketch ?

 
12  Using Arduino / Programming Questions / Re: Arduino with AtTiny45 on: November 18, 2011, 05:49:34 pm
I have not tried it yet. I am simply wondering if the structure is correct.
13  Using Arduino / Programming Questions / Re: Arduino with AtTiny45 on: November 18, 2011, 02:46:55 pm
Code:
/*
  Blink
 Turns on an LED on for one second, then off for one second, repeatedly.
 
 This example code is in the public domain.
 */

void setup() {               
  // initialize the digital pin as an output.
  // ATTINY45 Pins 5,6,7 have an LED connected:
  pinMode(0, OUTPUT);  //ATTINY45 Pin 5
  pinMode(1, OUTPUT);  //ATTINY45 Pin 6
  pinMode(2, OUTPUT);  //ATTINY45 Pin 7
}

void loop() {

  digitalWrite(0, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(0, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(1, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(1, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(2, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(2, LOW);    // set the LED off
  delay(1000);              // wait for a second
}
14  Using Arduino / Programming Questions / Re: Arduino with AtTiny45 on: November 18, 2011, 02:14:01 am
Sorry about that.


/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {               
  // initialize the digital pin as an output.
  // ATTINY45 Pins 5,6,7 have an LED connected:
  pinMode(0, OUTPUT);  //ATTINY45 Pin 5
  pinMode(1, OUTPUT);  //ATTINY45 Pin 6
  pinMode(2, OUTPUT);  //ATTINY45 Pin 7
}

void loop() {
 
  digitalWrite(0, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(0, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(1, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(1, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(2, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(2, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

15  Using Arduino / Programming Questions / Re: Arduino with AtTiny45 on: November 17, 2011, 10:26:48 am
Thanks for the feedback. Therefore, my sketch should like like this :

Quote
/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

void setup() {               
  // initialize the digital pin as an output.
  // ATTINY45 Pins 5,6,7 have an LED connected:
  pinMode(0, OUTPUT);  //ATTINY45 Pin 5
  pinMode(1, OUTPUT);  //ATTINY45 Pin 6
  pinMode(2, OUTPUT);  //ATTINY45 Pin 7
}

void loop() {
  
  digitalWrite(0, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(0, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(1, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(1, LOW);    // set the LED off
  delay(1000);              // wait for a second
  digitalWrite(2, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(2, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

Pages: [1] 2