Tracker01: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Hardware ==
== Hardware ==


1 pi zero
1 [https://www.raspberrypi.org/products/raspberry-pi-zero/ pi zero]


1 INA219 current sensor
1 [https://www.adafruit.com/product/904 INA219] current sensor.


1 HTU 21 temp/humidity sensor
1 [https://learn.sparkfun.com/tutorials/htu21d-humidity-sensor-hookup-guide HTU21] temp/humidity sensor


1 ADS1015 with two [Photo Resistors|https://en.wikipedia.org/wiki/Photoresistor]
1 ADS1015 with two [https://en.wikipedia.org/wiki/Photoresistor Photo Resistors]
 
[[Image:tracker01_whole_setup.jpg]]
 
== Light Dependent Resistor Tests ==
 
Lit room to dark room voltage drop:
 
resistor lots of light  lit      dark   
---      ---            ---      ---
1k      1.72V          3.26V    3.27V
23k      1.13V          3.17V    3.2V
 
Photo:
 
[[Image:ldr_resistors.jpg]]
 
== System config ==
 
apt-get install i2c-tools
 
 
All devices are i2c.
 
Address  Device
0x40    HTU21 ( hardcoded, static )
0x41    INA219 ( defaults to 0x40, I shorted A0 toget 0x41 )
0x48    ADS1015 ( default )
 
<pre>
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $ i2cdetect -l
i2c-1  i2c            bcm2835 I2C adapter                    I2C adapter
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $ i2cdetect -F 1
Functionalities implemented by /dev/i2c-1:
I2C                              yes
SMBus Quick Command              yes
SMBus Send Byte                  yes
SMBus Receive Byte              yes
SMBus Write Byte                yes
SMBus Read Byte                  yes
SMBus Write Word                yes
SMBus Read Word                  yes
SMBus Process Call              yes
SMBus Block Write                yes
SMBus Block Read                no
SMBus Block Process Call        no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                  yes
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $ i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 41 -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $
</pre>
 
[[INA219 test.py]]
 
== Code ==
 
[[Htu21d.py]]
 
== References ==
 
* https://arduino.stackexchange.com/questions/24888/counting-adc-samples-using-a-light-sensor
 
* https://www.digikey.ca/en/resources/conversion-calculators/conversion-calculator-resistor-color-code-5-band
 
Also See:
 
* https://github.com/drthornt/htu21d-exporter

Latest revision as of 14:07, 10 July 2020

Hardware

1 pi zero

1 INA219 current sensor.

1 HTU21 temp/humidity sensor

1 ADS1015 with two Photo Resistors

Light Dependent Resistor Tests

Lit room to dark room voltage drop:

resistor lots of light   lit      dark     
---      ---             ---      ---
1k       1.72V           3.26V    3.27V
23k      1.13V           3.17V    3.2V

Photo:

System config

apt-get install i2c-tools


All devices are i2c.

Address  Device
0x40     HTU21 ( hardcoded, static )
0x41     INA219 ( defaults to 0x40, I shorted A0 toget 0x41 )
0x48     ADS1015 ( default )
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $ i2cdetect -l
i2c-1   i2c             bcm2835 I2C adapter                     I2C adapter
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $ i2cdetect -F 1
Functionalities implemented by /dev/i2c-1:
I2C                              yes
SMBus Quick Command              yes
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $ i2cdetect 1
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 41 -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $

INA219 test.py

Code

Htu21d.py

References

Also See: