Damm I am trying to get this working with a Arduino pro mini ,,but no luck wanted to use it in the car ..
How do you wire the NRF24L01+ ???
N-Channel Mosfet s ??? model number please any help much appreciated
I have tried mosfets >>>irf510n
I have success!
(oops, that's suppose to be Timer1)
I only sample for 1/60 of a second. What I did was to back up all the timer registered I used and then resorted them after I was done sampling. (As opposed to initializing the registers in setup and then starting the timer when needed.)
Now I have a Nano sampling the data and sending it to a MySensors Gateway on an RPi3B+ which then sends it to an MQTT broker runing on an old laptop. Also running on the laptop is Home Assistant running inside of VirtualBox.
If MySensors does use Timer1, it appears that restoring the registers allows it to be shared.
//------------------------------------------------------ISR
ISR(TIMER1_OVF_vect){ // interrupt service routine for overflow
TCNT1 = TimerPreloadValue; // must be first line! starts the timer counting again
digitalWrite(TRIGGER_START_SAMPLE_PIN,HIGH);
samplesVolts[--sample]=analogRead(VOLTS_IN_PIN); // decrement before capturing
samplesCurrent[sample]=analogRead(CURRENT_IN_PIN);
digitalWrite(TRIGGER_START_SAMPLE_PIN,LOW);
if (!sample){ // count down to zero
digitalWrite(TRIGGER_START_SAMPLE_PERIOD_PIN,LOW); // indicate that sampling is complete
samplingEnd = micros();
TCCR1B &= 248; // turns off timer
}
}
//------------------------------------------------------sampleOneCycle
void sampleOneCycle(){
// back up timer registers
uint8_t TCNT1_b = TCNT1;
uint8_t TCCR1B_b = TCCR1B;
uint8_t TCCR1A_b = TCCR1A;
uint8_t TIMSK1_b = TIMSK1;
// configure timer which starts the sampling
noInterrupts(); // disable all interrupts
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = TimerPreloadValue; // preload timer
//TCCR1B |= (1 << CS10)|(1 << CS12); // 1024 prescaler
TCCR1B &= 248; // turns off timer?
TIMSK1 |= (1 << TOIE1); // enable timer overflow interrupt ISR
// demark sampling
sample = NUMBER_OF_SAMPLES; // count down to zero
digitalWrite(TRIGGER_START_SAMPLE_PERIOD_PIN,HIGH);
samplingStart = micros();
TCNT1 = 65535; // first trigger right away!
TCCR1B |= 1; // turns on timer
interrupts(); // enable all interrupts
// wait for sampling to be complete
while(digitalRead(TRIGGER_START_SAMPLE_PERIOD_PIN)){};
samplingEnd = micros();
// restore timer registers
TCNT1 = TCNT1_b;
TCCR1B = TCCR1B_b;
TCCR1A = TCCR1A_b;
TIMSK1 = TIMSK1_b;
}
@Tmaster What I meant by my previous comment was to tap on the Node name to see what sensors were connected - Had you clicked on TANQUE you would have seen a box pop up below giving you all the children to that particular Node with what value was last updated and when, so you could easily have found out all about your mysterious 13 children.
At least you have it sorted now, but it pays to do a bit of housekeeping in the sketch setup and Domoticz - eg which of the 6 "Unknown" Nodes is the one you want to next have a look at ?
All my Node IDs are set at the Node, and the sketch name labels the Node ID also, the Nodes are named in Domoticz for easy identification.
In the sketch my sensors are numbered sequentially and commented on what they are, so naming them in Domoticz becomes very much easier.
Hi
This is a typical homer project in that I spend half an hour here and half an hour there so it moves very slowly!
What I have so far:
Plan for 10-15 zone heating control based on standard Y plan heating system. I need to generate control signals for:
Boiler on
DHW valve on
Heating valve on
*12-13 radiator valve heads (24v DC)
a) Domoticx setup based on a list of zones - the lua scripts are maybe 75% done and working so far - needs tweaks and tidying up before its shareable sensibly.
b) Battery powered sensor/ display node arduino based. Has dallas DS1820 temp sensor, 128 x 64 Oled display and three buttons using mysensors 2.4Ghz radio. It links with domoticz, displays (on demand) the room temp, setpoint and the buttons allow local control - boost/cut temp to xDeg for 1 hr. The sensor runs off 2 x AAA cells and takes 11uA standby with pulses of 25mA so could just run off a coin cell for 12-18months. The code is 80-90% complete but haven't started a PCB yet.
c) Dallas one wire sensors for some rooms where I am not bothering with a local display node. Also to be used for DHW and outside temperature for display/prediction.
d) Some 24vDC thermal actuators for the radiators - that's the biggy and now won't happen till next year and the heating is off. I also need to replace some valve bodies on some radiators so it will need (at least) a day off work at some point to do all the plumbing.
e) Android front end based on Netio - tried open remote but found that a bit long winded. This is 20% complete - just done 2 zones to prove the concept. This will drive a wall mounted tablet replacing the old room stat and also be the interface from my phone etc when away from home.
f) I haven't started boxing up the RPI - it needs a 24cDC 2-3 amp PSU for the radiator valves and wiring to all rooms - yuk!
This may wet your appetite but it is very much a work in progress and wouldn't make much sense if I published it yet. I'll post bits as they become meaningful - but its a way away yet.
If nothing else it tells you what's possible. That has taken me quite a bit of experiment to get this far.I've tried at least 5 different home automation packages and have now settled on Domoticz and Netio front end. At least - now I am on the implementation phase!
Regards
Coppo