Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
hozzeH

hozze

@hozze
About
Posts
11
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Powering a sensor with digital out
    hozzeH hozze

    I'm stupid ! @Boots33 the debug info saved me. With debug info I came to notice that the sketch goes into loop part only if the gateway is also connected and available. Stupid me was doing the pin checks just by connecting the sensor and keeping the gateway disconnected , when I had the gateway connected I didn't bother to check the pin out, I was going in the same loop and wasting my and all your valuable time.

    Thanks for all your assistance people, you guys are awesome.

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    Was away from arduino for over a week with regular job. Tested the code with debug on a new arduino pro mini 3.3v 8Mhz and the below is the output ( please note that the values getting send are random values , i'm still not able to power the sensor with digital Pin )

    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
    TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=ok:2.0.0
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
    TSP:MSG:READ 0-0-1 s=255,c=3,t=15,pt=6,l=2,sg=0:0100
    TSP:MSG:SEND 1-1-0-0 s=1,c=0,t=35,pt=0,l=0,sg=0,ft=0,st=ok:
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=10,sg=0,ft=0,st=ok:SoilSensor
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:0.1
    Request registration...
    TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
    TSP:MSG:READ 0-0-1 s=255,c=3,t=27,pt=1,l=1,sg=0:1
    Node registration=1
    Init complete, id=1, parent=0, distance=1, registration=1
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:786
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:503
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:410
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:425
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:461
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:539
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:507
    TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=ok:392
    

    Looks fine for me , still I can't turn a digital pin On :disappointed:

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    Thanks guys, I will check this out.

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    @Boots33 , I enabled MY_DEBUG. Sorry if I sound stupid. I have connected the pro mini to computer with USB serial CP2102 for programming/serial debug , at the same time can I power the pro mini + Radio with an external power supply 3.3V ?

    I did something similar with a ATTINY85 few days back and bricked it :cry: ( Connected it to USB and same time powered it )

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    @TheoL :smiley: me too learning things the hard way.

    Thanks for all the pointers that you guys are giving . Looks as if I'm in the right place and with a great community,

    Let me tinker a bit more and see if I can get somewhere, if anyone can give any further info kindly do.

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    @TheoL I have two pro mini's. I measured the voltage across a output pin ( HIGH ) and GND and it gives me near 5V on one and near 3.3V on another .So it looks as if I do have 5V pro mini.

    I have tried few other sketches on both, seems they are working fine, I face the specific issue only when including the Mysensor.h library. I will give it a try on a nano that I have and see what happens.

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    I see that output on pro mini Atmega168 3.3v with commented sketch.
    I tried with a different 5v pro mini Atmega368 and I'm getting 5.04V on output pin with commented sketch.

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    @Yveaux I don't have those defined. Below is my current code.

    #define MY_NODE_ID 1  // node id 
    #define MY_RADIO_NRF24  // enabling support for NRF radio module
    #define NODE_ID 1  // sensor id
    #define SENS_ON 5
    #define VAL_PROBE A0
    #include <MySensors.h>
    
    MyMessage msg(NODE_ID, V_LEVEL); // constructing the msg
    
    void setup()
    {
      pinMode(SENS_ON, OUTPUT);
    }
    
    void presentation()
    {
      present(NODE_ID, S_MOISTURE);  // presenting the sensor 
      sendSketchInfo("SoilSensor", "0.1"); //meta data 
    }
    
    void loop()
    {
      digitalWrite(SENS_ON, HIGH);
      delay(1000); // To check the input voltage of pin 2
      int moisture = analogRead(VAL_PROBE); //measuring the moisture
      send(msg.set(moisture));  // sending the data 
      digitalWrite(SENS_ON, LOW); // turn it off
    //  sleep(1000);  // sleeping for 10 sec
    }
    

    An as soon as I comment it out like below the pin out on 5 works

    #define MY_NODE_ID 1  // node id 
    #define MY_RADIO_NRF24  // enabling support for NRF radio module
    #define NODE_ID 1  // sensor id
    #define SENS_ON 5
    #define VAL_PROBE A0
    //#include <MySensors.h>
    
    MyMessage msg(NODE_ID, V_LEVEL); // constructing the msg
    
    void setup()
    {
      pinMode(SENS_ON, OUTPUT);
    }
    
    void presentation()
    {
    //  present(NODE_ID, S_MOISTURE);  // presenting the sensor 
    //  sendSketchInfo("SoilSensor", "0.1"); //meta data 
    }
    
    void loop()
    {
      digitalWrite(SENS_ON, HIGH);
      delay(1000); // To check the input voltage of pin 2
      int moisture = analogRead(VAL_PROBE); //measuring the moisture  
    // send(msg.set(moisture));  // sending the data 
      digitalWrite(SENS_ON, LOW); // turn it off
    //  sleep(1000);  // sleeping for 10 sec
    }
    
    Development

  • Powering a sensor with digital out
    hozzeH hozze

    @mfalkvidd : Removed SPI.h , it didn't help though. Thanks for pointers on cleaning up the code :smiley:
    @Yveaux :
    Tried with pin 5 , same result.
    Tried using a different pro mini ( Atmega328 16Mhz 5 v ) got same result , no output on pin :expressionless:

    Development

  • Powering a sensor with digital out
    hozzeH hozze

    @TheoL , Thanks for the suggestion . Tried that, same result.

    @mfalkvidd , Thanks for the code suggestion, I made the change. Regarding the issue, I did check with a multi-meter and it shows 0V . To make sure I also used the example blink sketch with pin 2 as output and it is showing 3.24V I will attach the wiring diagram(I haven't drawn one). Things I noticed.

    • On commenting the Mysensor.h library and related code from above sketch I'm able to turn on the Pin
    • I tried using different digital pins and same result.
    • To make sure I measured the output pin voltage powering it with USB ( without connecting the board to radio and soil sensor ) , same result voltage is 0V
    Development

  • Powering a sensor with digital out
    hozzeH hozze

    Hi,

    I'm trying to power a sensor with one of the digital pins of Arduino. Issue I'm facing is I'm unable to turn on digital pin, I have tried quite few options. I feel I'm missing something simple but its wrecking my brain. Can any one of you look at the code and see what I'm doing wrong, please.

    Arduino : pro mini Atmega168 3.3v

    #define MY_NODE_ID 1  // node id 
    #define MY_RADIO_NRF24  // enabling support for NRF radio module
    #define NODE_ID 1  // sensor id
    #define SENS_ON 2
    #include <MySensors.h>
    #include <SPI.h>
    
    
    MyMessage msg(NODE_ID, V_LEVEL); // constructing the msg
    const int VAL_PROBE = 0; // initializing the moisture variable
    
    void setup()
    {
      pinMode(SENS_ON, OUTPUT);
    }
    void presentation()
    {
      present(NODE_ID, S_MOISTURE);  // presenting the sensor 
      sendSketchInfo("SoilSensor", "0.1"); //meta data 
    }
    
    void loop()
    {
      digitalWrite(SENS_ON, HIGH);
      delay(10000); // To check the input voltage on pin 2
      int moisture = analogRead(VAL_PROBE); //measuring the moisture
      send(msg.set(moisture));  // sending the data 
      sleep(1000);  // sleeping for 10 sec
    }
    
    Development
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular