How to mysensorise a new sensor via microUSB?



  • Hello all,

    I have a new air quality sensor, which is reposting the air quality via USB (9600) in the following format:

    10.0, 12.0, 2456.0
    

    First one is PM10
    Second one is PM25
    and last one is CO2

    How do I mysensorise it? Can I connect nrf24l01+ with a USB chip like this (http://2.bp.blogspot.com/-Ps46Q81M6Ws/UbNgRzcU7pI/AAAAAAAADuc/2T5ocrsacNc/s1600/uart_nrf24l01.jpg) or it has to be an Arduino + nrf24l01? As it is reported not in MySensors format, I suppose I do need Arduino....
    Any advice is welcome.


  • Hero Member

    @alexsh1 interesting. I assume you cannot take information from the inside circuitry?
    You will need at least an arduino with radio or ESP to connect the serial / USB port and interpret and translate the information to MySensors


  • Admin

    An option could be to use nodered to reformat the data into mysensors protocol format, and pass it on to your controller of choice.



  • @AWI I probably can, but this is a finished product and I got all I need from a microUSB. So fixing a small Arduino or atmega328p TQFP with nrf24l01+ is a good option. There are no transceivers in the sensor now just a display



  • @tbowmo can you please elaborate on it in terms of hardware?


  • Admin

    @alexsh1

    If you can't intercept the "serial" data before it enters USB (that is, there is no ft232, CH340 etc) then you have to use a device capable of acting like an USB host. That can in theory be implemented on a SAMD21, as it has host capabilities, but you need to write a device driver for it.

    On the other hand, you can connect it to a computer (raspberrypi, or the likes), which has a USB stack already, now you can get the data on a serial port (like you have already). Install node-red and have it listen on the serial data from the USB device, and then have node-red decode, and perhaps re-encode into mysensors serial protocol messages.

    I have done this with my utility meter sensor, which just counts pulses from the utility meter. It then reports the counts to my raspberry pi, which is running node-red. Node-red is also talking to domoticz on the other side, where domoticz thinks it's a mysensors serial gateway it talks to. I then inject messages from the utilitymeter into the datastream comming from the real mysensors gateway, and domoticz never knows what hit it.. :d

    In my setup it's only partly mysensorized, and only with the help of node-red.. (node-red is acting like a mysensors node)



  • @tbowmo Thanks for sharing your setup. My idea is to make it simple. Do not want to use RPi as I would like to keep the size small. The sensor is running on a battery so adding the RPi (even a small Zero) means less juice for the sensor.

    I think I'd go atmega328p tqfp with nrf24l01+ SMD purely to keep it small


  • Admin

    @alexsh1

    From your initial description it seems that you only have a USB interface available to communicate with the sensors?

    That means you have to implement a USB host device of some sorts, and a CDC driver for that host..

    In that respect, a raspberry would be the easiest route.. 🙂


  • Hardware Contributor

    There is an USB host shield:
    https://www.circuitsathome.com/arduino_usb_host_shield_projects/

    This could be a solution.


Log in to reply
 

Suggested Topics

  • 87
  • 8
  • 2
  • 7
  • 5
  • 10

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts