Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. axillent
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by axillent

    • Small wall outlet sensor node

      I've created this to have easiest way to establish environment monitoring across the house
      the idea is to have a wall outlet type plug with everything on board
      and I like to do small things
      The board is less than 50 x 50 mm
      It contains AC-DC power supply with resettable fuse, 3.3V LDO, arduino based on atmega328, radio, LED, and two slots, one for DS18B20 and the second one is for DHT11/DHT22

      IMG_2117.JPG

      The real consumption measured by RMS wattmeter is just 0.3W
      IMG_2118.JPG

      posted in My Project
      axillent
      axillent
    • DIN Rail LEGO

      Working prototype:
      1_1531564764819_Фото 14.07.2018, 13 20 07 sm.jpg 0_1531564764819_Фото 14.07.2018, 13 19 51 sm.jpg

      A LEGO set:

      0_1531564793598_Фото 14.07.2018, 13 29 46 sm.jpg
      0_1531564809164_Фото 14.07.2018, 13 32 29 sm.jpg

      posted in Hardware
      axillent
      axillent
    • AC-DC at own

      Everyone is need some kind of power supply for the project. Some time AC-DC is needed.
      From a few years of hobby I did a following list for myself:

      1. list item isolated AC-DC
        1.1 purchased as adapter
        1.2 purchased in separate box
        1.3 purchased to be put on PCB
      2. nonisolated AC-DC
        2.1 soldered capacitor based
        2.2 soldered switching inductor less
        2.3 soldered switching with inductor

      More or less a coprehensive listm, with proc and cons depending of the project.
      I prefer to solder things, but you see that I put all isolated as purchased. It is all about transformers.
      I'm scared about transformers - you need to properly design it, you need to wire it and build.

      Now I can tell that I do not scared any more)

      But to simplify start I ordered transformers build for the 5/12V output at power up to 3W. It is best sutable for most of my applications.
      0_1531562440011_Фото 09.07.2018, 23 11 04.jpg

      A testing board was created:
      0_1531562243611_acdc2.png

      soldered and tested:
      0_1531562450814_Фото 09.07.2018, 7 25 38.jpg
      0_1531562458616_Фото 10.07.2018, 0 29 43.jpg

      result of test as expected. at 13V output I coould get 3W of power with moderated heating

      schematic is based on LNK364

      By next step I will order PCB for my DIN Rail LEGO project:

      0_1531562601621_acdc.jpg

      posted in Hardware
      axillent
      axillent
    • RE: What did you build today (Pictures) ?

      esp8266 based thermostat for heating system
      1_1541182358775_Фото 02.11.2018, 21 10 39.jpg 0_1541182358775_Фото 02.11.2018, 21 07 09.jpg

      posted in General Discussion
      axillent
      axillent
    • Simple Mysensors clock

      It was an idea a year ago to test an idea of simple and smart clock
      this clock will need no attention because it will be set and synchronized by MySensors support.

      The previous version a year ago was running my port to Plain C MySensors 1.3 and able to fit into atmega8
      Now it is upgraded to arduino + Mysensors 1.4.1 but for this I had to also upgrade to atmega328p (same as in arduino UNO)
      (google translated article is here https://translate.google.com/translate?sl=ru&tl=en&js=y&prev=_t&hl=ru&ie=UTF-8&u=http%3A%2F%2Fradiokot.ru%2Fcircuit%2Fdigital%2Fhome%2F176%2F&edit-text=)

      Simple - means simple. MCU itself is driving 7 segment display. I'm not using any external RTC clock but I'm using a special asynchronous mode of atmega328 and external 32768 so called clock crystal.

      DS18B20 and light sensor are on board.

      Display driver contains a software PWM with 0-15 level of the light intensity.
      Intensity is adjusted by light.

      schematics is here http://radiokot.ru/circuit/digital/home/176/01.png

      IMG_2150.JPG
      IMG_2151.JPG
      IMG_2152.JPG

      posted in My Project
      axillent
      axillent
    • RE: AC-DC at own

      ready

      1_1534706270488_Фото 19.08.2018, 22 02 28.jpg 0_1534706270488_Фото 19.08.2018, 22 02 22.jpg

      posted in Hardware
      axillent
      axillent
    • Custom made ethernet gateway based on atmega128

      I need to have 4-5 ethernet gateways for my two installations (one for the apartment and one for the house)

      for this I'm developing a custom hardware
      it is a PCB with AC power supply, atmega128A, step-down for 5V (for atmega128), step-down for 3.3V (for radio and ENC28J60) ,
      4 leds (powe, error, TX, RX), ISP connector, 3.5mm jack to connect Serial, connector for NRF24L01 and connector for ENC8J60

      IMG_2057.JPG IMG_2058.JPG IMG_2059.JPG

      to use atmega128A a have to adjust Arduino configuration using some presets from the Internet.
      currently I'm running a standard Ethernet Gateway 1.4.1

      The plan is to add menu style configuration from the Serial connection for ethernet network parameters and for MySensors parameters.
      The plan is to propose a patch to MySensors to support Gateway ID - this will add support to the project to have multiple gateways without need of a hack. Otherwise devices from different gateways will conflict on the air.

      posted in Hardware
      axillent
      axillent
    • RE: How can I tell if my arduino mini pro is 3.3V or 5v?

      if you can recognize the marking on xtal you will find 5v with 16Mhz and 3.3V with 8mhz

      posted in Hardware
      axillent
      axillent
    • RE: DIN Rail LEGO

      assembled for particular applications
      0_1532866368413_Фото 29.07.2018, 15 09 59.jpg

      posted in Hardware
      axillent
      axillent
    • MySensors battey board revision 1.0

      I'm opening this topic for the discussion of the Mysensors board.
      We are very close to production this why an open discussion is very important to fix critical things and to understand your interest on the board.
      The price will very depends on volumes. But lets come to that later.
      Preliminary characteristics:

      50x50 mm size
      on board AAA battery holder
      very efficient step to power up at 3.3V from any single AAA (alkaline or Ni-MH/CD)
      atmega328p running at 1MHz from internal oscillator with ability to speed up to 8MHz on the fly
      NRF24L01 with antenna
      solar power switch, connect external solar panel 0.8-5.5V and solar will be the main power while solar voltage is higher than battery
      one I2C GROVE connector which can be used as a connector to A5/A4
      one GROVE analogue connector to A0/A1
      one GROVE digital connector to D2/D3
      high precision very low power I2C temperature sensor with ability to wake up MCU at temperature alertt
      one red LED

      to program you will need an external USB<->UART like you need to program pro-mini

      posted in Announcements
      axillent
      axillent
    • RE: Concept of a flexible but simple smart network

      in details it is very different but by the idea it looks like TCP/IP stack
      Also by addressing, I assume 16 bit global address allows you to address any devices on the same network or other network through bridge or router. And there is no any requirement to have a controller. Devices are able to communicated directly. Controller is a device able to manage network config.uration by assigning ID's (very similar to DHCP). But. ID can be assigned manually and it is also possible to run ID-less configuration by using local or global broadcasts. For example wall switch can be configured to send Scene ID to LightScene brodcast address, and any lighting devices can receive this by brodcast and be activated based on scene ID instead of network address.
      Just to illustrate idea in more details I have other picture
      0_1509723823794_swi_network_types.jpg

      posted in General Discussion
      axillent
      axillent
    • Red-green matrix information panel with real time clock

      More than a year ago I created this panel based on the RG 32x16 matrix from sureelectronics.
      I've posted a local article about it, google translation is here https://translate.google.com/translate?sl=ru&tl=en&js=y&prev=_t&hl=ru&ie=UTF-8&u=http%3A%2F%2Fradiokot.ru%2Fcircuit%2Fdigital%2Fhome%2F194%2F&edit-text=

      Just got time last night to migrate it from Plain C + MySensors 1.2 to Arduino + MySensors 1.4.1
      It was a bit trickier. I had to create a configuration of arduino based on atmega128. I used a way described here http://download.chip45.com/chip45-arduino-extension.zip (http://www.chip45.com/products/crumbuino-128_arduino_compatible_atmega128_module_board_usb.php)

      The C code was adjusted to C++. I keep usign C based libraries for RTC, BMP85 and for the matrix.

      Schematic is here http://radiokot.ru/circuit/digital/home/194/01.jpg and here http://radiokot.ru/circuit/digital/home/194/02.jpg

      Clock creates 3 child devices on controller side:
      Untitled.jpg

      Controller is updated with preassure, temperature, light level and RTC battery status

      This Lua is used to push Street temperature from vera to the Clock:

      local temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 61) 
      temp = temp*10.0
      luup.call_action("urn:upnp-arduino-cc:serviceId:arduino1", "SendCommand", {radioId="1;255", variableId="VAR_5", value=temp}, 430)
      

      61 is vera ID of wheather plugin current temperature device
      430 is Clock node vera device ID
      Similar Lua is used to populate Clock with average home temperature:

      local temp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 384)
      temp = temp*10.0
      luup.call_action("urn:upnp-arduino-cc:serviceId:arduino1", "SendCommand", {radioId="1;255", variableId="VAR_4", value=temp}, 430)
      

      384 is vera ID of temperature average device

      you can also use VAR_1 to show a short text message on the panel
      VAR_2 is reserved to populate a numeric ID to third party connected to Serial1. I plan to setup a voice talking device. ID will call ID.wav or ID.mp3 file to play

      A short video is here
      http://www.youtube.com/watch?v=YOuO6zLDz6U

      My hardware kept without changes but it was a challenge to download arduino sketch because I use JTAG. The solution was found with Visualmicro and Atmelstudio. I setup an arduino sketch inside VisulMicro and a separate project for debug of the object file inside atmelStudio,. This allows me not only to upload using the JTAG but also to run a hardware debugging

      posted in My Project
      axillent
      axillent
    • RE: Sensor Node V2.0

      @Tommy-Sharp "all in one" is one of our goal while working on the project boards

      Thanks all for ideas. We plan to have several project specific boards.
      First one will be the battery operated board designed for wireless sensors.
      Bellow is updated picture, should look better now.
      Sensor will be the digital one with precision 0.5C or better and very low power consumption

      Should we seriously support 5V from battery? For many applications 3.3V are sufficient and it will consume much less power from the battery.

      Relays, dimmers, SSRs will be managed by another board.

      mysensors.battery.jpg

      posted in Hardware
      axillent
      axillent
    • RE: MySensors battey board revision 1.0

      I have news

      prototype of the board fully tested except radio
      stepup is working fine, power switching is working
      programming using external FTDI is working, schematics corrected to get rid from parasite power
      al I/O is fine
      battery and solar voltage measurement is working
      temperature sensor is excellent
      it was not simple to solder, the package is unbelievably small - 1.7 x 1.2 mm, 6 pins

      next and last is radio, going to solder it today
      фото 1.JPG

      posted in Announcements
      axillent
      axillent
    • RE: Reliable 5v buck converter recommendations?

      @zboblamont said in Reliable 5v buck converter recommendations?:

      Surprised no recommendations offered, so trial and error it will have to be...
      Ordered up two XL4015 5A capable 5v boards before Trump modifies free postage 😉 . $3 for two (one as a spare), doubt I could build even one at that price, just the 2 week/months slow boat to wait for.
      The general idea for the UPS being followed is per link text, the PSU, case and battery are easy enough local sourced, and plenty of time to decide whether USB or direct wiring is the choice of powering up the Pi..

      XL4015 will work for you. It is not the best performer but it will do a job.
      If I got your question correctly you do need a module to step down from acis battery (nominal 13.2V maximum 14.6) to 5V up to 3A contineous. Right?

      Best performers in steping down are so called synchronous rectifiers. The eseest to find as a modules is a module based on MP2307. Also a good selection will be a modules based on MP2315. Both are 3A maximum.

      posted in General Discussion
      axillent
      axillent
    • RE: Small wall outlet sensor node

      Pictures bellow are virtual, under printing

      MySensors.Sens.atmega328-wall modelview-02.JPG MySensors.Sens.atmega328-wall modelview-01.JPG

      posted in My Project
      axillent
      axillent
    • Future network topology (for discussion)

      It is for discussion as a result of my discussion with @hek

      Main: The idea is to have multi-gateway and multi-physical-layer network.
      Multi-gateway means that it could be supported to have multiple Ethernet gateways in a single setup.
      Each gateway on one side (from the ethernet side) is a standard MySensors gateway, able to work with supported Home Controll Center using a plugin to that Center. On other side a gateway can manage a different physical transport.
      NRF24 can became a major standard but any other type can be supported as well and became a standard one.
      for example it can be wired RS485 or CAN, can be wireless RF433 or Zigbee. From the Home Controll Center it should be NO difference which physical layer is used to pass messages to the end node.

      Main: Ethernet side can be based on wired connection (wiznet etc.) or WIFI (ESP8266).
      New topology allows to setup a network of theoretically unlimited size (in terms of number of nodes and in terms of the physical area). The only limitation - an existing ethernet @WIFI infrastructure. You even can join segments located in different locations.
      Comparing to the current topology which is based on using NRF24 routing nodes.

      Probably: Because multiple gateways allows to be more flexible on the supporting area and supporting physical layer I will propose to get rid from routing nodes. This will reduce complexity of the Mysensors and improve it stability. Allows to focus on other things like reusing an existing ethernet@WIFI infrastructure

      Probably: Serial gateway can be kept for simple setup and for debugging purpose. But should be not in focus any more. Using universal ethernet gateways makes network more robust. For debugging a special IP sniffer can be used without interrupting other network components.
      Also sniffing can be used for a new version of the cloud@node (raspberry pi) to have light approach to listen to network and to log configurable events to the MySensors@Cloud

      Probably: Routing between different segments/gateways should be introduced. Some limitation can apply for certain physical layers (for example RF433 can be a one way layer, only for sensors like fire alarms, door sensors, motions sensors etc.)

      Probably: For NRF24 gateways the BASE radio address should contain gateway@node ID, so there will be no conflicts between sens@nodes from different segments and also it allows to build network with more than 254 sensors while not complicating sens@nodes
      Mysensors-Network-2015-01.jpg

      posted in Hardware
      axillent
      axillent
    • MySensors micro step-up module revision 1.0

      Through a discussion on the forum we found a potential interest to the step-up module with excellent battery saving capabilities
      We decided to present to you such a module
      It is actually same technology as will be used for MySensors Battery board, but it allows to choose any other board for your battery operated project.
      Module is using one of the best in class chip with hight efficiency and low quiescent current, this allows to run your device for longer time
      Module is designed with standard 2.54 pitch connector, can be easily connected using dupon wires
      Output voltage can be selected by switch 3.3V or 5V
      As power source you can use:

      • for 3.3V output - 1-2 alkaline, 1-3 NiMh/NiCd or solar up to 3.3V
      • for 5V - 1-3 alkaline, 1-4 NiMh/NiCd or solar up to 5V

      100mA output for 3.3V or 70mA for 5V are at minimum guaranteed

      Size is just 15x15mm

      Estimated retail price before shipping cost is $5
      Anyone interested?

      Prototype is on photo fully tested

      Untitled.jpg
      фото 12.JPG
      фото 1.JPG
      фото 2.JPG

      posted in Announcements
      axillent
      axillent
    • RE: Concept of a flexible but simple smart network

      just published my libraries
      anyonw is welsome on review and comments https://github.com/axillent :

      • list item stavrp C++ multiplafrom suport library, platforms are at different level of support

      • list item smartletsp C++ smart devices network

      • list item swilib and integration of above two libraries with arduino framework

      posted in General Discussion
      axillent
      axillent
    • RE: Small wall outlet sensor node

      @ServiceXp thanks)
      all this is simple, just a patient work

      Printed thing is a bit ugly comparing to the virtual one, but it's work is real
      IMG_2120.JPG IMG_2121.JPG
      http://www.youtube.com/watch?v=JG7gutD1oo8

      posted in My Project
      axillent
      axillent
    • RE: 230V power supply to Arduino

      @klim I made a test PCB

      IMG_2088.JPG IMG_2089.JPG IMG_2090.JPG

      I succeed to get about 34mA with 1uF capacitor and probably it will provide 40mA stated in the datasheet
      it is not possible to use it directly without an additional LDO or step-down because of a very high ripple.
      According to my measurement ripple is 2.8V with 12.6V average output (figures in table should be multiplied by 10):
      Untitled.jpg

      consumed power from AC is 0.8 W with 36mA output
      this means 57% efficiency, not bad for such thing

      posted in Hardware
      axillent
      axillent
    • RE: MySensors micro step-up module revision 1.0

      I'm finally back from a long trip
      Sorry to be silent

      Seeed stepup boards are awaiting me at home.
      Just need to run final performance tests
      фото 2-12.JPG фото 1-15.JPG

      posted in Announcements
      axillent
      axillent
    • RE: Simple Mysensors clock

      Sketch is here

      /* p6004_simple_clock.c
      *
      * Created: 07.09.2013 17:39:43
      *  Author: axillent
      
      Simple Mysensors.org clock with time synchronization
      
      */
      
      //---------------------------------------------------------------------------------------------------
      // parameters
      #define TIMERS_CLOCK_SYNC_HOURS		12
      #define TIMERS_TEMPERATURE_SECONDS	30
      #define TIMERS_LIGHT_LEVEL_SECONDS	5
      #define DISPLAY_CLOCK_SECONDS		10
      #define DISPLAY_DATE_SECONDS		2
      #define DISPLAY_TEMPERATURE_SECONDS	2
      #define DISPLAY_LIGHT_SECONDS		0
      #define DISPLAY_MINIMUM_PWM			1
      
      //---------------------------------------------------------------------------------------------------
      // hardware definition
      #include "axlib.h"
      
      #define DISP_7SEG_DIGITS		4
      #define DISP_7SEG_PWMMAX		16
      #define DISP_7SEG_PORT			PORTD
      #define DISP_7SEG_DDR			DDRD
      #define DISP_7SEG_DIG_PORT		PORTC
      #define DISP_7SEG_DIG_DDR		DDRC
      #define DISP_7SEG_DIG_DIG1		PC0
      #define DISP_7SEG_DIG_DIG2		PC1
      #define DISP_7SEG_DIG_DIG3		PC2
      #define DISP_7SEG_DIG_DIG4		PC3
      
      #define SensLight		7				// канал оцифровки освещенности
      AXLIB_define_io_functions(ledRadio, C, 4)
      AXLIB_define_io_functions(ledDot, C, 5)
      
      #define RF_CE	8
      #define RF_CSN	9
      
      // стандартные библиотеки
      #include <avr/io.h>
      #include <avr/wdt.h>
      #include <avr/interrupt.h>
      #include <util/delay.h>
      #include <stdlib.h>
      
      #include <MySensor.h>
      #include <SPI.h>
      
      // configure ds18b20
      #define TEMP_PIN			PINB2
      #define TEMP_IN				PINB
      #define TEMP_OUT			PORTB
      #define TEMP_DDR			DDRB
      #define MAXSENSORS 1
      #include "onewire.h"
      #include "ds18x20.h"
      
      //---------------------------------------------------------------------------------------------------
      // functions definition
      void mcu_init();
      void disp_7seg_update();
      void disp_7seg_init();
      void disp_7seg_show(uint8_t digit, uint8_t value, uint8_t dp);
      void disp_7seg_setpwm(uint8_t v);
      uint8_t disp_7seg_getpwm();
      void disp_7seg_setdots(uint8_t dots);
      
      void displayClock();
      void displayTemp();
      void displayLight();
      void displayDate();
      
      void sync_clock();
      void time_convert(unsigned long time, uint8_t* hour, uint8_t* minute, uint8_t* second);
      
      AXLIB_TIMER_BLINK(radio, ledRadio_getinv(), ledRadio_clr(), ledRadio_set())
      
      //---------------------------------------------------------------------------------------------------
      // the programm itself
      
      enum { display_clock=0, display_temp, display_light, display_date };
      
      MySensor gw(RF_CE, RF_CSN);
      MyMessage msgTemp(0, V_TEMP);
      MyMessage msgLight(1, V_LIGHT_LEVEL);
      
      struct {
      	struct {
      		uint8_t					count;
      		int						temp;
      		int						prev_temp;
      		volatile	uint8_t		timer;
      	} temperature;
      	struct {
      		volatile	uint8_t		seconds;
      		volatile	uint8_t		minutes;
      		volatile	uint8_t		hours;
      		volatile	uint8_t		day;
      		volatile	uint8_t		month;
      		volatile	uint16_t	sync_timer;
      	} clock;
      	struct {
      		volatile	uint8_t		light;
      		volatile	uint16_t	avg;
      		volatile	uint8_t		cnt;	
      		volatile	uint8_t		timer;
      		volatile	uint16_t	max_light;
      		volatile	uint16_t	min_light;
      		uint8_t					prev_light;
      	} light;
      	struct {
      		volatile	uint8_t		what;
      		volatile	uint8_t		timer;
      	} display;
      } var;
      
      uint8_t gSensorIDs[MAXSENSORS][OW_ROMCODE_SIZE]; // содержит 64бит идентификаторы датчиков температуры в произвоьном порядке (определенном при поиске)
      
      // таймер динамической индикации
      ISR(TIMER1_OVF_vect) {
      	disp_7seg_update();
      }
      
      // часовой таймер
      ISR(TIMER2_OVF_vect) {
      	// срабатывает каждую секунду от часового кварца
      	//axnet_rtcsoft_update();
      	var.clock.seconds++;
      	if(var.clock.seconds == 60) {
      		var.clock.seconds = 0;
      		var.clock.minutes++;
      		if(var.clock.minutes == 60) {
      			var.clock.minutes = 0;
      			var.clock.hours++;
      			if(var.clock.hours == 24) {
      				var.clock.hours = 0;
      				var.clock.sync_timer = 0;
      			}
      		}
      	}
      
      	// запускаем измерения уровня освещенности
      	ADCSRA |= (1 << ADSC);
      
      	// мерцание точек
      	if(var.display.what == display_clock) {
      		if(var.clock.seconds % 2) {
      			disp_7seg_setdots(1);
      		} else {
      			disp_7seg_setdots(0);
      		}
      	}
      
      	if(var.clock.sync_timer) var.clock.sync_timer--;
      	if(var.temperature.timer) var.temperature.timer--;
      	if(var.display.timer) var.display.timer--;
      	if(var.light.timer) var.light.timer--;
      
      	axlib_timer_blink_radio_update();
      }
      
      // измерение освещенности завершено
      ISR(ADC_vect) {
      	var.light.avg += ADCW;
      	if(!--var.light.cnt) {
      		uint16_t light = var.light.avg / 32;
      	
      		if(var.light.min_light > light) var.light.min_light = light;
      		if(var.light.max_light < light) var.light.max_light = light;
      	
      		uint32_t v = light - var.light.min_light;
      		v *= 100;
      		v /= (var.light.max_light - var.light.min_light);
      		var.light.light = 100 - v;
      	
      		var.light.avg = 0;
      		var.light.cnt = 32;
      	} else {
      		ADCSRA |= (1 << ADSC);
      	}
      }
      
      void setup()
      {
      	// RTC init  ----------------------------------------------
      	// timer2 prescaler 1/128
      	// timer2 overflow 1Hz (32768 osciilator)
      	// asynhronous timer mode for timer 2 - RTC
      //	TIMSK2 = 0;
      	//_delay_ms(100);
      	ASSR = (1 << AS2);
      	//-----------------------------------------------------------
      	_delay_ms(100);
      	// RTC init  continue ---------------------------------------
      	TCNT2 = 0;
      	OCR2A = 0;
      	OCR2B = 0;
      	TCCR2B = (1 << CS22) | (0 << CS21) | (0 << CS20);
      
      	while(ASSR & ((1 << OCR2AUB) | (1 << OCR2BUB) | (1 << TCR2AUB) | (1 << TCR2BUB)));
      	//_delay_ms(500);
      
      	// interrupts for timer2 overflow
      	//TIFR2 |= (1 << OCF2A) | (1 << OCF2B) | (1 << TOV2);
      	TIMSK2 = (1 << TOIE2);
      	//------------------------------------------------------------------
      	// Startup OneWire
      	var.temperature.count = search_sensors();
      
      	// Startup and initialize MySensors library. Set callback for incoming messages.
      //	gw.begin(incomingMessage);
      	gw.begin();
      
      	// Send the sketch version information to the gateway and Controller
      	gw.sendSketchInfo("Simple Clock", "2.0");
      	gw.present(0, S_TEMP);
      	gw.present(1, S_LIGHT_LEVEL);
      
      	Serial.end();
      	mcu_init();
      	disp_7seg_init();
      
      	ledRadio_set();
      	axlib_timer_blink_radio_init();
      
      	var.display.what = display_clock;
      	var.display.timer = DISPLAY_CLOCK_SECONDS;
      	var.temperature.prev_temp = 9999;
      
      	var.light.light = 255;
      	var.light.min_light = 1023;
      	var.light.max_light = 0;
      	var.light.prev_light = 9999;
      	var.light.timer = 2;
      
      	sei();
      	ADCSRA |= (1 << ADSC);
      }
      
      void loop()
      {
      	gw.process();
      
      	if(!var.clock.sync_timer) {
      		gw.requestTime(receiveTime);
      		axlib_timer_blink_radio_run(3, 1);
      		var.clock.sync_timer =  2;	// next update in seconds
      	}
      	
      	switch(var.display.what) {
      		case display_clock:
      			displayClock();
      			break;
      		case display_date:
      			displayDate();
      			break;
      		case display_temp:
      			displayTemp();
      			break;
      		case display_light:
      			displayLight();
      			break;
      	}
      
      	// -------------------------------------------------------------------------------------------
      	// реагирование на освещенность
      	uint16_t pwm = var.light.light * 15;
      	pwm /= 100;
      	if(pwm < DISPLAY_MINIMUM_PWM) pwm = DISPLAY_MINIMUM_PWM;
      	disp_7seg_setpwm(pwm);
      
      	// -------------------------------------------------------------------------------------------
      	// переключение отображения
      	if(!var.display.timer) {
      		disp_7seg_setdots(0);
      		switch(var.display.what) {
      			case display_clock:
      				if(DISPLAY_DATE_SECONDS) {					// date
      					var.display.what = display_date;
      					var.display.timer = DISPLAY_DATE_SECONDS;
      				} else if(DISPLAY_TEMPERATURE_SECONDS) {			// temperature
      					var.display.what = display_temp;
      					var.display.timer = DISPLAY_TEMPERATURE_SECONDS;
      				} else if(DISPLAY_LIGHT_SECONDS) {			// light
      					var.display.what = display_light;
      					var.display.timer = DISPLAY_LIGHT_SECONDS;
      				} else {
      					var.display.timer = DISPLAY_CLOCK_SECONDS;	// clock
      				}
      				break;
      			case display_date:
      				if(DISPLAY_TEMPERATURE_SECONDS) {					// temperature
      					var.display.what = display_temp;
      					var.display.timer = DISPLAY_TEMPERATURE_SECONDS;
      				} else if(DISPLAY_LIGHT_SECONDS) {			// light
      					var.display.what = display_light;
      					var.display.timer = DISPLAY_LIGHT_SECONDS;
      				} else {
      					var.display.what = display_clock;
      					var.display.timer = DISPLAY_CLOCK_SECONDS;	// clock
      				}
      				break;
      			case display_temp:
      				if(DISPLAY_LIGHT_SECONDS) {					// light
      					var.display.what = display_light;
      					var.display.timer = DISPLAY_LIGHT_SECONDS;
      				} else {
      					var.display.what = display_clock;
      					var.display.timer = DISPLAY_CLOCK_SECONDS;	// clock
      				}
      				break;
      			case display_light:
      				var.display.what = display_clock;
      				var.display.timer = DISPLAY_CLOCK_SECONDS;
      			break;
      		}
      	}
      
      	// -------------------------------------------------------------------------------------------
      	// temperature
      	if(var.temperature.count && !var.temperature.timer) {
      
      		SPCR &= ~(1 << SPE);
      		int temp = 0;
      		if(DS18X20_start_meas( DS18X20_POWER_EXTERN, &gSensorIDs[0][0] ) == DS18X20_OK) {
      			_delay_ms(1000);
      			if(DS18X20_read_decicelsius(&gSensorIDs[0][0], &temp) == DS18X20_OK ) var.temperature.temp = temp;
      		}
      		SPCR |= (1 << SPE);
      	
      		if(var.temperature.temp != var.temperature.prev_temp) {
      			axlib_timer_blink_radio_run(2, 1);
      			gw.send(msgTemp.set(temp/10.0, 1));
      			var.temperature.prev_temp = var.temperature.temp;
      		}
      	
      		var.temperature.timer = TIMERS_TEMPERATURE_SECONDS;
      	}
      
      	// -------------------------------------------------------------------------------------------
      	// light level
      	if(!var.light.timer) {
      		if(var.light.light != var.light.prev_light) {
      			axlib_timer_blink_radio_run(2, 1);
      			gw.send(msgLight.set(var.light.light));
      			var.light.prev_light = var.light.light;
      		}
      		var.light.timer = TIMERS_LIGHT_LEVEL_SECONDS;
      	}
      }
      
      void displayClock() {
      	disp_7seg_show(0, var.clock.hours / 10, 0);
      	disp_7seg_show(1, var.clock.hours % 10, 0);
      	disp_7seg_show(2, var.clock.minutes / 10, 0);
      	disp_7seg_show(3, var.clock.minutes % 10, 0);
      }
      void displayDate() {
      	disp_7seg_show(0, var.clock.day / 10, 0);
      	disp_7seg_show(1, var.clock.day % 10, 1);
      	disp_7seg_show(2, var.clock.month / 10, 0);
      	disp_7seg_show(3, var.clock.month % 10, 0);
      }
      void displayTemp() {
      	disp_7seg_show(0, var.temperature.temp / 100, 0);
      	disp_7seg_show(1, (var.temperature.temp / 10) % 10, 1);
      	disp_7seg_show(2, var.temperature.temp % 10, 0);
      	disp_7seg_show(3, 20, 0);
      }
      void displayLight() {
      	disp_7seg_show(0, var.light.light / 1000, 0);
      	disp_7seg_show(1, (var.light.light / 100) % 10, 0);
      	disp_7seg_show(2, (var.light.light / 10) % 10, 0);
      	disp_7seg_show(3, var.light.light % 10, 0);
      }
      
      void mcu_init() {
      	// specific hardware
      	ledRadio_setoutput();
      	ledDot_setoutput();
      
      	// инициализируем таймер для динамической индикации
      	TCCR1A = (0 << WGM11) | (1 << WGM10);
      	TCCR1B = (0 << WGM13) | (1 << WGM12) | (0 << CS12) | (0 << CS11) | (1 << CS10);
      	TIMSK1 = (1 << TOIE1);
      	//TCCR0 = (1 << CS00);
      	//TIMSK |= (1 << TOIE0);
      
      	// инициализация ADC
      	// AVCC
      	ADMUX = (0 << REFS1) | (1 << REFS0) | SensLight;
      	// interrups ON, prescaler 64 + free running
      	ADCSRA = (1 << ADEN) | (1 << ADIE) | (1 << ADPS2) | (1 << ADPS1) | (0 << ADPS0);
      }
      
      
      //---------------------------------------------------------------------------------------------------
      // 7 segment led handling
      uint8_t buffer_7seg[DISP_7SEG_DIGITS];
      uint8_t buffer_7seg_index;
      uint8_t buffer_7seg_mask;
      
      volatile uint8_t disp_7seg_pwm_cnt = 0;
      volatile uint8_t disp_7seg_pwm_value = 15;
      volatile uint8_t disp_7seg_dots;
      
      static void disp_7seg_setpwm(uint8_t v) { disp_7seg_pwm_value = (v<DISP_7SEG_PWMMAX)?v:DISP_7SEG_PWMMAX-1; }
      uint8_t disp_7seg_getpwm() { return disp_7seg_pwm_value; }
      static void disp_7seg_setdots(uint8_t dots) { disp_7seg_dots = dots; }
      
      // initialise all ports and variables
      void disp_7seg_init() {
      	DISP_7SEG_DDR		 = 0xff;			// все биты порта на вывод
      	DISP_7SEG_DIG_DDR	|= (1 << DISP_7SEG_DIG_DIG1) | (1 << DISP_7SEG_DIG_DIG2) | (1 << DISP_7SEG_DIG_DIG3) | (1 << DISP_7SEG_DIG_DIG4);
      
      	buffer_7seg_index = 0;
      	buffer_7seg_mask = (1 << DISP_7SEG_DIG_DIG1);
      	for(uint8_t i=0; i<DISP_7SEG_DIGITS; i++) { buffer_7seg[i] = 0; }
      }
      
      // should be called often to update dynamically leds
      void disp_7seg_update() {
      	// гасим полностью если pwm=0
      	if(disp_7seg_pwm_cnt == 0 && disp_7seg_pwm_value) {
      		// сначала сбрасываем все цифры в 1 (инверсия, т.е. отключаем)
      		DISP_7SEG_DIG_PORT |= 0b00001111;
      		// выводим новые значения сегментов
      		DISP_7SEG_PORT = buffer_7seg[buffer_7seg_index];
      		// включаем нужную цифру
      		DISP_7SEG_DIG_PORT &= ~ buffer_7seg_mask;
      		// готовимся к показу следующей цифры
      		buffer_7seg_index++;
      		if(buffer_7seg_index == DISP_7SEG_DIGITS) {
      			buffer_7seg_index = 0;
      			buffer_7seg_mask = (1 << DISP_7SEG_DIG_DIG1);
      		} else {
      			buffer_7seg_mask = (buffer_7seg_mask << 1);
      		}
      		// точки
      		if(disp_7seg_dots) { ledDot_clr(); } else { ledDot_set(); }
      	} else if(disp_7seg_pwm_cnt > disp_7seg_pwm_value || !disp_7seg_pwm_value) {
      			DISP_7SEG_DIG_PORT |= 0b00001111;
      			ledDot_set();
      	}
      	disp_7seg_pwm_cnt++;
      	if(disp_7seg_pwm_cnt == DISP_7SEG_PWMMAX) { disp_7seg_pwm_cnt = 0; }
      }
      uint8_t disp_7seg_digits[] = { 0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F,	// digits 0-9
      	0x00,		// blank
      	0x40,		// minus
      	0x77,		// A
      	0x39,		// C
      	0x79,		// E
      	0x71,		// F
      	0x1F,		// G
      	0x76,		// H
      	0x38,		// L
      	0x73,		// P
      	0x63		// градус
      };
      void disp_7seg_show(uint8_t digit, uint8_t value, uint8_t dp) {
      	uint8_t code = 0;
      	if(value < sizeof(disp_7seg_digits)) {
      		// декодируем
      		code = disp_7seg_digits[value];
      	}
      	if(dp) { code |= (1 << 7); }
      	buffer_7seg[(digit<sizeof(buffer_7seg))?digit:0] = code;
      }
      
      
      // This is called when a new time value was received
      void receiveTime(unsigned long time) {
      	uint8_t hour, minute, second;
      	uint8_t month, day;
      	uint16_t year;
      
      	axlib_timer_blink_radio_run(1, 1);
      	axlib_time_convert(time, &hour, &minute, &second);
      	axlib_date_convert(time, &day, &month, &year);
      
      	cli();
      	var.clock.hours = hour;
      	var.clock.minutes = minute;
      	var.clock.seconds = second;
      	var.clock.day = day;
      	var.clock.month = month;
      	sei();
      
      	var.clock.sync_timer = 60 * 60 * TIMERS_CLOCK_SYNC_HOURS;	// next update in seconds
      }
      
      
      uint8_t search_sensors(void)
      {
      	uint8_t i;
      	uint8_t id[OW_ROMCODE_SIZE];
      	uint8_t diff, nSensors;
      
      	ow_set_bus(&TEMP_IN,&TEMP_OUT,&TEMP_DDR,TEMP_PIN);
      	ow_reset();
      
      	nSensors = 0;
      
      	diff = OW_SEARCH_FIRST;
      	while ( diff != OW_LAST_DEVICE && nSensors < MAXSENSORS ) {
      		DS18X20_find_sensor( &diff, &id[0] );
      
      		for ( i=0; i < OW_ROMCODE_SIZE; i++ )
      		gSensorIDs[nSensors][i] = id[i];
      
      		nSensors++;
      	}
      
      	return nSensors;
      }
      posted in My Project
      axillent
      axillent
    • RE: DIN Rail LEGO

      this is going to be WiFi router from local 3 wire net to Internet or remote ioT net

      1_1534706184901_Фото 19.08.2018, 22 10 47.jpg 0_1534706184901_Фото 19.08.2018, 22 02 03.jpg

      posted in Hardware
      axillent
      axillent
    • RE: Gateway not working on VeraLite + UI6 - No Serial Port configuration available

      @cdrum it is recommended to use ethernet gateway with UI above 5
      you also can downgrade to UI5 to have no issues with serial gateway

      posted in Vera
      axillent
      axillent
    • RE: New library to read Arduino VCC supply level without resistors for battery powered sensor nodes that do not use a voltage regulator but connect directly to the batteries ;-)

      @Yveaux said:

      @axillent You're right, but I implemented it like the external voltage dividers I've seen in sketches.
      I'll add a configurable lower bound to the interface.

      I recommend you to read atmega328 datasheet though. You will get an original inside on all things 🙂
      you will also be surprised that atmega328p has an internal (but very low precision) analog temperature sensor

      posted in Development
      axillent
      axillent
    • RE: Small wall outlet sensor node

      @Johnny-B-Good thanks!

      posted in My Project
      axillent
      axillent
    • RE: 433mhz outlet

      @C.r.a.z.y. some sensors do have dip switches, some have preprogrammed radio code

      if you have RF receiver you can try to get a code from your remote using example receiver sketch from RCSwitch library. I build a custom arduino with RF receiver and a button which I use to program the first received code into arduino EEPROM. Later this code is used to identify which sensor should light up my leds.
      IMG_1880.JPG

      posted in Troubleshooting
      axillent
      axillent
    • RE: Sensor Node V2.0

      @clippermiami we are currently in discussion with possible partners, we discussing production of the PCB and assembled PCB
      in parallel I'm doing a prototyping of the battery operated board
      Battery operated board will came first, later we plan to release a set of stackable boards ready be used for switching, dimming and integration behind a wall switch

      posted in Hardware
      axillent
      axillent
    • RE: MySensors micro step-up module revision 1.0

      @bjornhallberg we are in discussion with one of the DIY company, they have a production abilities and also a distribution network.
      quality should be OK

      we will announce all details as soon as we will enter final agreement

      P.S. The temperature sensor from our board is even smaller in size. I'm soldering all them using regular china soldering iron
      it is hard to imagine, it was hard to imagine for myself too just 6 month ago
      also this I do 🙂
      фото.JPG

      posted in Announcements
      axillent
      axillent
    • RE: Etching my own boards

      @marceltrapman Welcome back to the interesting discussion )

      The most important step in etching is a drawing PCB design on the copper.
      The most common is to use thermo transfer or photo transfer.

      1. thermo transfer in my experience is best choice because it is faster and cheaper. The minimum track archived can be 0.3-0.2mm which is sufficient for most DIY PCBs. You will need:
      • appropriate laser printer. Printer is used to print design on paper which will be later transferred to copper. Not any toner can be successfully transferred this why not any printer can succeed
      • paper. very critical thing. There are number of recommendation on forums which paper to use. It is also some special paper you can purchase especially for thermo transfer. Regular office paper cannot be used because it absorbs toner. You need paper with smooth surface. In my experience the paper from some news-papers can be sufficient. Choose the news-paper with smooth and gloss but not thick. I use paper which is thinner that regular office paper.
      • iron or laminator. Regular iron can be used, but it will be hard to get a stable result with iron because both the stability of temperature & pressure are important for the result, It is better to have laminator . I will recommend to choose a laminator with 1. 4 rolls (2 heating and 2 cooling) 2. ability to work with a thick material up to 2mm 3. with regulated temperature up to 180 C
      • sand paper. I use paper with index 280 to sharp edges while I use index 1200-1500 to sharp the surface. This need to be done after cutting the edges but before thermo-transfer. After sharping is better to remove any fat from the surface and touch the surface by fingers.
      1. photo transfer. You can reach better result up to 0.1-0.2mm track but it is more expensive and requires more steps. For this you can choose from 1. PCB with photoresistive coverage 2. a special photoresistive film to cover copper by yourself. You will need laminator for best result. 3. special photoresistive spray to cover copper by yourself
        2 is less expensive but requires to have laminator and to do an additional step
        1 is most expensive but save time and guarantee stability in result
        3 is in the middle

      You will need:

      • prepared PCB material with photoresistive coverage (as described above)
      • UV lamp. It can be glass lamp, energy saving lamp or LED. All need to have to give UV light. before purchasing you will need to check that a light source wave length is compatible with a wave length recommended by selected photoresist
      • a film designed for printing. It can be laser print or inkjet. Not any inkjet is applicable while any laser can
      • a printer
      • chemicals for developing photoresist
      • chemicals to clean photoresist
      • the box for the liquid chemicals while developing/cleaning
      • sand paper as above

      For etching most commonly Feric chloride or ammonium persulhate. My choice is ammonium persulhate. It is transparent while feric chloride is dark yellow. Also feric can leave things stained

      While you learned how to draw the design on the copper you can use any transparent or semi-transparent plastic box for etching. Even at home temperature a fresh spread can work well but if you can heat it before use to 40-50 C you will run faster and beter even with not fresh spread. The visual control of the process is only needed this stage. All other tools is to make process simpler or nicer but not required

      posted in General Discussion
      axillent
      axillent
    • RE: Fibaro Home center 2 possible?

      I'm not sure you get my answer properly. Yes, you can.
      The only issue with this is that there is a set of the programming that someone need to do for this.
      Can you do?

      posted in Feature Requests
      axillent
      axillent
    • Possible solution for energy mettering

      I think most of us are wondering on measuring energy consumed. I have an experience with this by using a current sensors. It is more or less fine, For example a sensor based on ACS712 chip. It requires to use atmega328 ADC and we can have 10 bit resolution on the current. We able to calculate RMS current and having voltage measured separately or even using voltage as a constant we can calculate active energy consumed.
      I thought it is a most preferred way.
      But recently I found a device https://translate.google.com/translate?sl=ru&tl=en&js=y&prev=_t&hl=ru&ie=UTF-8&u=http%3A%2F%2Fradiokot.ru%2Fcircuit%2Fdigital%2Fmeasure%2F76%2F&edit-text= to measure active power and energy consumed very precisely. It is based on a special chip ADE7756 from Analog Devices, This chip is measuring RMS voltage and current and using 40 bits ADC for active energy calculation (comparing to 10 bits Arduino) and you can read it from the chip by arduino. ADE7756 is out of production but it is just an example. There is a couple of modern chips. Some providing Serial interface using UART, some using SPI.

      Just made a device for myself. I need it to compare consumption of mysensors devices using different approaches. This is to find a good energy saving solutions.
      IMG_1822.JPG

      The device is also a good support to check the real power of LED bulbs received from China) I already checked some of them and get surprised )

      Would be it interesting for you to have an arduino shield with a energy metering chip?

      posted in Hardware
      axillent
      axillent
    • RE: MySensors with Atmega8(L) ?

      you will probably need to hack&cut a library to reduce a required flash
      I would recommend you to reconsider usage of atmega8, otherwise you will need to spend a lot of time to fit any upgrade
      I had such an experience. I was translating Mysensors to Atmel Studio and that allows me to fit sensors & clocks into atmega8.
      But as Mysensors is under fast development it became too complicated to follow.

      posted in General Discussion
      axillent
      axillent
    • Radio ping feature request

      In simple form a ping addressed to particular node by radio ID
      in more complex way - broadcast ping

      initiator sends ping, addressed node repliers

      additional feature - request could contain radio power indicator, the receiver will reply by setting radio to a particular power (something like (highest, high, standard, low, lowers - very like RF24 supports)
      this will allow to build a distance map

      I'm wondering on the two applications:

      1. to simply check connections status. Currently time request can be used for this in case if we need to check connection to the gateway, but there is no predefined way to check other nodes

      2. to monitor and analyse complex network. to create a network analyser
        I plan to setup a big network by using many gateways. I have no tool currently to find the best location for the additional gateways and no tool to find the best gateway for the particular sensor node. Same issue I think is exists with routing topology

      posted in Feature Requests
      axillent
      axillent
    • RE: Minimal design thoughts

      @tbowmo said:
      With THAT info, I could have used a smaller pinheader, instead of the 6pin ISP header..

      you cannot remove ISP header because debugWire is activated through ISP )))

      @tbowmo said:

      I'm used to the small components.. And for a couple of handbuild sensor boards, I thought that I might as well cope with them, in order to keep the layout small 🙂 If this is becomming a success, and others would like similair boards, the boards should be assembled with an pick & place machine, and then it doesn't matter that the components are 0402.

      Me and Henrik we have a list of partners for PCB production, If you fine to cooperate more closer with Mysensors we can help you on putting the board unto production. Just let Henrik to know if you have an interest on closer cooperation. I will help with production.

      posted in Hardware
      axillent
      axillent
    • Concept of a flexible but simple smart network

      Doing my staff and doing mysensors, thinking about others I came intp conclusion that smart network required to be more abstract, it's basics should be in logic disconnected from hardware realization. From a long long thinking I made a concept I'm currently working on. I will be glad to share and discuss it to get different views.

      Abstracting requires to split all into separate levels starting from application and dropping down up to hardware. It can be done in different ways. I will describe here my way.

      First of all the message. It very common to have here a header with RX & TX ids and message type. But it should have nothing about underling like CRC sum. The underling is coming on lower level. This allows to write an application which does not depends on hardware.

      So to start I present a layering diagram

      0_1509623799489_swi_library_convention.jpg

      Layers are listed here from left to right:

      • Super Application. This is top-top abstract layer as a cover of regular application. Example are the Bridge (interconnects two networks) and Router (interconnects with routing 2+ networks)

      • Application. This is a regular application required by any smart device. It allows you have a network connected device. It is so common that it can be used for whatever you want and you can plug so called Features into it to extend its functionality without re-programm the applicariton. See Features bellow.

      • Application Feature. This is a plug-and-play extensions to Application. Examples are:

      • basic1 allows the device to auto assign ID or to have ID assigned manually by network command
      • basic2 contains support for "red" button and indicating LED. LED represents Application status: Normal, NOIDUssigned, WAITCOMMAND. Button allows enter/leave WAITCOMMAND status. This status allows device to receive messages with special WAITCOMMAND broadcast address regardless its own ID. This one is similar as Inclusion status for ZWave devices.
      • callback. regular application allows you to read network messages by ::RX method. callback Feature allows you to define per message type callback functions
      • broadcast. regular application address device by its direct ID. broadcast Feature allows you to define a list of special broadcasts for device to have an alternative addressing. For example you can put RTC clock inside your network and any device can request clock source without knowing the source ID
      • Dispatcher. This Feature organize needed logistic for incoming and outgoing messages. Example:
      • P2P peer to peer network. All outgoing messages are send immediately to hardware
      • M&S master and slave. Outgoing messages from slaves will be send only on session start request from Master. This for example can be used on half-duplex RS485 networks
      • Translator. This one is very close to hardware. It translate abstract standard message from-to hardware layer. For example it can put the message into cover with CRC checksum if underling interface requires this. Other example - text console. All messages are translated to text for manual monitoring and also there is a possibility to send message

      • Driver. This one deals with hardware directly or using specified hardware library. Examples:

      • NRF24
      • RS485
      • UART
      posted in General Discussion
      axillent
      axillent
    • RE: Possible solution for energy mettering

      @ServiceXp said:

      Did you print that case?

      yes
      p01401 vattmeter01 box sborka01.JPG
      IMG_1821.JPG

      posted in Hardware
      axillent
      axillent
    • RE: Concept of a flexible but simple smart network

      An Example of simple device, application configuration:

      // --- Smartlets
      typedef Message::Message<20>		msg_type;
      // --- Options
      
      // w3p driver
      typedef HandlerPortD<ExtIntMode::FallingRising>	pinchange_drv;
      typedef PortD<6, PinMode::Interrupt>		w3p_rx;
      typedef PortD<5, PinMode::Inverse | PinMode::OutputPushPull> w3p_tx;
      typedef Timer2<mcu, 0, 6, 1000>			w3p_timer;
      typedef Driver::W3P<w3p_rx, pinchange_drv, w3p_tx, w3p_timer>	drv;
      // translator
      typedef Translator::W3P<msg_type>		transl;
      // dispatcher
      typedef Dispatcher::P2P<msg_type, transl, drv>	disp;
      // application
      typedef Feature::Basic1<msg_type, disp, ep_id>	basic1;
      typedef Feature::CallBackByType<Message::Type::LightScene, msg_scene_cbk>	scene_callback;
      typedef Feature::CallBack<msg_type, scene_callback, basic1>	callback;
      typedef Feature::Basic2<msg_type, disp, button, led1, callback>	basic2;
      typedef Application::Application<msg_type, disp, basic2>	appl;
      
      

      And simple main, this one supports 2 channel relay functions and 2 NTC sensors

      int main()
      {
        mcu::Init();
      
        ep_id::SetDefault(Message::ID(THIS_NET_SEGMENT_ID));
        ep_key::Set();
      
        appl::Init();
      
        adc::Start();
        timer::Start();
        mcu::InterruptEnable();
      
        var.timer	 = 10;
        var.timer1 = 60;
        var.timer2 = 60;
      
        struct {
      	int	temperature1, temperature2;
        } prev;
      
        while(1) {
      
          appl::Loop();
      
      	if( !var.timer ) {
      	  var.timer = 10;
      
      	  if( !var.timer1 || abs_int(prev.temperature1 - var.temperature1) > 10 ) {
      		Message::Value	msg(100, var.temperature1, Message::Value::TemperatureInt16);
      
      		if( appl::Tx(Message::ID(Message::ID::Value), msg.Type(), msg, msg.Size(), false) == Message::State::TxOK ) {
      			// message is to be send
      			prev.temperature1 = var.temperature1;
      			var.timer1 = 60;
      		}
      	  }
      
      	  if( !var.timer2 || abs_int(prev.temperature2 - var.temperature2) > 10 ) {
      		Message::Value	msg(101, var.temperature2, Message::Value::TemperatureInt16 );
      
      		if( appl::Tx(Message::ID(Message::ID::Value), msg.Type(), msg, msg.Size(), false) == Message::State::TxOK ) {
      			// message is to be send
      			prev.temperature2 = var.temperature2;
      			var.timer2 = 60;
      		}
      	  }
      
      	}
      
          mcu::InterruptWait();
        }
      }
      

      call back:

      bool msg_scene_cbk(const uint8_t& msg) {
      
        const Message::Relay& data = *(const Message::Relay*)&(&msg)[sizeof(Message::Header)];
      
        switch( data.channel ) {
        case 0:
      	relay1.Set(data.relay);
      	led2.Run(1, 5);
      	return true;
        case 1:
      	relay2.Set(data.relay);
      	led2.Run(2, 5);
      	return true;
        }
      
        return false;
      }
      
      posted in General Discussion
      axillent
      axillent
    • RE: 230V power supply to Arduino

      @tbowmo said:

      What is the efficiency of these "cheap" mains -> 12V/5V converters?

      they are quite efficient. 5V version can deliver 400mA while unloaded supply consumes only 0.2W

      Also, it means that you need a second regulator (be that a linear, or a switching) from 12/5V -> 3.3V.

      output voltage is defined by output resistor divider. I have an experience on changing 12V output to 5V by replacing a single SMD resistor. Theoretically the same way you can get 3.3V directly from the supply.

      If you KNOW what you are doing, you could use SR036 from supertex, that can deliver 3.3V directly from mains (non isolated output).

      it could probably be used for mysensor connected dimers / light switches on mains. (something where human interface is not needed).

      that is true. I have the experience with SR036 (SR037 provides 5V output) and can say that you will never find smaller supply. But the output current will not exceed 50mA and this will depends on your mosfet output capability. Such a supply consumes about 1W while unloaded. Etc. not that green from the power consumption. This is my one side SR037 supply:
      photo 001.jpg

      if you know what you are doing it is also other choice - linkswitch chips LNK302/304/306. The last one can deliver up to 350mA not isolated power directly 5V or 3.3V. It is as efficient as isolated - unloaded it will consume about 0.2W. A bit bigger than SR036. Easy to construct because you do not need custom transformers. For example Duwi zwave wall switches are using this type of the supply. This is my one side SMD version with regulated output:
      photo 002.jpg

      next one is a classical low frequency transformer. The smallest here http://www.hahn-trafo.com/english/pcb-transformers-bv20.php - BV 201 0128 is ideal to power low power arduino device. It will consume unloaded about 1W. Can deliver about 60mA with linear regulator or about 100mA back regulated at 3.3V output. This one is my light controlling arduino using BV 201 0128:
      IMG_1880.JPG

      and the last one is capacitive supply. Most chinice cheap devices are using this type, most cheap supply:
      08908333.png

      posted in Hardware
      axillent
      axillent
    • RE: Your best advice on buying components?

      @fredswed I think to care too much about selecting source of items.

      I also tried different ones including ebay, mouser, farnel, sparkfun etc. end up to use only (mostly) ali.
      Spending time to analyse goods presented you will find that most sellers are providing same goods.
      The only difference between them is price and quality of service.

      Finally I refused to keep track on a particular sellers. Each time I need something I do search for best price and most sells and looking into ratings and customers feedback refuse worstest ones. Each such search requires just a few minutes to end up with purchase.

      In practice using such approach in most cases you will purchase from a small set of sellers. But there is no need to depend on them. In case of mistake in selecting seller you will call for your money.

      All this for DIY purpose. Time is not a critical issue.
      If you are about doing some commersial staff it is always a different story

      posted in General Discussion
      axillent
      axillent
    • RE: Custom made ethernet gateway based on atmega128

      it got been print-cased)

      IMG_2066.JPG IMG_2073.JPG IMG_2084.JPG

      this is in progress the development of gateway #2
      IMG_2085.JPG

      posted in Hardware
      axillent
      axillent
    • RE: Concept of a flexible but simple smart network

      also from last
      byteorder handling is build in
      library allows to choose any order
      I select bigendian because this is natural to my major MCU - STM8
      on little endian platforms (like STM32, ESP8266 and ARM64) data is automatically translated

      posted in General Discussion
      axillent
      axillent
    • RE: Custom made ethernet gateway based on atmega128

      the schematics
      MySensors.GW.atmega128-01.jpeg

      posted in Hardware
      axillent
      axillent
    • One way on how to reuse 433MHZ alarming sensors for Mysensors

      At house I'm having an alarming system with radio 433MHz operated sensors (motion, door, fire etc.).
      Those sensors are one way informers but for many purposes it is fine.
      The sensors I have are compatible with RCSwitch library and any alert is just a 4 bytes ID.

      Just released a prototype. This prototype combines a sensor node with radio retransmitter.
      While recieving ID from 433MHZ I look into EEPROM for a child_id and then resend alert to gateway using NRF24 and Mysensors protocol.

      I have to use two modes of operation, In first mode a first ID received is stored into EEPROM with allocated child_id. Also Mysensors presentation will be send to gateway. In this mode I can register RF433 sensor on the Controller.

      In second mode any ID recieved is resend to gateway while the ID is found in EEPROM with corresponding child_id

      Here is my prototype based on UNO and Humidity sketch. The 433MHZ receiver is attached to it. it is still behaves
      IMG_2099.JPG

      and some video http://www.youtube.com/watch?v=E4ZgnhwedXg

      posted in Hardware
      axillent
      axillent
    • Hardware debugging

      Just got success with hardware debugging using my JTAGICE3. Same way can be used for other atmel's debuggers

      The reason to look for solution came from this project http://forum.mysensors.org/topic/957/red-green-matrix-information-panel-with-real-time-clock
      Because there is no usual way to upload arduino sketch using JTAG I have to look for a solution based on Atmel Studio.
      The following steps are needed:

      1. To install Atmel Studio and VisualMicro plugin
      2. To setup your arduino project with VisualMicro
      3. Compile project
      4. Launch a second instance of AtmelStudio and go to File/Open menu. Select Open Object File for Debugging and find out the .ELF file inside the Debug folder inside Arduino project compiled by VisualMicro. Select "link to file" instead of copy
      5. Save new atmel Studio project, it will be a project for debug. Go to Project/Options/Tool and choose your debugging tool. Save project.

      After all this you will be able to debug your arduino using debugWire (atmega328) or JTAG (mega).

      After recompilation of the project your files will be reloaded in your debug project after pressing reload
      1Untitled.jpg

      You will probably also asked to recover source mappings:
      2Untitled.jpg

      Made your choice about mapping. You do not need to recover mappings to sources you are not interesting in. For example on my screen shot I have no interest to debug arduino internal sources this why I just press Finish

      posted in Hardware
      axillent
      axillent