Thibault
Published © GPL3+

ThiDom Home Automation

This project uses Arduino, Raspberry and Attiny, it allows you to control and monitor your home.

IntermediateShowcase (no instructions)6,186
ThiDom Home Automation

Things used in this project

Hardware components

nrf24l01
×5
switch reed
×1
Relay (generic)
×1
Atmel ATTiny84
×1
Maxim Integrated DS18B20
×1
Raspberry Pi 1 Model B+
Raspberry Pi 1 Model B+
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Opening detector

Schema aqzjhgzhuv

Code

Opening detector

Arduino
#include <RF24Network.h>
#include <RF24.h>
#include <PinChangeInterrupt.h> 
#include <init_variable_attiny.h>
#include "check_btn.h"

const byte this_node = 1;
const byte other_node = 0;

void setup() { 
	pinMode(csn_pin, OUTPUT); 
	attachPinChangeInterrupt(digitalPinToPCINT(2),check_btn,FALLING); 
	radio.begin();
	network.begin(95, this_node);
	radio.setDataRate(RF24_250KBPS);   
}

void check_btn(void)
{
  detectchange = true; 
}

void loop() {   
	if (detectchange) {    
		digitalWrite(csn_pin,HIGH);
		radio.powerUp(); 
		SendDataRF24('open',other_node); 
		detectchange = false; 
	} 
}

Credits

Thibault

Thibault

1 project • 5 followers
Contact

Comments