Things used in this project

Hardware components:
475267 240424 01 front zoom kankcmvqdh
Raspberry Pi Zero Wireless
×1
11868 00a
Raspberry Pi Camera module
×1
Adafruit Raspberry pi zero v1.3 camera cable
×1
Adafruit Raspberry pi camera board case
×1
Pimoroni LiPo SHIM
×1
Attiny85
Microchip ATTiny85
×1
SparkFun 8-pin DIP socket
×1
ALL POWERS 2.5W 5V 500mAh solar panel
×4
tp4056 lithium charging module
×4
3 x 2 Velleman Plastic Project Case
×1
bh1750 lux sensor module
×1
1N4001 diode
×4
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)

Schematics

squirrel haus fritzing schematic
bh1750_attiny85_vX8QGZm7mT.fzz

Code

attiny85_bh1750 codeArduino
// Thanks to:
// Spence Konde for his ATTinyCore library!
// https://github.com/SpenceKonde/ATTinyCore
// and 
// claws for his BH1750 library!
// https://github.com/claws/BH1750

#include <Wire.h>
#include <BH1750.h>

BH1750 lightMeter;
const int enablePin = 3;

void setup(){
 pinMode(enablePin, OUTPUT);
 digitalWrite(enablePin, HIGH);
 Wire.begin();
 delay(125);
 lightMeter.begin(BH1750::ONE_TIME_HIGH_RES_MODE);
}

void loop() {
 delay(125);
 // READ FROM BH1750
 uint16_t lux = lightMeter.readLightLevel();

 if (lux < 100) {
   digitalWrite(enablePin, LOW);
 } else {
   digitalWrite(enablePin, HIGH);
 }
 delay(60000 * 5);
}

Credits

B73e816c052129e84a46245ae4f6b7c3
reichley
2 projects • 1 follower
__hypernova_render_token[c199fdde74395f9aa42df5241a3df370]__Contact

Comments