Lux Twitter Tweet Bot (Python / Raspberry Pi)

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

 

One response to “Lux Twitter Tweet Bot (Python / Raspberry Pi)”

  1. AutoTweeting WebLinks (Python) – Geek Tech Stuff Avatar

    […] bot using Python and automated it on a Raspberry Pi so that it would auto reply to tweets and tweet sensor readings. Then I used that Pi in a different project, and my Twitter bot (geektechstuff_a) went into […]

    Like

Welcome to GeekTechStuff

My home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect