Has anyone figured out how to get the flame sensor to work with Scratch and the mBot? When I light a flame, my flame sensor lights a blue led on C1. What do I do with that information? How do I get it inputted into Scratch so I can run a program when a flame is detected? I am using port3 on my mBot
Flame Sensor
HI @Epstem,
The work principle is like this:
- Once the infrared waves exceed the threshold value, the blue LED would turn on;
- The value can be shown on the scratch.
Below I have prepared a short program for you, kindly have a look:
Thank you for your reply, however, I cannot find the âflame intensityâ block. Can you please tell me how I can find this block?
You should firstly choose mBot under the item of âBoardsâ, and when you run the program, the Panda would say out.
I apologize for the delay, Iâve been out of town. I cannot find the block that says âFlame Intensityâ on any of the boardâs options under the ârobotâ section of scratch. Can you please tell me where to find the âFlame Intensityâ block? And thank you for all your help.
Try to download the latest mBlock v3.2 from http://www.mblock.cc/download. Flame sensor block is included in this version.
Sorry to hijack this thread slightly,but Iâve been having a problem with the âsayâ command in scratch - it seems that when I try to use it, for example, to output the value of the ultrasonic sensor it sends an error âunsupported blockâ - it seems to be specifically the combination of the say command + a sensor reading. Any help would be appreciated.
I tested it with Orion board. It worked fine.
In this test, I selected Boards>Me Orion, and uploaded firmware to Orion board with Connect>Upgrade Firmware in mBlock, clicked the green flag to run the program.
You can try to use the latest version of mBlock. If it still doesnât work, please let me know.
Iâve just reinstalled Scratch and it seems to work now - I donât know what the issue was. As an aside, Iâve noticed that the Wifi connection (2.4G dongle) can be a bit âsporadicâ, with the values being sent stopping for a second or two, or briefly sending an unusual value. Via USB is totally stable. Do you have any tips for improving this?
Thanks for your time and effort.
Iâve downloaded the new mBlock 3.2.1 and I still cannot find the âflame intensityâ block. The only block I have is âflame sensor port xâ I have added a screen shot with the program I wrote, but when I run it, it crashes mBlock and I have to reopen the program. Please advise what I should do next.
@EPSTEM âflame sensor port xâ is exactly what you want. I guess âflame intensityâ is shown in previous version. Iâve upgrade my mBlock to V3.2. I ran a test program as show in pic.
For your situation, you can try following steps:
1 Connect mBot with PC via USB, turn on mBot, choose serial port, upgrade firmware to mBot.
2 Turn off mBot, unplug usb, connect flame sensor with Port 4, plug in Bluetooth module, turn on mBot, connect mBlock with mBot via bluetooth.
3 Select Boards>mBot, Extensions>Makeblock in the menu bar of mBlock.
4 Use the program in the previous pic to test flame sensor, click green flag to run the program.
If it still doesnât work, you can try to test your program under usb mode. Hope it works.
Mr. Pioneer,
I updated the firmware on my mBot and now the flame sensor works beautifully!! Thank you very much for all your help!!!
âShane
Mr Pioneer,
I have followed ALL the instructions you said in the previous messages, but my Flame sensor still dosenât work.
I tried 2 things, but I dinât manage to make any to work:
1/ I tried to get the value of the flame sensor. (First programe)
2/ In other forums people suggested to me, the value of this sensor is a binary variable:
0=it detects the flame; then the leds turn red
1=there is no flame; then the leds turn
I send you a picture.
Please, may you help me???
Thank you very much
MĂłnica
Mr Pioneer,
Finally It worked. I reread all your instructions and it worked.
Thanks again!
MĂłnica