code works on arduino, how do i program the esp or espeasy? :S

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
stin88
Normal user
Posts: 16
Joined: 29 Jul 2019, 18:36

code works on arduino, how do i program the esp or espeasy? :S

#1 Post by stin88 » 12 Oct 2019, 12:13

been working with this esp8266 flashed with espeasy and i can understand the simplicity. However, not been working so much with the flashing and programming this soc....

so, now i have been cheating and made my code work on my arduino, where do i start programming the esp8266 and with (maybe) easyesp firmware? :?: :?:

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: code works on arduino, how do i program the esp or espeasy? :S

#2 Post by grovkillen » 12 Oct 2019, 16:52

What have you got working on the Arduino? Please explain.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

stin88
Normal user
Posts: 16
Joined: 29 Jul 2019, 18:36

Re: code works on arduino, how do i program the esp or espeasy? :S

#3 Post by stin88 » 13 Oct 2019, 17:19

this is the setup to controll DALI (Digital Adressable Lighting Interface) using bc549C. It seems to work fine on arduino.
Image

stin88
Normal user
Posts: 16
Joined: 29 Jul 2019, 18:36

Re: code works on arduino, how do i program the esp or espeasy? :S

#4 Post by stin88 » 19 Oct 2019, 19:00

succeded to upload arduino code to esp, recalculate the v-divider, R1=1,1kohm and R=100ohm and i get 0,75voltage when esp is not power on, when i power on the esp8366, it gives me around 1voltage, why? :S

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: code works on arduino, how do i program the esp or espeasy? :S

#5 Post by TD-er » 19 Oct 2019, 21:53

stin88 wrote: 19 Oct 2019, 19:00 succeded to upload arduino code to esp, recalculate the v-divider, R1=1,1kohm and R=100ohm and i get 0,75voltage when esp is not power on, when i power on the esp8366, it gives me around 1voltage, why? :S
For what schematic? The one above your post?
And what voltage do you use? (at what pins in the schematic do you apply the voltage?)
In the schematic above your post, R1 is not really part of the voltage divider, more like a current limiter.
Also it depends on the used ESP module if there is already a voltage divider present.

If you have a resistor between the GND of the power and the GND of the ESP, then you may introduce a higher voltage drop when using more current.
So please show what schematic you are using.

stin88
Normal user
Posts: 16
Joined: 29 Jul 2019, 18:36

Re: code works on arduino, how do i program the esp or espeasy? :S

#6 Post by stin88 » 20 Oct 2019, 18:01

this is the schematic-ish
Image

i needed to refine the v-divider for esp8266. The arduino code runs just fine now on esp8266-12e. :)

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: code works on arduino, how do i program the esp or espeasy? :S

#7 Post by TD-er » 20 Oct 2019, 19:41

Hmm that's a strange schematic.
What is connected to the DA pins?

The reason I find it a strange schematic is that it is switching the GND.
Also the voltage is measured "after" the 62 Ohm resistor, which makes it depending on the load of whatever connected to DA pins.

The resistors for the voltage divider sum to 12.5 kOhm, so when applying 12V to it, it will have almost 1V over the 1kOhm resistor.
So if the 12V is slightly over the stated value, then the voltage over the analog input is at its max. of 1V.
So you can place another 1k resistor parallel to the existing one. This puts the range around the middle of the range.

stin88
Normal user
Posts: 16
Joined: 29 Jul 2019, 18:36

Re: code works on arduino, how do i program the esp or espeasy? :S

#8 Post by stin88 » 21 Oct 2019, 20:53

TD-er wrote: 20 Oct 2019, 19:41 Hmm that's a strange schematic.
What is connected to the DA pins?
Lamps
https://en.wikipedia.org/wiki/Digital_A ... _Interface

i dont think it dosnt matter if i connect the transistor to +12 or -12 side due to Dali has a rectifier bridge inside it. As long as the ADC is connected to the opposite side if i want to have data from the lamps.

TD-er
Core team member
Posts: 8644
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: code works on arduino, how do i program the esp or espeasy? :S

#9 Post by TD-er » 22 Oct 2019, 09:29

Nope, it should work fine, it is just that you don't see it very often that the power is switched at GND level.

Assuming you have the GND of the entire circuit at the same level (and not some at DA-) then you will measure the same +12V at the DA+ pin when the lamp is off.
If switched on, you will measure a lower voltage due to the voltage drop over the 62 Ohm resistor which does act like a shunt.
Let's assume your lamp takes 20 mA (100 mA max?), then the voltage drop over the shunt is 62 Ohm * 0.02A = 1.24V.
So then the voltage over the resistors to the ADC input is 12 - 1.24V = 10.76 V
This difference is even more when the current is larger. For example at 50 mA the voltage drop is about 25% of the 12V you supply.

The ADC will clip at 1V, so you may want to lower the 1K resistor directly over the ADC input. (place another 1k parallel to it)

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests