Navigation

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

    Ptibu

    @Ptibu

    4
    Reputation
    10
    Posts
    517
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Ptibu Follow

    Best posts made by Ptibu

    • RE: 💬 Sensebender Micro mk2

      @tbowmo
      Another big advantage of the SAML over the SAMD is the embedded AES core. It would allow strong crypto for both comm & data encryption (at MCU level, not radio) and authentication (ex: AES based CMAC). In this case, the ATSHA is not needed anymore for auth but it will break compatibility with existing ATSHA based boards (unless implementing SHA256 in SW).
      For what I can see, cost for SAML is about the same than SAMD + ATSHA (+/- 0.5€).

      For new (secured) mysensors networks, SAML would have nice advantages with comparable price (+dev efforts of course).

      posted in OpenHardware.io
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      @MiKa Here is my sketch if it helps (MySensors v2.2.0-Beta). It uses ALS, BMP180 and RGB leds.
      Working well with my nRF24 LNA+PA GW.

      #include <Arduino.h>
      #define MY_DEBUG
      #define MY_BAUD_RATE 9600
      
      // Mode Radio / Enable and select radio type attached
      #define MY_RADIO_NRF5_ESB
      #define MY_NRF5_ESB_PA_LEVEL NRF5_PA_MAX
      #define MY_NODE_ID 6
      #include "MySensors.h"
      #include <Wire.h>
      #include <Adafruit_BMP085.h>
      
      Adafruit_BMP085 bmp = Adafruit_BMP085();
      
      #define CHILD_ID_TEMP 0
      #define CHILD_ID_BARO  1
      #define CHILD_ID_ALS  2
      
      #define SLEEP_NODE true // True to activate Sleep Mode, but currently unsupported on esp8266
      unsigned long SLEEP_TIME = 120 * 1000; // Sleep time between reads (in milliseconds)
      
      #define RED_PIN 17
      #define GREEN_PIN 18
      #define BLUE_PIN 19
      
      #define COLOR_OFF     0
      #define COLOR_RED     1
      #define COLOR_GREEN   2
      #define COLOR_BLUE    4
      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      MyMessage msgBaro(CHILD_ID_BARO, V_PRESSURE);
      MyMessage msgForecast(CHILD_ID_BARO, V_FORECAST);
      MyMessage msgALS(CHILD_ID_ALS, V_LIGHT_LEVEL);
      
      void setColor (uint8_t c) {
        digitalWrite (RED_PIN, !(c & COLOR_RED));
        digitalWrite (GREEN_PIN, !(c & COLOR_GREEN));
        digitalWrite (BLUE_PIN, !(c & COLOR_BLUE));
      }
      
      void setup() {
        setColor (COLOR_RED);
        setColor (COLOR_GREEN);
        setColor (COLOR_BLUE);
        Wire.begin();
        pinMode (RED_PIN, OUTPUT);
        pinMode (GREEN_PIN, OUTPUT);
        pinMode (BLUE_PIN, OUTPUT);
        setColor (COLOR_RED);
        delay(250);
        setColor (COLOR_GREEN);
        delay(250);
        setColor (COLOR_BLUE);
        delay(250);
        setColor (COLOR_OFF);
      
        /* BMP180.  */
        if (!bmp.begin()) {
          Serial.println("Could not find a valid BMP085 sensor, check wiring!");
          setColor (COLOR_RED);
          while (1);
        }
      }
      
      void presentation()  {
        sendSketchInfo("nrf Sensor TAG", "1.0.0");
      
        // Sensor presentation to the GW
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_BARO, S_BARO);
        present(CHILD_ID_ALS, S_LIGHT_LEVEL);
      }
      
      void AP3216_write(uint8_t regAddress, uint8_t value) {
        Wire.beginTransmission(0x1E); // I2C Address of AP3216 sensor is 0x1E
        Wire.write(regAddress);
        Wire.write(value);
        Wire.endTransmission();
      }
      
      uint8_t AP3216_read(uint8_t regAddress) {
        Wire.beginTransmission(0x1E); // I2C Address of AP3216 sensor is 0x1E
        Wire.write(regAddress);
        Wire.endTransmission();
        Wire.requestFrom(0x1E, 1, true);
        return Wire.read() & 0xFF;
      }
      
      
      uint16_t readALS (void)
      {
        /* System mode: ALS function once */
        AP3216_write (0x0, 0x5);
        delay (250);
        return ((uint16_t) AP3216_read (0xC) << 8) | AP3216_read (0xD);
      }
      
      void loop() {
        send(msgTemp.set(bmp.readTemperature(), 1));
        send(msgBaro.set(bmp.readPressure(), 1));
        send(msgForecast.set(bmp.readSealevelPressure(834.0), 1));  /* Change altitude here !   */
        send(msgALS.set(readALS(), 1));
      
        setColor (COLOR_BLUE);
        delay (250);
        setColor (COLOR_OFF);
      
        if (SLEEP_NODE)
          sleep(SLEEP_TIME);
        else
          delay (SLEEP_TIME);
      }
      

      You also need to change SDA/SCL pins by creating a new board from the Generic nRF51 (or modifying it)
      In variant.h:

      #define PIN_WIRE_SDA         (9u)
      #define PIN_WIRE_SCL         (10u)
      
      posted in Hardware
      Ptibu
      Ptibu
    • RE: 💬 Sensebender Micro mk2

      @scalz said:

      Is SAML Arduino compatible now?

      Not yet. but it is WIP
      https://github.com/arduino/arduino-builder/issues/176#issuecomment-269110984

      @Cliff-Karlsson said:

      Is there any site where you can upload the pcb+bom and have all the components (maybe not radio and pinheaders) soldered before they send the pcb?

      It is called PCBA service. dirtypcbs and itead have such services.
      Got price estimation from itead few weeks ago for this board: about 550$ / 10 boards, including PCD ~100$, stencil ~60$, components ~219$ and assembly ~150$)

      posted in OpenHardware.io
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      I only tried stlink v2 which works pretty well.

      posted in Hardware
      Ptibu
      Ptibu

    Latest posts made by Ptibu

    • RE: nRF5 Multi Sensor Board (12-14€)

      @aguedob I do not have much time these days, and do not investigate the power consumption issue, But this is not a reset issue...
      @Nca78 Nice information. should give this a try when I'll be less busy.

      posted in Hardware
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      @d00616 said in nRF5 Multi Sensor Board (12-14€):

      @Ptibu said in nRF5 Multi Sensor Board (12-14€):

      I don't know how the sleep is implemented (CONFIG/GPIOTE) and if I'm facing this bug, but my battery lasts 2 days, with a wake-up period of 2 minutes (QFAAH0 MCU)... any idea?

      Do you have powered off the MCU after flashing? After programming, the debug interface is active. To disable this interface, you have to reset the MCU.

      I'm not sure if I reset it. I will check this with a new battery and a multimeter. Thank you for the hint!

      posted in Hardware
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      @d00616 said in nRF5 Multi Sensor Board (12-14€):

      @d00616 said in nRF5 Multi Sensor Board (12-14€):

      Sleeping until pin interrupt consumes 1mA -> https://github.com/sandeepmistry/arduino-nRF5/issues/153

      I have found some documentation. The high current consumption was listed as PAN#39 and is fixed with this MCU: http://infocenter.nordicsemi.com/pdf/nRF51822-pan_v3.0.pdf

      The MCU is nRF51822QFAAH0.

      I don't know how the sleep is implemented (CONFIG/GPIOTE) and if I'm facing this bug, but my battery lasts 2 days, with a wake-up period of 2 minutes (QFAAH0 MCU)... any idea?

      posted in Hardware
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      I only tried stlink v2 which works pretty well.

      posted in Hardware
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      @d00616 Thanks for porting !

      posted in Hardware
      Ptibu
      Ptibu
    • RE: nRF5 Multi Sensor Board (12-14€)

      @MiKa Here is my sketch if it helps (MySensors v2.2.0-Beta). It uses ALS, BMP180 and RGB leds.
      Working well with my nRF24 LNA+PA GW.

      #include <Arduino.h>
      #define MY_DEBUG
      #define MY_BAUD_RATE 9600
      
      // Mode Radio / Enable and select radio type attached
      #define MY_RADIO_NRF5_ESB
      #define MY_NRF5_ESB_PA_LEVEL NRF5_PA_MAX
      #define MY_NODE_ID 6
      #include "MySensors.h"
      #include <Wire.h>
      #include <Adafruit_BMP085.h>
      
      Adafruit_BMP085 bmp = Adafruit_BMP085();
      
      #define CHILD_ID_TEMP 0
      #define CHILD_ID_BARO  1
      #define CHILD_ID_ALS  2
      
      #define SLEEP_NODE true // True to activate Sleep Mode, but currently unsupported on esp8266
      unsigned long SLEEP_TIME = 120 * 1000; // Sleep time between reads (in milliseconds)
      
      #define RED_PIN 17
      #define GREEN_PIN 18
      #define BLUE_PIN 19
      
      #define COLOR_OFF     0
      #define COLOR_RED     1
      #define COLOR_GREEN   2
      #define COLOR_BLUE    4
      
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      MyMessage msgBaro(CHILD_ID_BARO, V_PRESSURE);
      MyMessage msgForecast(CHILD_ID_BARO, V_FORECAST);
      MyMessage msgALS(CHILD_ID_ALS, V_LIGHT_LEVEL);
      
      void setColor (uint8_t c) {
        digitalWrite (RED_PIN, !(c & COLOR_RED));
        digitalWrite (GREEN_PIN, !(c & COLOR_GREEN));
        digitalWrite (BLUE_PIN, !(c & COLOR_BLUE));
      }
      
      void setup() {
        setColor (COLOR_RED);
        setColor (COLOR_GREEN);
        setColor (COLOR_BLUE);
        Wire.begin();
        pinMode (RED_PIN, OUTPUT);
        pinMode (GREEN_PIN, OUTPUT);
        pinMode (BLUE_PIN, OUTPUT);
        setColor (COLOR_RED);
        delay(250);
        setColor (COLOR_GREEN);
        delay(250);
        setColor (COLOR_BLUE);
        delay(250);
        setColor (COLOR_OFF);
      
        /* BMP180.  */
        if (!bmp.begin()) {
          Serial.println("Could not find a valid BMP085 sensor, check wiring!");
          setColor (COLOR_RED);
          while (1);
        }
      }
      
      void presentation()  {
        sendSketchInfo("nrf Sensor TAG", "1.0.0");
      
        // Sensor presentation to the GW
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_BARO, S_BARO);
        present(CHILD_ID_ALS, S_LIGHT_LEVEL);
      }
      
      void AP3216_write(uint8_t regAddress, uint8_t value) {
        Wire.beginTransmission(0x1E); // I2C Address of AP3216 sensor is 0x1E
        Wire.write(regAddress);
        Wire.write(value);
        Wire.endTransmission();
      }
      
      uint8_t AP3216_read(uint8_t regAddress) {
        Wire.beginTransmission(0x1E); // I2C Address of AP3216 sensor is 0x1E
        Wire.write(regAddress);
        Wire.endTransmission();
        Wire.requestFrom(0x1E, 1, true);
        return Wire.read() & 0xFF;
      }
      
      
      uint16_t readALS (void)
      {
        /* System mode: ALS function once */
        AP3216_write (0x0, 0x5);
        delay (250);
        return ((uint16_t) AP3216_read (0xC) << 8) | AP3216_read (0xD);
      }
      
      void loop() {
        send(msgTemp.set(bmp.readTemperature(), 1));
        send(msgBaro.set(bmp.readPressure(), 1));
        send(msgForecast.set(bmp.readSealevelPressure(834.0), 1));  /* Change altitude here !   */
        send(msgALS.set(readALS(), 1));
      
        setColor (COLOR_BLUE);
        delay (250);
        setColor (COLOR_OFF);
      
        if (SLEEP_NODE)
          sleep(SLEEP_TIME);
        else
          delay (SLEEP_TIME);
      }
      

      You also need to change SDA/SCL pins by creating a new board from the Generic nRF51 (or modifying it)
      In variant.h:

      #define PIN_WIRE_SDA         (9u)
      #define PIN_WIRE_SCL         (10u)
      
      posted in Hardware
      Ptibu
      Ptibu
    • RE: 💬 Sensebender Micro mk2

      @tbowmo OK, for 100 pieces, it makes a huge difference, sorry.
      And glad to see the gateway available, good work !

      posted in OpenHardware.io
      Ptibu
      Ptibu
    • RE: 💬 Sensebender Micro mk2

      @scalz said:

      Is SAML Arduino compatible now?

      Not yet. but it is WIP
      https://github.com/arduino/arduino-builder/issues/176#issuecomment-269110984

      @Cliff-Karlsson said:

      Is there any site where you can upload the pcb+bom and have all the components (maybe not radio and pinheaders) soldered before they send the pcb?

      It is called PCBA service. dirtypcbs and itead have such services.
      Got price estimation from itead few weeks ago for this board: about 550$ / 10 boards, including PCD ~100$, stencil ~60$, components ~219$ and assembly ~150$)

      posted in OpenHardware.io
      Ptibu
      Ptibu
    • RE: 💬 Sensebender Micro mk2

      @tbowmo
      Another big advantage of the SAML over the SAMD is the embedded AES core. It would allow strong crypto for both comm & data encryption (at MCU level, not radio) and authentication (ex: AES based CMAC). In this case, the ATSHA is not needed anymore for auth but it will break compatibility with existing ATSHA based boards (unless implementing SHA256 in SW).
      For what I can see, cost for SAML is about the same than SAMD + ATSHA (+/- 0.5€).

      For new (secured) mysensors networks, SAML would have nice advantages with comparable price (+dev efforts of course).

      posted in OpenHardware.io
      Ptibu
      Ptibu
    • RE: 💬 Sensebender Micro mk2

      Hello, tbowmo
      I'm new to mysensors and home automation and this board is exactly what I was looking for, great job !
      Have you received prototypes? Do you plan to sell it ?
      And what about using SAML instead of SAMD for ULP nodes? Would it be supported by Mysensors?
      Thank you for sharing!

      posted in OpenHardware.io
      Ptibu
      Ptibu