@dbemowsk
indeed 3v3 is always safest setting Just set and forget it.
Posts made by Talat Keleş
-
RE: pro mini programming
-
RE: pro mini programming
It works okey, if other components are disconnected. Pro mini board and atmega for 3.3 and 5 v versions are identical (except xtal) and capable to work in either voltage level. My pro mini and voltage selectable ftdi never caused problem. (Just keep nrf out of circuit, supplying 5v isn't good for it)
-
RE: SCT-013-030 Energy Meter
@meanmrgreen
Sure you can use 3.3v for this. If you are using sct-013-000 version, adjust your burden according toBurden Resistor (ohms) = (AREF * CT TURNS) / (2√2 * max primary current)
where Aref =3.3 (or at worst case, it's lower than 3.3V- if battery powered)
Also don't forget to change calibration which isCurrent Calibration Constant = CT TURNS / burden resistor
-
RE: CH340G okay for sensors?
I'm using a ch340g usb-serial adapter for pro minis. No problem on Win7 and Linux Mint so far.
-
RE: 💬 Infrared Sender and Receiver
@ramoncarranza
Compiler complains about not understanding decode_type_t. It should be defined in .h file or maybe you defined it in sketch but there is a problem definetly.
Can you post whole sketch and IR library and error message if any other so we can check and test.By the way, I installed IRremote.h (v2.1.0) via library manager, and default sketch compiled without error on IDE 1.6.5 win7 and IDE 1.6.10 linux mint 17.
-
RE: What kind of capacitor is need for the NRF24L01+
I usually use 10uF/16v electrolitic if space permits. However last time I tried pro mini's non used raw regulator 10uF smd tantalum which I soldered directly on nrf pins and it works perfectly. Due to size and ease of use I guess I'll order some smd tantals.
-
RE: SCT-013-030 to measure watt
@dbemowsk
For precise wattage measurement you need transformer as you think. Irms*230.0 is just a rough estimation. You can measure outlet voltage and use that value in sketch for better estimation.With transformer you use calcVI() instead of Irms*230. i.e below sketch, that measure both I and V, and calculate power (watt and VA, and other AC related stuff):
#include "EmonLib.h" // Include Emon Library EnergyMonitor emon1; // Create an instance void setup() { Serial.begin(9600); emon1.voltage(2, 234.26, 1.7); // Voltage: input pin, calibration, phase_shift emon1.current(1, 111.1); // Current: input pin, calibration. } void loop() { emon1.calcVI(20,2000); // Calculate all. No.of crossings, time-out emon1.serialprint(); // Print out all variables }
-
RE: SCT-013-030 to measure watt
@dbemowsk said:
Now that I look at the case of the CT, I see that it says 1V. I am a bit stumpped on how to adjust the sketch to measure the 0.5v p-p rather than the 2.5v p-p that it uses in the sketch.
Your CT gives 1V already, there is nothing to change in sketch. That output is physical voltage on Analog pin. Just need to adjust calibration value to read correct Amps as:
Also, I am a bit confused on the calibration value (111.1) in this line:
emon1.current(1, 111.1); // Current: input pin, calibration.
Since you own 050
emon1.current(1, 50);
as calibration constant. All above calculations and given calibration values on web for 000 model.
My assumption would be that that is the actual incoming voltage for it to use in calculating the current. Is this correct? If this is the case, would it be possible to use a transformer say from an old wall wart that would take the line voltage and bring it down to say 6 - 12 volts and read that somehow on another analog pin to get a more exact value for the calibration?
I didn't clearly understand what you want to achieve. For current calibration you don't need voltage values. If you take apart a wall-wart you can use that for calculating real power, power factor etc.
-
RE: SCT-013-030 to measure watt
@dbemowsk
Short answer: Built-in burden versions output 1V for rated current. Therefore 030 version has 1V for 30A, and 050 has 1V for 50A current. Either 3.3 or 5V supply, 1Vrms swing is almost in ADC range. So you can use 1V output types in any system. Just adjust the calibration constant in sketch.Long answer: SCT-013-000 version user-selected burden let you control voltage output, so you can have i.e. 2.5Vp-p output for a 5V system or 1.65Vp-p for a 3.3V system to fully utilize ADC range.
Let's assume you select a burden for 1Vrms (±1.707 Vp-p) @50A (R=~28,28ohm) which will be identical to a 050 model, however selecting a burden for 1.76 Vrms (±2,49Vp-p)@50A will have better resolution (mV per ADC step) in a 5V system.
Ideal value calculation is stated as: Burden Resistor (ohms) = (AREF * CT TURNS) / (2√2 * max primary current) So, ~68 ohm will use whole 0-5V range (±2,49Vp-p) OR ~47 ohm in 0-3.3V (±1,66Vp-p) range and will have best resolution.
-
RE: Power Measurements
@skatun
Nowadays I'm also working on this consept. Openenergymonitor building blocks are very valuable source. Your idea is right about resistors however important component is AC-AC adapter (transformer) Otherwise line voltages are deadly to play with. Transformers isolate and step down this voltage.You can dismantle a charger or buy a resin-molded pcb transformer. Input this voltage to arduino after conditioning it via circuit you posted. Current transformer selection is up to you i.e maximum current you want to measure and enough output (mV/A - bigger is better) for desired resolution.
You may use same arduino to measure many current sensors and only 1 voltage sensing is enough per phase. I don't know how many of CT can be added a nano/pro in practical limits. I just have 2.
Meanwhile powering arduino via voltage sensing brach is not suggested however since you'll measure main line and will have big currents, arduino won't have much effect on that in my opinion.
For now just breadboard experimenting, If I design a pcb for this I'll share it.
-
RE: SCT-013-030 Energy Meter
@john7845
Error is related to missing library of DHT. If you will use DHT temperature/humidity sensor in your circuit, you should add DHT library to your Sketchbook/libraries folder. If you don't use that sensor, clear or comment out dht related codes in sketch. -
RE: SCT-013-030 Energy Meter
@patrick-schaerer said:
I alread updated to MySensors 2.0
I just got my sct-013-000 non-burden version and will try it as soon as atmega+nrf packs arrive. Thanks for code update.
Meanwhile what is "msgKWH" for? What is different than "kwhMsg"? Which controller do you use? -
RE: Stupid question regarding getting open hab to read and send serial commands
I'm not using windows10 however can you try Mysensors openHAB v1 binding or v2 whichever OH version you run. That way OH can understand serial api format, otherwise i think some rules should deployed to understand incoming serial messages.
Also it may be "user rights" thing. Does OH run as admin? -
RE: 💬 Infrared Sender and Receiver
Below is node sketch (v1.5.4) and openhab sitemap&items for simple control. More advanced control needs rules/scripts to make it more automation like.
Set up the circuit, load below code or example code given and open serial monitor. Press buttons on IR remote and read hex values on serial. Note down values for buttons you need. (i.e. power off 0x184C, power on 0x104C, chanel up 0x1860 etc, RC5 protocol) If below sketch is uploaded to node, then adapt domoticz to send needed IR codes like i did in sitemaps part or use automation rules to send required commands to node to tv.
Here is my node sketch:
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik EKblad * Version 1.1 - V_IR_SEND / _RECEIVE 16.08.2016 Any hex command received over NRF is send with IR led * Version 1.2 - Don't send repeting codes - 19.08.2016 T. Keles * Version 1.3 - Repeating code blocking correction - 01.09.2016 T.Keles * * DESCRIPTION * This sketch decodes IR remote and send to gateway. * Rules can interpret this or simpleused to find out button codes. * Controller sends string code values as V_IR_Send and incoming message is emitted by IR led. * An IR LED must be connected to Arduino PWM pin 3. * An optional ir receiver can be connected to PWM pin 8. * All receied ir signals will be sent to gateway device stored in V_IR_RECEIVE * http://www.mysensors.org/build/ir */ #include <MySensor.h> #include <SPI.h> #include <IRLib.h> int RECV_PIN = 8; #define CHILD_1 3 // childId IRsend irsend; IRrecv irrecv(RECV_PIN); IRdecode decoder; unsigned int Buffer[RAWBUF]; unsigned long prevMillis=0; MySensor gw; MyMessage msg(CHILD_1, V_IR_RECEIVE); //send decoded ir code void setup() { irrecv.enableIRIn(); // Start the ir receiver decoder.UseExtnBuf(Buffer); gw.begin(incomingMessage,2); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("IR Remote", "1.3"); // Register a sensors to gw. Use binary light for test purposes. gw.present(CHILD_1, S_IR); } void loop() { gw.process(); if (irrecv.GetResults(&decoder)) { unsigned long curMillis=millis(); irrecv.resume(); decoder.decode(); decoder.DumpResults(); // dumresults print values to serial monitor if(curMillis-prevMillis>900){ // if last IR received less than 900ms pass it, otherwise send it to GW //This value is experimental and added to bypass rapidly repeating codes prevMillis=curMillis; if(!(decoder.value==0 || decoder.value==0xffffff)){ // if value is valid char buffer[10]; sprintf(buffer, "%08lX", decoder.value); //format it to 8byte Uppercase Hex format gw.send(msg.set(buffer)); // Send ir result to gw } } } } void incomingMessage(const MyMessage &message) { char ircode[11] = {0}; // in case your code takes the form of 0xE0E0FF0F //incoming ir code is string, however IRSend need unsigned long Below codes do the work if (message.type == V_IR_SEND) { String hexstring = message.getString(); hexstring.toCharArray(ircode, sizeof(ircode)); // get the code as an unsigned long unsigned long code = strtoul(ircode, NULL, 0); if(code==0 || code ==0xFFFFFFFF) {} //if code is not valid, do nothing irsend.send(RC5,code,13); // blast incoming hex code to IR device } // Start receiving ir again... irrecv.enableIRIn(); }
In openhab .items file:
String TV_power "TV" <television> (gHomeMedia) {mysensors="2;3;V_IR_SEND"} String TV_channel "Channel" <television> (gHomeMedia) {mysensors="2;3;V_IR_SEND"} String TV_volume "Volume" <television> (gHomeMedia) {mysensors="2;3;V_IR_SEND"} String IR_Receive "IR Code [%s]" <television> (gHomeMedia) {mysensors="2;3;V_IR_RECEIVE"}
In openhab sitemap:
Frame label="TV Control" { Switch item=TV_power label="TV Power" mappings=[0x184C=OFF, 0x104C=ON] Switch item=TV_channel label="Channel" mappings=[0x1860=UP, 0x1061=DOWN] visibility=[TV_power==0x104C] Switch item=TV_volume label="Volume" mappings=[0x1850="V+", 0x1051="V-"] visibility=[TV_power==0x104C] Text item=IR_Receive
-
RE: 💬 Infrared Sender and Receiver
That node is simply IR to gateway (or vice versa) transfering medium. It doesn't learn just decodes or emits IR signals. This node is mostly dumb.
To make it learn something like z-wave ir extender,
Manually: Just manually decode and note down required codes then use them. Easy solution for known and used commands like on/off, vol +/-, numbers etc.
- hard code it on node, however program space is tight. eeprom may be required.
- hard code it on controller, easy for logic operations and automation needs.
Automatic:
- Write the code to learn and save it to eeprom. It requires some coding, at the end it might be a device like somehow z-wave ir extender. Howeer controller should know and send some kind of message to select right IR code. I didn't work on this solution yet.
-
RE: 💬 Infrared Sender and Receiver
@Reza said:
is this a learning mode module ?
how use this module for learn my ir codes ?This node decodes IR remote codes, print protocol and hex value to serial monitor and send it to gateway. Then controller can do logic on that to do some stuff.
The sample code also receive on/off command from controller and emits IR signal depending on it.I use this node to turn on/off sony sound system (15bit sony protocol) and benq projector (NEC protocol) together beside htpc(via wol). Openhab rule send 8byte IR codes as V_IR_Send to node and node emits the required IR codes.
-
RE: if use sleep() the node can't receive message?
@Magic-W
sleep() function is powering down both rf radio and arduino, therefore no way to get messages during that time. Maybe you can wake frequently and wait a brief time to check if any messages coming while gw sending messages for a few times repeatedly. I read this kind of thing on forum I guess it was about battery actuator.Meanwhile using delay() isn't that good since it is a blocking function, prefer wait() since it runs process() on background.
-
RE: Safe In-Wall AC to DC Transformers??
I'm also looking forward about test results. I've seen the module however never totally trusted; until I found this topic. The price and size are perfect for under-socket installation. If further results come out good, I'm eager to see in-wall projects.