phyphox Forums
Color by Arduino Nano 33 Sense BLE - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: Discussion (https://phyphox.org/forums/forumdisplay.php?fid=1)
+--- Forum: Experiments and Ideas (https://phyphox.org/forums/forumdisplay.php?fid=4)
+--- Thread: Color by Arduino Nano 33 Sense BLE (/showthread.php?tid=1254)



Color by Arduino Nano 33 Sense BLE - solid - 01-05-2021

It is good idea to choose Arduino Nano 33 Sense BLE as the "Device for experimental physics teachers" (https://phyphox.org/forums/showthread.php?tid=1026)! This board has really good collection of sensors. One sensor, gesture, proximity, light color and light intensity sensor APDS9960, can determine the light color, which can be used to control this board without touching it and adding some more buttons to the pins. The programing is very easy. I tried it with some "filters" which I could found. See the code for the Arduino board and the results in the attachment.

Do not use lasers. Their direct light is too bright.


RE: Color by Arduino Nano 33 Sense BLE - Gautier Creutzer - 01-05-2021

Very interesting! I believe it could be useful to create educational games!
For instance, in combination with Phyphox: every color starts a different sensor (blue -> accelerometer, red -> magnetometer, yellow -> barometer, etc) and sends to Phyphox the data collected by this sensor, and the player must guess which sensor is related to each color by shaking the board, heating it or putting a magnet close to it.
It could also be funny and useful for escape games maybe.


RE: Color by Arduino Nano 33 Sense BLE - solid - 01-06-2021

When writing the above program I did not see the Arduino's example of the color recognition:
https://blog.arduino.cc/2019/11/07/fruit-identification-using-arduino-and-tensorflow/
with a similar code: https://create.arduino.cc/editor/TensorFlowExamples/ca761558-13ed-4190-baee-89ced06147c3/preview

Anyway the idea is to communicate not via COM port with the computer, but via Bluetooth with the smartphone. This will produce really autonomous color recognition device. To follow ...


RE: Color by Arduino Nano 33 Sense BLE - Jens Noritzsch - 01-06-2021

Brilliant idea, Mikhail. This sounds like much fun this year. Smile


RE: Color by Arduino Nano 33 Sense BLE - solid - 09-15-2021

Hi everybody,

Here is a new version of my programming where Arduino Nano 33 BLE sense recognizes color of my filters and communicate it by a number to smartphone. The Arduino program has to be adopted to particular filters and lamp.

Unfortunately phyphox currently does not support text indications  Sad and I had to indicate the found color by 1 and others by 0...   

   
In the experiment illustrated here the filters had been changed in the order: red, orange, yellow, green, blue..

Have a fun
Mikhail


RE: Color by Arduino Nano 33 Sense BLE - Jens Noritzsch - 09-15-2021

Looks fantastic. I have poked Sebastian… Wink


RE: Color by Arduino Nano 33 Sense BLE - Sebastian Staacks - 09-15-2021

There is a function that might help you:
The "value" element has a "map" function that allows mapping numeric ranges to predefined texts. We use this for example for the GPS status or the note value in the Audio spectrum. You can see the documentation here: https://phyphox.org/wiki/index.php?title=Phyphox_file_format#View-Element:_value

Just define a list of <map>-tags with the matching number as "max" in ascending order. Unfortunately, you cannot set the matching color for the view element and would need to leave it neutral.

Example (not tested):

<value label="Color">
<input>colorbuffer</input>
<map max="0">red</map>
<map max="1">orange</map>
<map max="2">yellow</map>
...
</value>

Phyphox goes through the list and uses the first matching entry. You can leave out min and max for the last entry to use it as fallback or if it also has a criterium and no entry matches, phyphox should fall back to the numeric value.


RE: Color by Arduino Nano 33 Sense BLE - solid - 11-14-2021

(11-13-2021, 12:29 PM)renkay Wrote: good idea, how to fix it in project

I add Sebastian's correction some time ago, but I kept the colors  Big Grin

   


RE: Color by Arduino Nano 33 Sense BLE - Jens Noritzsch - 11-14-2021

I like Smile