What am I missing ( using a 3v Arduino w/5v sensor )

Problem:

Cannot get reading from the DHT22 sensor, using the Fio.

Hardware list:

1.) Arduino Fio

2.) Humidity and Temperature Sensor - DHT22

3.) NCP1400-5V Step-Up Breakout

4.) Barometric Pressure Sensor - BMP085 Breakout

5.) Xbee v1

Known variables:

1.) DHT22 works, checked using the Uno w/ 5v in

2.) DHT22 won’t work using the Uno with 3v in

3.) DHT22 won’t work using the Fio w/5v step-up

4.) The Fio works, Xbee works, the BMP085 works on the Fio ( uses 3v )

5.) 5v step-up is taking the <4v LiP voltage and outputting 5v

Where I think Im going wrong:

Using the 5v Step-up correctly, my digital output is sending 5v to a 3v board? Am I washing out my reading??

If I need to step my data line back down to 3v I need some instruction…if I do this will I have to make changes to my sketch? (will copy it below it uses a DHT library )

Current Wiring configuration:

1.) The 5v Step-up is soldered to the Fio’s battery access points on the board, just slightly distal to the battery plug.

2.) The Sensor’s ground is connected to the Fio’s ground pin on the Analog side

3.) Sensor’s signal/data line is connected to the Fio’s digital pin 2

Quick overview:

I tried using the DHT22 w/3v (on both the Uno & Fio) and the program returns the error “Failed to read from DHT” ( using ladyada’s DHT sketch ) After connecting the sensor to the 5V step-up, the error clears out but it is not returning any data.

Thank you to whoever is able to spend their time helping me get back on track, It’s very much appreciated.

#include “DHT.h”

#include <Wire.h>

#include <BMP085.h>

#define DHTPIN 2 // what pin we’re connected to

#define DHTTYPE DHT22 // DHT 22 (AM2302)

// DHT22 DETAILS

// Connect pin 1 (on the left) of the sensor to +5V

// Connect pin 2 of the sensor to whatever your DHTPIN is

// Connect pin 4 (on the right) of the sensor to GROUND

// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor

// BMP085 DETAILS

// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)

// Connect GND to Ground

// Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5

// Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4

// EOC is not used, it signifies an end of conversion

// XCLR is a reset pin, also not used here

DHT dht(DHTPIN, DHTTYPE);

BMP085 bmp;

void setup() {

Serial.begin(57600);

bmp.begin();

dht.begin();

}

void loop() {

// Reading temperature or humidity will cycle 3500 milliseconds

// Reading pressure will cycle 5000 milliseconds

float h = dht.readHumidity();

float t = dht.readTemperature();

// check if returns are valid, if they are NaN (not a number) then something went wrong!

if (isnan(t) || isnan(h)) {

Serial.println(“Failed to read from DHT”);

} else {

Serial.print("Humidity: ");

Serial.print(h);

Serial.print(" %\t");

Serial.print("Temperature: ");

Serial.print( (t * 9)/ 5 + 32 ); // converts to fahrenheit

Serial.println(" degrees Fahrenheit");

delay (3500);

Serial.print("Pressure = ");

Serial.print(bmp.readPressure());

Serial.println(" Pa");

delay (5000);

}

}

WOW!!!

I got it working, I was wrong about it being an issue with my hardware…

Something is not working in the ladyada example sketch I used, I loaded the dht22 library and example sketch instead and its working fine…

For other new folks out there reading this, it looks like the 5v step-up breakout is all that’s needed to get a 5v sensor to work on a 3.3V Arduino. ( unless someone knows otherwise )

Well now I want to know whats wrong with the other sketch so my lesson is complete… :mrgreen: