Articles

Affichage des articles associés au libellé Arduino

Wemos d1 - Battery powered thermometer v2

Image
I built few thermometers powered by battery to check temperature's rooms in my house. For my tests I used : Webmos d1 mini 18650 battery  Sensor Si7021

Esp-01 deep sleep mode

Image
ESP-01 Esp01 is a very small esp8266. Less pins and small size. So it is wonder for iot projects But ESP-01 consumption is around 90 mAh. So you can't power it with a battery because lifetime will be only few days. To decrease consumption you have to put esp01 in a sleep mode. Best mode is deep sleep mode which reduce consumption to less than 1 uAh. Power consumption - See datasheet Standby ~ 0.9uA Running ~60-215mA, Average ~ 80mA How to power To power ESP-01 you have to use a 3.3v battery connect pin 1-GND to ground connect pin 8-VCC and to 3.3v Found a 3.3v battery is not easy. A solution is to use 18650 battery 3.7v (or 3x AA) and drop voltage to 3.3v. To drop voltage, you can use a LDO like MCP1700-3302E/TO VIN : 2.3-6v VOUT : 3.3v Goto Deep Sleep mode To use deep sleep mode, it is pretty easy. Just add ESP.deepsleep(5*1000000) in your code to go to sleep for 5 seconds. After 5s ESP will wakeup and restart and run setup() again ...

Wemos D1 mini

Image
Wemos D1 mini Webmos D1 Mini module is an ESP-12. It features are a3.3V LDO controller, a 3.3V input, a 5.0V input and a micro USB socket for power and programming. It has 11 ports and all have an interrupt (IRQ), andPWM, I2C. Like all ESP8266 based development boards, it is very easy to program using the Arduino IDE It is a little bigger than an ESP-01. But unlike the ESP-01, it has the advantage of having a pin GPIO16 which connected to the pin RST, wake up the component of deep sleep mode. Be careful, these 2 pins must not be connected when you upload your sktech.

Arduino flight controller

I found amazing project with many videos to build a quadcopter controlled using arduino uno. I am now analyzing the arduino code to understand how it works. I already found some interesting ideas : Loop frequency is 250hz. It means MPU6050 is read 250 times in a second and esc are updated 250 times too  It is a higher frequency than rasberrry zero can produce MPU6050 code to compute pitch and roll is different than mine. It seems to use acceleration rather than angle to compute pitch and roll. And it does not use dplf to reduce noise. I am surprised. It need to be tested. Battery voltage is read and used to increase esc pulses when voltage drops. It permits to stabilize quadcopter performances. Because when voltage decrease, motor rotation decrease too. Good idea. Esc pulses don't use the arduino servo library. They are generated manually using raw commands (pulse high for 1000-2000 us then low for a total cycle of 4000 us). So it needs a loop frequency of exactly 250 hz....

Arduino Test

Image
After few days thinking why my quadcopter python algorithm does not work during real test, I finally suspect the pwm pigpio libray does not do the job. So I decided to test my algorithm using Arduino beacuse it has 4 hardware pwm pins. I bought Arduino Uno. So I started to rewrite my python algorithm in C/C++. During rewiting my code in C/C++, I feel to go back 20 years ago...in the 1990s....Use basic functions, keep care low usage memory... Using Arduino is very very different from Raspberry, Logs are basics, you must use serial communication using an usb cable. It is not so easy....But I finally ended my code. MPU6050 code is finished. I read it and compute roll/pitch. PID and speeds motors are compute too. Now I have to test my code again as I did with Raspberry I have not yet tested pwm harware pins. I should have do this first but I got a basic problem. In fact, my usb cable between my computer and my arduino/quadcopter is too short ! So I have to w...