Navigation

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

    Kokosnoot

    @Kokosnoot

    12
    Reputation
    10
    Posts
    816
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Kokosnoot Follow

    Best posts made by Kokosnoot

    • Wireless bike pumps and computer game using MySensors

      Hi,

      I run a couple of sensors using MySensors in my household which send temperatures, airpressure, humidities of various rooms as well as automatic watering some plants with peristaltic pumps when a threshold has been exceeded. However, for an "open day" event at my employer I suggested to make a game involving bike pumps which will control water levels. Children (and also adults 😉) have to physically pump on the the pumps. To make everything wireless, I used the MySensors library to see if I could use it for this game. Just wanted to share this project with you and some background as it might inspire someone else to make something fun!

      alt text

      So how does it work?

      An Arduino Pro Mini (3.3v) , NRF24l01, a joystick (configured to be two-directional), a 18650 battery holder+regulator for 3.3v, and microphone (MAX9814) are inside each pump. The bike pump's tube is actually going inside the box with the microphone. Using Arduino code the microphone is looking for certain threshold (peak) volume for a et amount of time... When the bike pump goes "psssh" 😄 this threshold is exceeded and some custom data is send to the gateway.

      Data send can be anything, but for me it was just: PlayerId|PumpDirection|Strength. Also, these "player nodes" are all wireless and you could put them anywhere 😎 . In the end the green node was closer to the TV as it started to have some connection issues for whatever reasons (could be very well my soldering and all the massive vibrations from the children being really though on these devices!!)

      Gateway is an ESP8266 (as "serial gateway") also with NRF24L01 attached and three programmable LED strips. Every time when data is received; the receive() function will dissect the input data so the appropriate LED strip can be triggered... Pumping would generate a "wave" effect in the LED strips. The direction of the pumping would also change whether the wave would go from the player or to the player.

      The ESP8266 is connected with only USB to a laptop. The game engine Unity is just processing the incoming packets directly on the serial port, and splitting the incoming data, etc:

      3;0;1;0;23;1|0|123

      which would be: Player 1, Direction 0, Strength 123. It would even ignore the rest of the standard MySensors information as I really didn't care and only would allow packets which would result in three values anyway. So that would trigger the "pump" in the game... either one of the two windmills or the steam pump.

      alt text

      Now, I can guarantee that the result was a lot of excited children - and adults - that were... pumped 💪 to get going! I noticed one of the holes on top of the bike pump got quite a bit larger! However I do not really feel like putting photos online these days with people (especially children) I do not know.

      In total 153 games of 2 minutes were played in 6.5h time! 😃

      posted in My Project
      Kokosnoot
      Kokosnoot
    • RE: Trying to design MySensors PCB / Fritzing

      @sundberg84 said in Trying to design MySensors PCB / Fritzing:

      @kokosnoot MySensors kicad library: https://github.com/mysensors-kicad

      I managed to install that one with a bit of effort last weekend. 👌 😃

      However, inspired by bgunnarb I am already trying again for 40minutes to get a DHT11 footprint properly working, but failing thus far. There seems to be some in: https://github.com/KiCad/kicad-footprints/tree/master/Sensor.pretty but KiCad does not appreciate that as a library, (the default is to work from github.com/kicad/Capacitors_SMD.pretty for example, but those are all archived pages)

      I manually tried adding https://github.com/KiCad/kicad-footprints/tree/master/Sensor.pretty - similar as the other libraries (type Github, etc) but just get a "ZIP error"... Maybe I should try a nightly build instead of the stable 5.0.2.

      Edit: Just got it to work by downloading the entire 5.1.0 footprint library locally, and pointing to the [..]\footprints\Sensor.pretty file. Inspired by someone else with the same issue: https://forum.kicad.info/t/personal-footprints-via-on-demand-github-plugin-error-reading-zip-local-header/11777 😃. Hopefully this info might help someone else at some point!

      posted in Hardware
      Kokosnoot
      Kokosnoot
    • RE: [SOLVED] NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?

      Re: NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?

      Separate reply just for searching purposes:

      It worked :-)! Now it's working perfect without changing a single line of code or changing wires. I took the risk of destroying the module, but otherwise it's useless anyway for my project. I managed to use a knife to take a few mm's of pin 13 up and then to solder a wire to pin 8 and pin 13. As described in the linked topic.

      0_1493305335364_sdcardfix.jpg

      My SD backup system one step closer! 😄

      posted in Troubleshooting
      Kokosnoot
      Kokosnoot

    Latest posts made by Kokosnoot

    • RE: Trying to design MySensors PCB / Fritzing

      @sundberg84 said in Trying to design MySensors PCB / Fritzing:

      @kokosnoot MySensors kicad library: https://github.com/mysensors-kicad

      I managed to install that one with a bit of effort last weekend. 👌 😃

      However, inspired by bgunnarb I am already trying again for 40minutes to get a DHT11 footprint properly working, but failing thus far. There seems to be some in: https://github.com/KiCad/kicad-footprints/tree/master/Sensor.pretty but KiCad does not appreciate that as a library, (the default is to work from github.com/kicad/Capacitors_SMD.pretty for example, but those are all archived pages)

      I manually tried adding https://github.com/KiCad/kicad-footprints/tree/master/Sensor.pretty - similar as the other libraries (type Github, etc) but just get a "ZIP error"... Maybe I should try a nightly build instead of the stable 5.0.2.

      Edit: Just got it to work by downloading the entire 5.1.0 footprint library locally, and pointing to the [..]\footprints\Sensor.pretty file. Inspired by someone else with the same issue: https://forum.kicad.info/t/personal-footprints-via-on-demand-github-plugin-error-reading-zip-local-header/11777 😃. Hopefully this info might help someone else at some point!

      posted in Hardware
      Kokosnoot
      Kokosnoot
    • RE: Trying to design MySensors PCB / Fritzing

      Hi sundberg84,

      Thanks for your reply!

      The "lose trace" was more just a stopping point, as I wanted to be sure that I was doing things how they (kind of) should be! I thought it would not be good to try to make everything perfect, and then end up with question 1 being "no" ☺.

      All your other answers are clear, thanks a lot for that!

      @bgunnarb: Thanks for the suggestion! I did run into issues where KiCad is a bit.. too much on the parts (eg. I should measure the dimensions of my resistors to find the right option in the list). I also ahd some issues with schemas / footprints (not every part has a footprint or a schema, such as the MySensors library). but I suppose I can just work with footprints.

      Maybe I will give it another try. It does make a "cleaner" PCB when I was trying to make something similar as the image above.🙂

      posted in Hardware
      Kokosnoot
      Kokosnoot
    • Trying to design MySensors PCB / Fritzing

      Hi,

      So far all my MySensors projects have either been running on breadboards or stripboards with lots of wires going everywhere, while the design in most cases is the same. Some of the older sensors are a bit unreliable due to the jumper wires just making not good enough connections, etc. So I thought it would be interesting to design a PCB, something I have always wanted to do at some point, but now with PCB printing becoming more accessible (and cheaper) this actually becomes an option for me. I considered the EasyPCB too, but just think this might be a good skill to learn for some other projects in the future 😄

      So, I was trying to design a PCB in Fritzing - Also have tried KiCad but I think that is just a tiny bit next level, although the routing seems to be easier. However, got some issues with getting all the parts loaded properly (have the MySensors library loaded however) .

      I did some reading and I was wondering if the following two things in the image are allowed?

      A: Shows a "via" which makes a change from layer top/bottom to the other one to "cross" two other wires
      B: Shows are trace (12mil) going between two holes of the Arduino. (this case the battery level check wire)

      Also:

      1. I assume for traces I do not need to stick to the grid.
      2. a different layer trace should not cross a hole, as that makes no sense and will become one when soldering.

      It's a while new world and a lot of information everywhere, so I am just trying to stick to the basics of having wires not intersect with each other unless it's a VCC/GND

      0_1552225761912_CompleteSensorNode-ForPCB2_pcb.png

      Thanks for your quick peek and feedback!

      posted in Hardware
      Kokosnoot
      Kokosnoot
    • Wireless bike pumps and computer game using MySensors

      Hi,

      I run a couple of sensors using MySensors in my household which send temperatures, airpressure, humidities of various rooms as well as automatic watering some plants with peristaltic pumps when a threshold has been exceeded. However, for an "open day" event at my employer I suggested to make a game involving bike pumps which will control water levels. Children (and also adults 😉) have to physically pump on the the pumps. To make everything wireless, I used the MySensors library to see if I could use it for this game. Just wanted to share this project with you and some background as it might inspire someone else to make something fun!

      alt text

      So how does it work?

      An Arduino Pro Mini (3.3v) , NRF24l01, a joystick (configured to be two-directional), a 18650 battery holder+regulator for 3.3v, and microphone (MAX9814) are inside each pump. The bike pump's tube is actually going inside the box with the microphone. Using Arduino code the microphone is looking for certain threshold (peak) volume for a et amount of time... When the bike pump goes "psssh" 😄 this threshold is exceeded and some custom data is send to the gateway.

      Data send can be anything, but for me it was just: PlayerId|PumpDirection|Strength. Also, these "player nodes" are all wireless and you could put them anywhere 😎 . In the end the green node was closer to the TV as it started to have some connection issues for whatever reasons (could be very well my soldering and all the massive vibrations from the children being really though on these devices!!)

      Gateway is an ESP8266 (as "serial gateway") also with NRF24L01 attached and three programmable LED strips. Every time when data is received; the receive() function will dissect the input data so the appropriate LED strip can be triggered... Pumping would generate a "wave" effect in the LED strips. The direction of the pumping would also change whether the wave would go from the player or to the player.

      The ESP8266 is connected with only USB to a laptop. The game engine Unity is just processing the incoming packets directly on the serial port, and splitting the incoming data, etc:

      3;0;1;0;23;1|0|123

      which would be: Player 1, Direction 0, Strength 123. It would even ignore the rest of the standard MySensors information as I really didn't care and only would allow packets which would result in three values anyway. So that would trigger the "pump" in the game... either one of the two windmills or the steam pump.

      alt text

      Now, I can guarantee that the result was a lot of excited children - and adults - that were... pumped 💪 to get going! I noticed one of the holes on top of the bike pump got quite a bit larger! However I do not really feel like putting photos online these days with people (especially children) I do not know.

      In total 153 games of 2 minutes were played in 6.5h time! 😃

      posted in My Project
      Kokosnoot
      Kokosnoot
    • RE: Doubling amount of soil sensors using transistors?

      Ah, I did have mixed feelings about the alternating. I also don't know what happens with ions when water moves down after watering some plants.

      I did came across this page (in Dutch, but code in English) which kind of shows a very simple example of using the CD74H4067 multiplexer: http://12volt.kloppenburgweb.nl/een-garduino/.

      It might be a good thing to see how it performs and come up with something alternative if really needed. I was also thinking of adding some glue to the parts exposed to air.

      Thanks again!

      posted in Development
      Kokosnoot
      Kokosnoot
    • RE: Doubling amount of soil sensors using transistors?

      Hi Michiel,

      Thanks for that idea! I didn't knew these IC's existed. It looks like a good approach to me. Also good to know for other future Arduino projects.

      The only thing I was wondering if the "alternating" DC would still be feasible.
      I think the GND of the IC needs to alternate between two analog pins, using the pinMode INPUT_PULLUP similar as how it is now. This of course in order to prevent corrosion from happening due to all the ions flowing to one direction :).

      Will still have to read more about this, I expect I am not the first one that tries to do it like this!

      posted in Development
      Kokosnoot
      Kokosnoot
    • Doubling amount of soil sensors using transistors?

      My sensors projects are going well and I have three nodes running doing various things, connecting to an ESP8266. I hope to write more in depth about these as soon I have moved them from breadboard to some PCB, it also has direct SD card backup, web logging as well as writing to a MQTT server. Works quite good :-). After years of messing with 433mhz modules (and giving up),some other kind of transceivers (forgot), things are looking well!

      But I have a question about the soil sensor setup. I use the sensor system as described in various topics: the "fork" of the typical soil moisture sensor using two analog pins which alternate while reading. Works well: I have three sensors (A0, A1), (A2, A3) and (A4,A5) on my Pro mini 3.3v. Battery sensing has moved to A7 because of the pull up resistor restriction (not available on A6,A7).

      Now, I am mostly a programmer and electronics are still quite new to me. I was wondering if I could extend the amount of soil sensors easily to 6 by putting 6 transistors (2 per Analog pin pair) all to one Digital pin (Say: D0) in order to double the amount of soil sensors?

      Example:

      D0 - LOW: Read soil sensor 1,2,3 from A0-A5
      D0 - HIGH: Read soil sensor 4,5,6 from A0-A5

      Would this work? Or am I simplifying things too much from an circuit point of view? :-). And would any "standard" NPN transistor work for this?

      Thanks a lot!

      posted in Development
      Kokosnoot
      Kokosnoot
    • RE: [SOLVED] NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?

      Re: NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?

      Separate reply just for searching purposes:

      It worked :-)! Now it's working perfect without changing a single line of code or changing wires. I took the risk of destroying the module, but otherwise it's useless anyway for my project. I managed to use a knife to take a few mm's of pin 13 up and then to solder a wire to pin 8 and pin 13. As described in the linked topic.

      0_1493305335364_sdcardfix.jpg

      My SD backup system one step closer! 😄

      posted in Troubleshooting
      Kokosnoot
      Kokosnoot
    • RE: [SOLVED] NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?

      Hi Yveaux,

      I don't know what comes after quadruple (quintuble? :)) but I checked the wires many times. Radio works perfect without SD card reader. SD card worked with radio connected - but then the radio does not work anymore.

      I made a fritzing of my setup, just to spot any errors, just to go check each connection once more.

      0_1493301509222_fritzing-sketches_sd_nrf-small.png

      One thing I can think of is that the GPIO15 is a hardware CS (HCS), while my D4 is not. But every example I see on the internet says that practically any pin can be the CS pin?

      Update

      More searching let me to this topic: https://forum.arduino.cc/index.php?topic=360718.0 which I think might be the case. Unfortunately, I do not have the tools to apply this fix I think. alt text

      posted in Troubleshooting
      Kokosnoot
      Kokosnoot
    • [SOLVED] NodeMCU ESP8266 and SPI with NRF24L01 + SD card module - sanity errors?

      Hi,

      I have a problem which has been bothering me two evenings now; and I am just wondering if someone has a clever idea to get closer to the solution, or have a solution in general.

      I have a NodeMCU ESP8266 setup as MQTT gateway using the default pin layout as described on https://www.mysensors.org/build/connect_radio. This works perfect, and have been doing various tests now with battery based sensors.

      But, now I also want to create a backup system to a MicroSD card on this gateway using an MicroSD adapter. My receive() function will do these activities. Now the only problem is that I just cannot get the radio and SD card work together.

      Even not when not including the SD.h (or other related) libraries. The moment the CS pin is removed from the breadboard, the NodeMCU almost instantly continues and the radio turns on.

      These two evenings have been quite educational, but now it's time to get this to work :-). I also tested on another NodeMCU, which has the same issue. The SD card works standalone perfectly. Also with the radio connected it works perfect. It's just the radio that refuses to work and continues to give:

      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;RF24:write register, reg=0, value=14
      0;255;3;0;9;RF24:write register, reg=3, value=3
      0;255;3;0;9;RF24:write register, reg=4, value=95
      0;255;3;0;9;RF24:write register, reg=5, value=76
      0;255;3;0;9;RF24:write register, reg=6, value=39
      0;255;3;0;9;RF24:write register, reg=16, value=115
      0;255;3;0;9;RF24:write register, reg=29, value=6
      0;255;3;0;9;RF24:read register, reg=6, value=0
      0;255;3;0;9;RF24:read register, reg=5, value=0
      0;255;3;0;9;!RF24:INIT:SANCHK FAIL
      0;255;3;0;9;!TSM:INIT:TSP FAIL
      0;255;3;0;9;TSM:FAIL:CNT=7
      0;255;3;0;9;TSM:FAIL:PDT
      0;255;3;0;9;RF24:write register, reg=0, value=12
      

      The CS of the radio is on D8 and the CS of the SD reader is D4. This matches with the pins as seen below (according to: https://pradeepsinghblog.files.wordpress.com/2016/04/nodemcu_pins.png?w=616)

      This results from the before() function (serial print from the program):

      RF 24 CS PIN
      15
      SD CS PIN
      2
      pins low
      SD_CS_PIN is HIGH - GOOD
      MY_RF24_CS_PIN is LOW - GOOD
      

      The SD_CS pin is put to HIGH in the before() and pinmode are set in the before function:

      pinMode (SD_CS_PIN, OUTPUT);   
      digitalWrite (SD_CS_PIN, HIGH);  
      
      pinMode (MY_RF24_CS_PIN, OUTPUT);   
      digitalWrite (MY_RF24_CS_PIN, LOW );
      

      Remember: The SD libraries are not used at all. No begin() functions of any kind are called.

      This is what I have learned over the evenings, and I think this is all what it should be. The only thing I can think of is that the SD module just ignores the CS value.

      Hope that someone has a clue what could solve this issue. I am out of ideas right now.

      posted in Troubleshooting
      Kokosnoot
      Kokosnoot