Tracker01: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
 
(9 intermediate revisions by the same user not shown)
Line 8: Line 8:


1 ADS1015 with two [https://en.wikipedia.org/wiki/Photoresistor Photo Resistors]
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 ==
== System config ==
apt-get install i2c-tools


All devices are i2c.
All devices are i2c.


Address  Device
Address  Device
0x40    HTU21 ( hardcoded, static )
0x41    INA219 ( defaults to 0x40, I shorted A0 toget 0x41 )
0x48    ADS1015 ( default )


<pre>
<pre>
Line 51: Line 72:
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $
pi@raspberrypi:~/Adafruit_Python_ADS1x15/examples $
</pre>
</pre>
[[INA219 test.py]]


== Code ==
== Code ==
[[Htu21d.py]]


== References ==
== References ==


* https://arduino.stackexchange.com/questions/24888/counting-adc-samples-using-a-light-sensor
* 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: