# Getting started with ESP8266 - first project - need help please

**URL:** <https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636>\
**Category:** Hardware\
**Created:** [25 March 2020 19:40 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636 "2020-03-25T19:40:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 March 2020 19:40 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/1 "2020-03-25T19:40:41Z")

</div>

[EDIT]... While I totaly get this topic isnt 100% node-red, I hope you all don't mind me kicking it off / discussing it here. I find this vibrant forum to be one the best I've ever used. And ultimately, I will share for others (and it does integrate with Node-red :) 

Hi guys, so continuing on from [this thread](https://discourse.nodered.org/t/off-topic-need-advice-getting-started-with-d1-esp-pi-type-thing-projects/23408/50), I followed your advice and got some ESP8266 & other bits n bobs, I've got [PlatformIO](https://platformio.org/) working with VSCode and I've done the obligatory hello world (blynk).

Now on to something a bit more adventurous but i need a bit of help and advice (if i thought it was confusing enough buying the bits - finding good info on all the terminology is much worse haha)

So my first project idea was an MQTT doorbell. I prised open my doorbell button but I suspect its NOT 433.9 MHz (the crystal had 26.x MHz on it) - no worries - plan B - the doorbell receiver has plenty of room inside to mount an ESP8266. On to the plan.

### The plan...

1. mount an ESP8266 inside doorbell receiver (picture 3 below)
  1. power it via the internal [78M05 5V regulator](http://datasheetcafe.databank.netdna-cdn.com/wp-content/uploads/2016/08/78M05-datasheet-pinout.gif) on the doorbell PCB
  2. connect a point on the doorbell PCB (that signals "door bell has been pushed") to an input on the ESP
  3. connect (piggyback) the 3 other side buttons from the to the ESP

2. Program it to send MQTT topic/payload on reception of doorbell push (I can do this bit 🙂 no problem )
3. Node-red instance to subscribe to MQTT topic and send telegram messages & trigger smart speaker (I can do this bit too :))

_ **Fairly straight forward right?** _

### Help needed...

Q. Can this [Makerfire D1 Mini ESP8266 ESP-12F](https://www.amazon.co.uk/gp/product/B07KYFZD17) be powered via the `G` and `5V` connectors? (picture below). _The drawings/info isn't 100% clear & there are no sample wiring diagrams for this particular board_  
If not possible to power this board with 5V to `G` and `5V`, what would I need to do to power this particular PCB?

Q. Which of the pins on this ESP PCB are actually usable as digital inputs?

- I have identified a point on the doorbell PCB that outputs +2.8V when "sounding" can I wire this straight to D0? etc. or do i need to something else before hand?
- The buttons (`VOL`, `<<` & `>>`) on the side of the doorbell appear to have 5V on them (un-pressed) and drop to zero when pressed - can these be connected straight to D2 D3, D4? etc. or do i need to something else before hand?

#### Bonus question...

Can I make this re-programmable via WiFi? - once its all boxed up it would be nice to be able to re-program it via WiFi.

### Supporting info...

PINS...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00e1df331e6d89dc3dec2c719db1acdad528ed3b.jpeg)  
The note at the bottom of this picture suggests something can handle 5V  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/2/d2f2c286bc6cc9b2b512526e2c67ebd4c445aa65.jpeg)  
Doorbell...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e7f7aa6823f34563155261bb7c98eb00bbf09d14.jpeg)

Also, I have a good selection of resistors / caps etc, the odd diode and a handfull of PN2222A (6E) general purpose NPN transistors if needed 🙂

Thanks for your time - its much appreciated (and needed), Steve.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 March 2020 19:59 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/2 "2020-03-25T19:59:52Z")

</div>

Although this may seem a stupid reply, I shall post all the same.

First question you asked:

> [@Steve-Mcl](#):
>
> Can this [Makerfire D1 Mini ESP8266 ESP-12F](https://www.amazon.co.uk/gp/product/B07KYFZD17) be powered via the `G` and `5V` connectors?

I would guess it can be. As USB is 5v and it has a USB connector.  
But PLEASE get a second opinion on that. I am not 100% confident on the reply.

> [@Steve-Mcl](#):
>
> The buttons ( `VOL` , `<<` & `>>` ) on the side of the doorbell appear to have 5V on them (un-pressed) and drop to zero when pressed - can these be connected straight to D2 D3, D4? etc. or do i need to something else before hand?

I'm not following this.

a) Why would the button have volume controls on it?  
b) If it is 5v, it may be dangerous. Most of the boards these days are 3.3v. 5v would do damage. But question (a) kind of makes this redundant in some ways.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [25 March 2020 20:04 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/3 "2020-03-25T20:04:11Z")

</div>

> [@Steve-Mcl](#):
>
> appear to have 5V on them (un-pressed) and drop to zero when pressed - can these be connected straight to D2 D3, D4? etc. or do i need to something else before hand?

The ESP chip itself is a 3.3V device so at the minimum you'd need a resistor between the doorbell and it

---

<div class="post-metadata">

**Author:** ![markost](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@markost](https://discourse.nodered.org/u/markost)\
**Post date:** [25 March 2020 20:06 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/4 "2020-03-25T20:06:34Z")

</div>

Resistor divider

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 March 2020 20:22 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/5 "2020-03-25T20:22:12Z")

</div>

All good info guys, but honestly assume I know nothing about electronics.

If you're able to sketch something using the images I provided - I would be super grateful.

For example - this is how it looks in my head...

 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f77ebaf3dca5e26d4ae00ff6e7b6129ec70ec7cf.png)  
**note to future readers - no not do this it'll likely damage stuff**

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 March 2020 20:26 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/6 "2020-03-25T20:26:12Z")

</div>

> [@markost](#):
>
> Resistor divider

I guess you are refering to first Question about powering the ESP?  
Do you mean use resistors to reduce V+ to 3.3v?

I still don't understand what the `G` and `5v` pins are for!  
And as @Trying_to_learn states, its powered by 5v from USB  
And the stock image says - it has an onboard switching power supply max input 24v

See my confusion 😕 haha

---

<div class="post-metadata">

**Author:** ![markost](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@markost](https://discourse.nodered.org/u/markost)\
**Post date:** [25 March 2020 20:34 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/7 "2020-03-25T20:34:10Z")

</div>

No 😁.  
Power supply is OK. You can connect as is in your picture. From voltage regulator 78M05 to Esp8266 module.

Voltage divider is for input pin on esp8266. Inputs on esp8266 are not 5V tolerant. You need make them lower(3.3V).  
Easiest is to use voltage divider (2 resistors)

 ![z5AQJ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/9/7916e7c264e46faf1d15a6b360f5e23aa39826e8.png)  

> **[Why You Can’t Use Resistors as a Voltage Regulator](https://hackingmajenkoblog.wordpress.com/2016/08/30/why-you-cant-use-resistors-as-a-voltage-regulator/amp/)**
>
> Due to Wordpress’s abysmal handling of code blocks this blog post is now hosted at People, all the time, use a simple resistor-based voltage divider to change 5v into 3.3v. You see it all ove…

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [25 March 2020 20:40 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/8 "2020-03-25T20:40:45Z")

</div>

fantastic info - much appreciated.

_Believe it or not, I know most of this but I am soooo rusty - its been more years than it hasn't, since I've done anything with electronics._

**Question** , so I connect the `3.3v signal out` to D0? D1? D2? D3? any? are they all ok?  
And which of the Dx inputs are usable in this manner (e.g. 3.3 switching to zero) and if you know, do i set them up as this `pinMode(D0,INPUT);` or this `pinMode(D0,INPUT_PULLUP);`?

any help you or anyone else can offer would be great.

cheers, Steve.

---

<div class="post-metadata">

**Author:** ![markost](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@markost](https://discourse.nodered.org/u/markost)\
**Post date:** [25 March 2020 20:45 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/9 "2020-03-25T20:45:27Z")

</div>

Connect doorbell output signal (5v) via voltage divider to esp8266 input.

For best pin usage:

> **[ESP8266 Pinout Reference: Which GPIO pins should you use? | Random Nerd...](https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/)**
>
> The ESP8266 comes with 33 GPIOs with multiple functions. This article is a simple and easy to follow reference guide for the ESP8266 GPIOs.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [25 March 2020 20:56 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/10 "2020-03-25T20:56:58Z")

</div>

Oh for **checking** you can put 5v on the 5v pin:

Board as is..... Plug in a USB cable with power.

Measure the voltage on the 5v pin/pad. If you see 5v, then you can confidently connect 5v to that pin - but don't also have the USB cable plugged in. That may cause problems if there is a voltage difference between the USB's 5 volts and the power supply's 5v.

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [25 March 2020 21:55 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/11 "2020-03-25T21:55:53Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d3817d56b5c1d5d01b5cf4174650ff1279ef16b9.jpeg)

- my preference would go on D1, D2 or D4 .  
The others have specificities that you could need thereafter, as much not to encumber them.

> [@Steve-Mcl](#):
>
> as this `pinMode(D0,INPUT);` or this `pinMode(D0,INPUT_PULLUP);` ?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c8ab2f74b5a907ea318d6200aef8f1e5cfc99600.jpeg)

- if you measure a high state at 2.8v (when sounding) and a low state at 0v, you do not need the voltage divider bridge. ESP accepts signals up to 3.3v
- concerning the push buttons, yes the voltage divider is required if the buttons in place provide 5v \<-\> 0v.

`pinMode(D0,INPUT);` or this `pinMode(D0,INPUT_PULLUP);` i think buttons in place ave already pullup resistor , so don't need to use INPUT\_PULLUP.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [24 May 2020 21:55 UTC](https://discourse.nodered.org/t/getting-started-with-esp8266-first-project-need-help-please/23636/12 "2020-05-24T21:55:54Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
