Lux Twitter Tweet Bot (Python / Raspberry Pi)

Twitter tweet bot now with Lux levels

Last month I added a Pimoroni breakout garden with a temperature/pressure sensor to my Raspberry Pi, and built a whole project around it. As the breakout garden has 2 additional slots that were empty I have decided to use one for the LTR-559 (sadly to my knowledge not a droid in Star Wars) Light & Proximity Sensor.

geektechstuff_lux_sensor
LTR-559 Light & Proximity Sensor

I am going to use the sensor to measure illuminance (light) in the room. These light measurements are done in Lux. The Python for using the sensor is just a few lines.

geektechstuff_lux_python_tweet
get_lux() function

With the additional lines of Python, the Twitter tweet bot now reports:

  • Room temperature and pressure from the BMP280 sensor
  • Time from the Python using datetime
  • CPU temperature from Python using gpiozero
  • Lux level from the LTR-559 sensor

The Tweet bot tweets every 30 minutes as the Python program is called at 30 minute intervals via a scheduled cron job.

geektechstuff_a_tweet_lux
Twitter tweet bot now with Lux levels

 

The Python script for this project can be found on my GitHub at:

https://github.com/geektechdude/twitter_sensor

The LTR-559 can be purchased via Pimoroni at:

https://shop.pimoroni.com/products/ltr-559-light-proximity-sensor-breakout

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.