Flame Sensor


#1

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


#2

HI @Epstem,

The work principle is like this:

  1. Once the infrared waves exceed the threshold value, the blue LED would turn on;
  2. The value can be shown on the scratch.
    Below I have prepared a short program for you, kindly have a look:

#3

Thank you for your reply, however, I cannot find the “flame intensity” block. Can you please tell me how I can find this block?


#4

You should firstly choose mBot under the item of “Boards”, and when you run the program, the Panda would say out.


#5

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.


#6

Try to download the latest mBlock v3.2 from http://www.mblock.cc/download. Flame sensor block is included in this version.


#7

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.


#8

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.


#9

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.


#10

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.


#11

@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.


#12

Mr. Pioneer,
I updated the firmware on my mBot and now the flame sensor works beautifully!! Thank you very much for all your help!!! :grinning:

–Shane


#13

Cool, glad to know you make it. :smile:


Program flame sensor with scratch
#14

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


#15

Mr Pioneer,

Finally It worked. I reread all your instructions and it worked.
Thanks again!
Mónica


#16