Search found 126 matches

by OlivierLenoir
Thu Nov 25, 2021 4:54 pm
Forum: ESP32 boards
Topic: 360 servo not working on ESP32 & micropython
Replies: 3
Views: 2346

Re: 360 servo not working on ESP32 & micropython

On your servo motor MG996R, you have tree wires:
  • (Yellow) PWM signal from EPS32
  • (Red) 5V
  • (Brown) GND
Do you supply the servo with 5V?
by OlivierLenoir
Thu Nov 25, 2021 4:41 pm
Forum: Raspberry Pi microcontroller boards
Topic: photocells get light intensity
Replies: 8
Views: 8668

Re: photocells get light intensity

You can consider GP26_A0 as an high impedance, so current iGP26_A0 can be considered as 0A.
Current iR1 = iR2. As R1 depend on light, i = 3.3V / (R1 + R2), so i is not constant.

Example with different value for R2
CurrentR1-R2.png
CurrentR1-R2.png (25.81 KiB) Viewed 8461 times
by OlivierLenoir
Fri Nov 19, 2021 5:25 pm
Forum: ESP32 boards
Topic: 360 servo not working on ESP32 & micropython
Replies: 3
Views: 2346

Re: 360 servo not working on ESP32 & micropython

For a servo motor duty time on need to be between 1ms and 2ms. Currently the duty cycle has to be in the range of 0-1023.
So on an ESP32, duty cycle for 1ms is around 51 and 2ms is around 102.
by OlivierLenoir
Fri Nov 19, 2021 4:28 pm
Forum: Raspberry Pi microcontroller boards
Topic: photocells get light intensity
Replies: 8
Views: 8668

Re: photocells get light intensity

An other approach, would consist of using an LED as a light sensor, amplified by a transistor.
SolarTrackerLEDSensor_schem.png
SolarTrackerLEDSensor_schem.png (104.45 KiB) Viewed 8595 times
by OlivierLenoir
Fri Nov 19, 2021 4:00 pm
Forum: Raspberry Pi microcontroller boards
Topic: photocells get light intensity
Replies: 8
Views: 8668

Re: photocells get light intensity

Based on proposed schematic, you can read photocells with this code. from machine import Pin, ADC # Set sensors sensor_a = ADC(Pin(26)) # ADC0 sensor_b = ADC(Pin(27)) # ADC1 sensor_c = ADC(Pin(28)) # ADC2 # Read sensors # read value, 0-65535 across voltage range 0.0v - 3.3v sensor_a.read_u16() senso...
by OlivierLenoir
Thu Nov 18, 2021 5:40 pm
Forum: Raspberry Pi microcontroller boards
Topic: photocells get light intensity
Replies: 8
Views: 8668

Re: photocells get light intensity

Are you looking for something like that?
SolarTracker_schem.png
SolarTracker_schem.png (81.93 KiB) Viewed 8598 times
SolarTracker_bb.png
SolarTracker_bb.png (256.16 KiB) Viewed 8598 times
by OlivierLenoir
Thu Nov 04, 2021 5:39 pm
Forum: General Discussion and Questions
Topic: Updating a config file [solved]
Replies: 12
Views: 4960

Re: Updating a config file [solved]

As Peter says, it's what I'm implementing for project MicroPython-MQTTremote not finished yet.
config.json
And the code that implement the config.json is here.
by OlivierLenoir
Thu Nov 04, 2021 5:13 pm
Forum: General Discussion and Questions
Topic: Updating a config file [solved]
Replies: 12
Views: 4960

Re: Updating a config file [solved]

Can you look at what I did for my logger? It's here.

Instead of having a config.py, you should have a config.json file.
by OlivierLenoir
Thu Nov 04, 2021 4:39 pm
Forum: Raspberry Pi microcontroller boards
Topic: Raspberry pi pico NEMA34 Stepper
Replies: 3
Views: 1854

Re: Raspberry pi pico NEMA34 Stepper

The CS-D808 datasheet says page 6, min operating voltage 30V, typical 48V to 60V, max 80V.
The enable pin should be high to work, page 8.
by OlivierLenoir
Fri Oct 29, 2021 5:18 am
Forum: General Discussion and Questions
Topic: Random words, rather then Random number?
Replies: 2
Views: 1251

Re: Random words, rather then Random number?

Code: Select all

import urandom
urandom.choice(('yes', 'no'))