Navigation

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

    OldSurferDude

    @OldSurferDude

    25
    Reputation
    50
    Posts
    107
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    OldSurferDude Follow

    Best posts made by OldSurferDude

    • RE: What's a good power bank for use with IoT?

      @NeverDie I am happy to report that my batteries arrived yesterday!

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: What's a good power bank for use with IoT?

      @NeverDie
      I'm going to dissipate the energy through a 25 ohm resistor. It will take about 24 hours to perform one capacity test. Often times I read that the full capacity won't be available until after a few charge-discharge cycles. 2 resistors, 4 batteries, 3 tests each. Assuming that I stay on top of it, it will take at least a week of testing which won't start until I get my 25 ohm resistors. I'll post a link to my full write up.

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: What's a good power bank for use with IoT?

      OK, I did my battery test. @NeverDie @Nca78 @mfalkvidd
      You can find it here

      The batteries from Newegg and Fullbattery are good ones.

      If you going to buy a large quantity and looking for a low price, then you should buy 1 or two and test them as I have done here. You might have to "kiss a lot of toads" before you find a good vendor, though.

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: Beginner concept question for serial communication

      @hubertus I'm not getting the description of you setup. Perhaps a sketch would be good?

      Wen I need serial communication, with the Arduino, I use SoftwareSerial on two other I/O lines. That way I can debug real time, SoftwareSerial is slower but you're only doing temperature so 9600BAUD would be fin

      Also, don't try to do too much at once. Break the task down into small, manageable sections. You have a lot of different things going on, get one thing going at a time.

      OSD

      posted in Troubleshooting
      OldSurferDude
      OldSurferDude
    • RE: What's a good power bank for use with IoT?

      @NeverDie I like your suggestion for solar panels, though my application only requires 1x 5W panel. And I like the idea of dismantling the power packs.

      I think we differ in our approaches, though. I seem to enjoy living on the "bleeding edge", that is, I'm more of a risk taker. My first house solar system, 2.8kW, was installed in 2004. When I upgraded to 4.2kW, I took the 14 panels and installed them on my hillside, so now I'm a net energy exporter. The 2.8kW portion is still producing at 85% of nameplate, shows little environmental degradation (sealant, too), and has paid for itself. The reward outweighed the risk.

      In taking risks, I learn much. Yes, I have a quite a few scars, actually and metaphorically. I have discovered a philosophy: Everything is an experiment. The point of an experiment is to learn something. So every experiment is a successful, just that sometimes the desired results are not realized. Eg. leaving an Arduino outdoors results in a short useful life. Spraying on a sealant extends the outdoor life.

      Good discussion. Thanks for the ideas

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: How to get Water Flow Meter to record lpm to computer

      I would be interested, too. I found just the sensor on Amazon and it looks like the meter is just timing the pulses per second. With a constant, one can determine the LPM You may be able to tap off of the sensor input, then through a resistor voltage divider make the output of the sensor compatible with your micro controller (Arduino). Using Processing on your computer you can capture the data from the Arduino.

      Have fun!

      OSD

      posted in My Project
      OldSurferDude
      OldSurferDude
    • RE: How to optimise a code (95% memory used)

      I found that timelib.h uses a tremendous amount of memory. You avoid using it by getting time string from the controller.

      I have also found that when you're using that amount of memory that bad things happen, as you noted. I use global variables to avoid the transient nature of function variables.

      I'll be looking forward to other comments as, I, too, do not know all the tricks;)

      OSD

      posted in Troubleshooting
      OldSurferDude
      OldSurferDude
    • RE: Future(s) of home automation (networks)

      I, too, am a "gray hair" (if I had hair). I despise cloud dependent devices. The reasons are many. ISPs, despite what they say, are not reliable. ISPs are so close to be monopolies, that they act like them. Your ISP can, and will, prevent access to the cloud if they have a competing product.

      The manufacturers of cloud dependent devices, sell your information and statistics on how you use the devices. This is how they make money. When one of these manufacturers goes out of business, the company that buys up the IP continues to sell that information and ceases the little support that one did get.

      I might be getting a little paranoid here, but I'm pretty sure there is unrelated-to-function software (spyware) incorporated into many products. (In the late 90's, the company for which I worked resisted the temptation to do so, despite heavy pressure from marketing.) I call it "ET phone home" Maybe the software is innocuous enough, but it can be hijacked by bad actors.

      There is another problem plaguing home automation and that is poorly designed and poorly documented (which leads to pathetically supported) hardware and software. More so the latter. FAQs and forums are afterthoughts of the slothful, but now it's all we have.

      I agree with ProfRob and I would add "better documentation".

      As a note, when I pull on my pants, I sit on my bed, start my pants onto my feet, roll back and pull both legs up at once 😉

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: NRF24L01 module help for IoT project!

      light travels at about 30cm/nS. The Uno can capture +/- 1μS at best, so, at best, your accuracy will be +/- 30m.

      In the nRF24 library I'm using, there timeouts, meaning that you will never know exactly how many μS a network.read() will take, adding multiples of 30m to the best case.

      +/-2m is not possible using an Uno and any radio.

      Try two GPS's, one on each module with each Nano and take the difference between the two. I'm pretty sure that would meet your spec. (Amazon) Yes, one GPS is rather inaccurate, but the inaccuracy is the same on two relatively close (google "differential GPS") That would be a cool project! And! you could log the track! You can find less expensive modules on AliExpress (caveat emptor and 20-90 days delivery)

      posted in Feature Requests
      OldSurferDude
      OldSurferDude
    • RE: What I must buy in order to measure mAh please

      @DenisJ Are you measuring a USB device? Look at something like this https://www.aliexpress.com/item/33019457512.html?gps-id=pcDetail404&scm=1007.16891.96945.0&scm_id=1007.16891.96945.0&scm-url=1007.16891.96945.0&pvid=824c24fa-034b-4801-b51d-50b2ad877945&_t=gps-id:pcDetail404,scm-url:1007.16891.96945.0,pvid:824c24fa-034b-4801-b51d-50b2ad877945,tpp_buckets:668%230%23131923%2330_668%230%23131923%2330_668%23888%233325%239_668%23888%233325%239_668%232846%238110%231995_668%232717%237561%23332__668%233374%2315176%2335_668%232846%238110%231995_668%232717%237561%23332_668%233164%239976%23761_668%233374%2315176%2335

      (AliExpress: Cheap prices and one could question the quality, but for the most part they work. Shipping takes about a month. rarely faster)

      posted in Hardware
      OldSurferDude
      OldSurferDude

    Latest posts made by OldSurferDude

    • RE: Simple door sensor battery node drains 2 x AA in a week due to pin D2

      @novicit @bjacobse Good call!

      posted in Troubleshooting
      OldSurferDude
      OldSurferDude
    • RE: How to make sense of Struct data received from Arduino in RPi via NRF24?

      @nrf24_is_hard When I sent data between an Aduino and the RPi I discovered that I have to make the the receiving and the sending structs the same size AND the variables be on 4 byte boundaries. Change your char name[15] to char name[16]

      Another challenge is that the number of bytes of type int are different. If I remember correctly, Arduino Uno is 2 bytes and RPi is 4 bytes.

      To make matters worse, some compilers make the least significant byte the first byte of a word and others make it the last byte of a word. eg, sending the value 1 would be received as 16777216 (0x00000001 vs 0x01000000)

      There are a lot more gotcha's 😉

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: long-term usage of nRF24L01+ with PA: no reliable transmission

      I just remembered the key technique to getting the communications working smoothly.

      I do all my communication synchronously. That is as follows:
      The master device sends a message to a node. The send command returns a success or fail, but fail does not mean the message was not received, it means that an ACK was not received. The master waits a timeout period for a response. If there is no response, a second attempt is made. If there is a response, the data with the response is processed. If not, the node is ignored.

      After that transaction, the master repeats this process with the next node and for each node there after. A round-robin.

      If a node does not get a request from the master within a certain interval, it reboots itself.

      If the system power cycles, the nodes inundate the the master with DHCP requests. Because of so many requests, requests can be ignored or two nodes might receive the same network address (different from NodeID). Eventually, one node will get a valid network address and begin to communicate as expected. This reduces the network traffic and the probability of another node receiving a unique network address improves. Eventually, all nodes connect. "Eventually" can be many, many minutes.

      The tree structure of the network means that some nodes send data through other nodes. In asynchronous communication, a node may be trying to send data while another node is sending data through it. I may not be correct in this, but I think that it is possible that this will corrupt one or both data packets. This is why I do the round-robin communication.

      The master only has 5 (4?) usable addresses to receive data. Like computer DHCP, addresses can be reserved for specific NodeID's. For example, address 3 an be reserved for NodeID 31, then NodeID 22 can have a reserved address of 43, thus NodeID 22 will always send data through NodeID 31. (addresses are octal). The address 4444 is reserved; this is the address a node requesting an address uses.

      To increase the chance of getting a valid address, I put a delay in the first DHCP request based upon the NodeID.

      I put the NodeID in EEPROM address 0, as does MySensors. I have one program that sets the NodeID and then my program for all of my nodes is the same.

      Nodes that sleep must have the flag set (in the node software) that indicates no data can be passed through it from another node.

      All of these hoops are handled by the MySensors libraries, though I force the NodeID. This my impetus to use MySensors. I must wonder though, "How much overhead is there? Do I have enough memory for my code?" So far I haven't had a problem.

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: hacking a Action Solar-light

      @A3V I had the same idea as you! Different company but same board for ~$13.

      What I found was the solar panel was anemic and the battery was pretty pathetic, too (~700mAh).

      For it to be a MySensors device, you'll have to add a radio and software (which means a computation device like an Arduino Nano).

      Using the MySensors libraries, I couldn't figure out how to get the Nano to go into a mode that was less than 10mA. This meant a more powerful solar panel and higher capacity battery.

      I didn't figure out, like you have, how the charging circuit work so I got an 18650 battery charging board. (75¢)

      I put a soil moisture sensor and a DHT11 humidity/temperature sensor on it and ditched the idea about motion sensing and lights.

      Because I was completely new to MySensors, getting the software to work was a challenge, but do-able.

      I'm using an RPi (that I already had) as a MySensors MQTT gateway and sending the readings to a linux computer running the MQTT broker. This passes the readings onto Home Assistant which is running in a virtual box on the same linux computer.

      I bought the computer for $90 (now $100) on Amazon because RPi's now cost upwards to $180 for a bare bones SBC! YIKES!

      Yup, this project got out of control but it works really well! Well, except that DHT's temperature seems to be completely uncalibrated and no two give the even close to the same temperature.

      Have Fun!

      posted in My Project
      OldSurferDude
      OldSurferDude
    • RE: Bootloading a barebones arduino

      @Larson said in Bootloading a barebones arduino:

      once a program is loaded with the ICSP using "Sketch/Upload Using Programmer", no further USB-TTL (USART) programming can occur until "Tools/Burn Bootloader" is subsequently executed.

      That is exactly right! Once you have all the wiring (I made up a wire harness for just that purpose) the processes are equally easy.

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: long-term usage of nRF24L01+ with PA: no reliable transmission

      @quaxman I have been running the nRF24L01+ without a PA for several years now in an outdoor environment, though in enclosures. Inside the enclosures is high humidity so I have sprayed a clear coating over the Nanos.

      The radio connection I have works (for the life of me, I don't know why). On the radio board I have soldered 8 right angle pins and a 10uF electrolytic cap soldered to GND and +V. On the nano I have soldered short 24AWG wires to a female connector.

      My code is based on the Tmrh20 libraries. Most of my code is error management.
      Included in that error management is a watchdog timer that will reboot the nano when communication is lost.

      Your right, reset does not work, but reboot does. I cannot tell you why this works.

      It was a tough slog to get to this point of stability and I did experience and overcame much of what you are seeing. I only destroyed 3 radios (of ~20) and those left work well. (On one I think only the transmitter got hosed.) Most of my problems now are self-inflicted.

      While I consider Tmrh20 a dedicated genius, this genius is just one person and the nuances of the nRF24l01+ are many.

      I am now experimenting with the MySensors libraries and have found them much easier in that the radios work (I don't know why they seem to work better). Using these libraries, my sensors and actuators are controlled by Arduino Nanos with nRF24L01+ radios. The MySensors Gateway is MQTT and runs on a Raspberry Pi 3B+ with an nRF24L01+ radio connected with 10cm of ribbon cable. My MQTT broker runs on a refurbished computer I bought on Amazon for $90 ($100 now) Instead of Windows, I'm running linux. Also on this computer I run a Virtual Box in which I have loaded my home automation controller Home Assistant

      This system seems to be working very well, but I yet to have the long term experience, so I cannot say that going this route will help. The downside I have found is the method Home Assistant uses to control devices is not intuitive.

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: Bootloading a barebones arduino

      @Larson, you got me thinking and I reviewed the Arduino page on boot loading. It is pretty clear that the Arduino IDE can either load a program or a bootloader. The bootloader code that will reside on the target is part of the Arduino IDE. One only needs to select the Arduino type.

      On another note, I was thinking about trying this myself. I went to the link from which you ordered your ATmeg328P and found that the delivered cost (to the USA) was about the same as the delivered price for an Arduino Nano knockoff with bootloader already programmed. I add this information because there are those among us that do not have the skill and experience to do what you are doing.

      Personally, I think what you're doing is pretty awesome and I wish you success.

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: Bootloading a barebones arduino

      @Larson
      I'm impressed about how much you have done here. I have a suggestion though I will readily admit to being ignorant about a lot of things.

      I have programed Arduino Nano's using the Arduino IDE ISP function. I had some with an old boot loader and some I just needed a touch more space. The programmed Arduino's are functioning as expected, so I don't think there's a problem.

      I used this Arduino page and this youtube video to guide me how to program the Nanos. These tell you that you use another Arduino to function as the ISP and how to fashion a cable. (Judging from the discussion here, I'm sure this is not a problem for you.)

      My question is, would this work to program a raw Atmega328p chip?

      OSD

      posted in General Discussion
      OldSurferDude
      OldSurferDude
    • RE: MQTT losing messages...

      @ben999

      Check out Serial Protocol

      I have four Arduinos. Each has a different MY_NODE_IDs (I use 130, 131, 132, 133). Each has four sensors: moisture, humidity, temperature, and voltage each of which has a CHILD_ID: CHILD_ID_MOISTURE is 0 , CHILD_ID_HUMIDITY is 1, CHILD_ID_TEMPERATURE is 2, CHILD_ID_VOLTAGE is 3.

      When an Arduino makes a measurement, it sends that measurement to a unique MQTT topic. In the case of the Arduino with MY_NODE_ID of 130 that is sending the moisture measurement, that MQTT topic is mysensors_out/130/0/1/0/35 and the message is [something like] 760 (35 is the value type)

      Similarly, when a controller sends a command to a device (Arduino), the topic is unique.

      If you have two actuators with the same MY_NODE_ID and CHILD_ID (MQTT topic) there would be confusion as to what you want each actuator to do. Likewise, if two sensors had the same MQTT topic, how would the controller know how to handle the data.

      posted in OpenHAB
      OldSurferDude
      OldSurferDude