# To simulate a smart cradle

**URL:** <https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785>\
**Category:** General\
**Created:** [4 December 2019 11:14 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785 "2019-12-04T11:14:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tijosetom](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tijosetom](https://discourse.nodered.org/u/tijosetom)\
**Post date:** [4 December 2019 11:14 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785/1 "2019-12-04T11:14:17Z")

</div>

Hi,

I am new to Node-Red, please excuse me if my questions looks silly. For my Masters degree project, I am making a smart cradle with some features like baby cry detection using a particular algorithm and based on that do some soothing activity for the baby, like swing the cradle or play music etc.

I am trying to simulate this in Node-Red. I have two questions.

First one is very basic: Is Node-Red the right platform to try this? ie will i be able to simulate this in Node-Red?

Second question: For using a microphone node, I tried to install node-red-contrib-mic using command ' npm install node-red-contrib-mic'. But after that when i open dashboard, I am not able to see the mic node in it. Can someone help me on this.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [4 December 2019 11:24 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785/2 "2019-12-04T11:24:54Z")

</div>

> [@tijosetom](#):
>
> node-red-contrib-mic

To answer the first question, sure Node-RED can be used for this. It sounds like you will be using sensors and maybe motors. How are you going to communicate to them? (While I have suggestions, since it is your project, what ideas do you have?)

Second, were you in the `.node-red` folder when you did the install? If not NR won't find it. You might find it easier to install from the `Manage palette` option in Node-Red.

Make sure you have one of the dependencies installed

> Node-RED node for microphone (based on nodejs mic : a simple stream wrapper for arecord (Linux (including Raspbian)) and sox (Mac/Windows)).

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [4 December 2019 11:29 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785/3 "2019-12-04T11:29:21Z")

</div>

You might want to have a quick look at this tutorial I wrote for my IoT students.

> [@Controlling NeoPixels](https://discourse.nodered.org/t/controlling-neopixels/4560):
>
> [Controlling NeoPixels](http://resources-area.co.uk/node-red-flows/controlling_neopixels.pdf) I've just finished writing an instruction sheet, for my IoT students, on how to control NeoPixel strips. Note: This exercise uses a WeMos D1 Mini, Node-RED and MQTT (mosquitto) and of course a NeoPixel strip. I hope you enjoy reading this as much as I enjoyed writing it. Regards from David. PS: The document, in the above link, has been updated to implement the comments from various people.

It controls a strip of NeoPixels using a Wemos D1 Mini (ESP8266 microcontroller flashed with ESP Easy) and Node-RED running on a Raspberry Pi.

I'm sure ESP Easy used-to-have some device drivers for the NeoPixel candle.  
Just looked at the firmware and can't find them.  
Suggest you ask in the ESP forum.. [ESP Easy Forum - Let's Control It](https://www.letscontrolit.com/forum/viewforum.php?f=1)

[https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=7270&p=41146&hilit=candle#p41146](https://www.letscontrolit.com/forum/viewtopic.php?f=6&t=7270&p=41146&hilit=candle#p41146)

PS:  
As it's Christmas, a couple of my students are working on using a ultrasonic distance sensor (HC-SR05) to change the colour of some RGB lights on a Christmas tree. The idea is as you walk nearer to the tree the colour changes from green, to blue to RED. Another group are going to control the brightness as you walk nearer to another tree.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [4 December 2019 11:54 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785/4 "2019-12-04T11:54:09Z")

</div>

@tijosetom note one more thing, I tried installing node-red-contrib-mic and (what I thought were it's dependencies) it crashed NR. This is a known issue in GitHub ([https://github.com/MattVador/node-red-contrib-mic/issues/3](https://github.com/MattVador/node-red-contrib-mic/issues/3)) and I opened anther issue about the lack of docmentation.

Also, what platform will you be using?

---

<div class="post-metadata">

**Author:** ![tijosetom](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@tijosetom](https://discourse.nodered.org/u/tijosetom)\
**Post date:** [6 December 2019 07:19 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785/5 "2019-12-06T07:19:30Z")

</div>

Thank you Zenofmud,

It worked, i used the 'manage palette' option.

I don't have planned it in detail. It would be great if you can share some ideas for the work flow.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 December 2019 08:11 UTC](https://discourse.nodered.org/t/to-simulate-a-smart-cradle/18785/6 "2019-12-06T08:11:49Z")

</div>

Since this is for your masters project, shouldn’t you try to come up with the ideas?
