Author Topic: Level-Shifter use?  (Read 12371 times)

Techno

  • Newbie
  • *
  • Posts: 26
Level-Shifter use?
« on: January 21, 2014, 06:28:31 pm »
I an new to level-shifting shield and do not want to destroy thr Digix board.  I have three devices that function best on 5 Volts (DS1307, DHT22, and BY-65.)
Two of the devices use I2C bus and the third uses an analog input.

I believe I need to use A4, A5 for I2C with jumpers set to the I2C side and use A3 as an output for the DHT22. 

Is this all there is to using the level-shifter?  I understand i need to go from 5 Volt to 3.3 Volt --a little nervous about destroying one or both boards.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Level-Shifter use?
« Reply #1 on: January 22, 2014, 10:57:50 pm »
If you set the I2C jumpers to A4,A5 then you can connect to the 5V I2C on the A4,A5 pins on the level shifter.

For the DHT22 it needs a digital pin so you could set A3 to output and use it or use any of the digital pins on the level shifter.

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #2 on: January 23, 2014, 05:05:48 pm »
Thank you digistump.

Is this the correct setup?  I have the jumpers set for A4, A5 (I2c side are jumperless.)  I set A3 jumper to the output side.

I have attached a photo.  Photo was taken before I moved A3 to output side. 

William
« Last Edit: January 23, 2014, 05:07:58 pm by Techno »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Level-Shifter use?
« Reply #3 on: January 24, 2014, 03:25:03 am »
A4 and A5 should be set to output as well - so that they get connected to the I2C level shifter

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #4 on: January 25, 2014, 08:30:48 am »
I  have set A4, A5, and A3 as output on the Level-Shifter Shield.  I have no sensor output readings with the Level-Shifter on the Digix.   Same sensor wiring on Arduino Mega 2560 has expected senor readings.

Voltage check at sensors show 5.02 Volts.  Are there any other connections to the level shifter required?  An example would be useful to go with the overview tutorial.

Any additional troubleshooting I can do?

William
« Last Edit: January 25, 2014, 12:01:09 pm by Techno »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Level-Shifter use?
« Reply #5 on: January 25, 2014, 12:41:46 pm »
Did you change all Wire calls to Wire1?

The level shifter uses the upper left I2C which is called by Wire1 not Wire

Of course that should be documented - I'll try to get the final docs with examples up this weekend - sorry for the delay

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #6 on: January 25, 2014, 01:35:02 pm »

Would this be all calls to Wire be changed to Wire1 in all the sensor libraries or just when wire is called in the sketch?

I tried just the one in the sketch; same result, no sensor data.  I do not understand; however, I will wait on documentation and example.

Thank you.

William
« Last Edit: January 25, 2014, 02:57:29 pm by Techno »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Level-Shifter use?
« Reply #7 on: January 28, 2014, 01:59:55 am »
Are you connecting your I2C wires to A4 and A5 or to SDA/SCL?



Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #8 on: January 28, 2014, 08:03:42 am »
I2C connections from sensors are connected to A4 and A5.  Should these be change to the upper right SDA/SCL on the Level-Shifter Shield?

I changed Wire and to Wire1 in the I2C sensor libraries I am using with Digix project.  DS1307 is using the RTCTimedEvent library; this part of the project is working now; with no Pull-up resistors.

BMP085 and DHT22 are not working.  BMP085 is using the Adafruit BMP085_Unified driver with Adafruit Sensor library, recommended in this Forum --modified all occurrences of Wire to Wire1.  DHT library is the one recommend on this Forum.

None of the sensor wiring has been change from when using the Arduino Mega 2560.

Pull-up resistors for I2C with the Arduino Mega 2560 were 4K7.  Do I need to use/change the value of these Pull-up resistors?
« Last Edit: January 28, 2014, 05:40:59 pm by Techno »

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #9 on: January 29, 2014, 08:21:55 pm »
Grounded EOC connection on the BMP085 and changed pull-up resistors to 10K on I2C bus.  Getting readings now.

Still working on getting readings from the DHT22.

William

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Level-Shifter use?
« Reply #10 on: January 29, 2014, 11:25:15 pm »
Which pin and library are you using with the DHT22?

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #11 on: January 30, 2014, 12:16:38 pm »
Using pin A3 and Rob Tillaart's DHTlib library.

William

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Level-Shifter use?
« Reply #12 on: January 30, 2014, 12:56:15 pm »
That could be it - the input mode for the analog pins is for Analog input - since that is a Digital input you can leave the jumper set as OUTPUT for that pin or use a digital pin

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #13 on: February 01, 2014, 04:44:03 am »
Nothing I have tried allows the DHT22 to work with Digix.  As stated elsewhere here on the forum; maybe an issue with rise/fall timing being changed by the level-shifter.  I am no expert on this subject; however, every library I have tried has time out issue.

Has anyone been successful in getting a DHT22 humidity and temperature sensor to work with the Digix?  What library are you using?  What changes if any were needed to make it work with the Digix?

DHT22 Sensor is good; sensor works fine with Arduino Mega 2560.


William
« Last Edit: February 01, 2014, 09:24:04 am by Techno »

Techno

  • Newbie
  • *
  • Posts: 26
Re: Level-Shifter use?
« Reply #14 on: February 05, 2014, 05:01:44 pm »
Attaching preliminary code "wwdl_adafruit.ino".    Written for the Digix; requires DS1307, BMP085, and DHT22 to run code and Digistump Level-Shifter Sheild.
Code reads sensors every 15 minutes, writes data serially, logs to SD card, and Displays webpage.

Having issue as stated previously in this thread.  Hoping someone with required components can run the code.

Interested in result of running the code.  How do Barometric Pressure readings compare to "other sources", ie radio, National Wearther Service observations?  My Barometric Pressure readings have been off ~ 1.00 in. Hg.  Also, I am not getting readings from the DHT22 sensor, getting "Time Out Error" messages when running Rob Tillaart's DHT22_test.ino from his DHT library v 1.08.

William
« Last Edit: February 07, 2014, 06:45:28 pm by Techno »