
Hi guys.
I need a little advice on some additional sensors I was thinking of adding to my bot, and as I am still waiting for my dev kit and extras to arrive, I am unable to test what I am thinking of doing so I'm hoping someone can point me in the right direction.
I had an idea of adding a smoke detection sensor and maybe a temperature sensor as well. The idea being that if I ask the bot what the current temperature is, or if the bot detects smoke or Co2 fumes, the bot would respond with verbally with a pre-recorded MP3 file of the Cepstral voice I have, or one better, have my bot tell me what room the smoke or gas is detected in. Here are a couple of links to what I am thinking of adding.
Smoke detection sensor
Temperature sensor
Would these sensors be compatible with the EZ-B v4 and 7.4 LiPo battery? I see that the temperature sensor is compatible with Arduino so I am hoping that both of these sensors will play nice with the v4. Also, has anyone tried something similar to what I am thinking of doing? As always, any help or advice anyone can offer would be greatly appreciated.
Cheers,
Steve.
The first one is for the smoke sensor which had a sample of Arduino code (Richard, I know your familiar with Arduino), and the data sheet below.
Smoke sensor Data sheet.
And I fouund a data sheet for a temp sensor which looks a little different to what I have, but has the same specs. Also my temp sensor works from 3.3v to 5v so I should be golden there.
Temp sensor Data sheet.
Steve.
The temp and humidity sensor is another story.... It will take someone who knows a lot about the EZB4 UART... I managed to receive 8bit data from a Roomba but that's it so far... The temp and humidity sensor (from the data sheet) requires I think 40bit.... DJ and possibly Rich are probably the only 2 who can help you here.... sorry
And with the smoke sensor, would there be a lot of difference if I used a digital port? I ask because if I find that voltage is an issue via analog, I do have 5v regulators I can use with the "Dout" pin. Just not sure what to do with the scripting side of things.
Alan
It has been mentioned here (by a member who is/was trying to read feedback data from his dynamixel servos) that there may be issues still with the UART receive...
Haven't had a chance to try anything out yet, but will do tomorrow. I had a thought in regards to both sensors and their 5v power requirements. Could I run the ground and Vcc from a digital port through a 5v regulator, and the signal wire from an ADC signal pin to keep the sensors running on analog, or would that not work?
Digital port to regulator to protoboard strip of pin headers... as long as the demand doesnt exceed 1a it'll be ok.
Success with the smoke sensor. After reading that Richard had one working with Arduino I plugged my one in to an ADC port, used the "Read ADC" control, blew some smoke at it and the values changed very well. It is now installed in to K-9's face plate.
Now I need to learn (quickly) how to scrip this so I can have say that smoke is detected using SayEZB(). I say quickly as I don't want to smoke out the house trying it out.
something like this in a script (it will obviously have to be put in a loop or use whatforchange statement)
Code:
Code:
Now I see what my mistake was, using the wrong syntax which should have been getADC(adc0) .
Thanks again.
By taking the Vcc and Ground from one of the digital ports you will not be able to use those pins for something else, i.e. you lose those 2 pins. Not a problem if you are using a H-Bridge or Ping sensor as only the signal pin is required for at least one port on both of those items.
The protoboard, pretty much is this...
Red & black wires on the bottom just indicate soldering and if it's Vcc (red) or Ground (black)
One EZ-B Digital port feeds the regulator. The regulator then feeds one strip on the protoboard with +5V regulated and Ground. 5V sensors etc, can then plug in to pin headers soldered to the protoboard (at least the power can).
Ps. Hope you had a nice holiday dude.
Now I would like to get the temp sensor working if I can. It,s not that importand, but as I have it I would like to use it, and get a better understanding of how UART works. I have plugged it in to D6 as I believe this is one of the three UART ports. I have the ground and vcc going through the 5v regulator, and the signal wire going to the D6 signal pin as, if i got this right, this is the RX (receive) pin. I wrote a quick UARTinit() script but that's as far as I can get. So three questions...
1. Should I be using the D6 RX signal pin, or D5 TX signal pin?
2. What URAT port number is the D6 port?
3. I tried to write a UARTRead() script but it comes up with an unknown command error, and I also noticed that the intellisense only has two choices, UARTInit(boardindex, port, baud) and UARTWrite(boardindex, port, data). Any ideas to why I cannot use the UARTRead? *confused* *confused*
I just tried the peripheral example. No joy. I tried every configuration, port 0, port 1, port 2, and used RX and TX. The byte rate never changed.
or... get an arduino example code for the temp sensor and port it to ezb scripting....