@kuriko Dupont, that looks promising. Thanks. For the 4 pins of the HDriver to the 4 pins on the M5Atom (and 2 other pins too) - I would need a female at one end, and a male at the M5 end.
You gave me a good path forward.
@kuriko Dupont, that looks promising. Thanks. For the 4 pins of the HDriver to the 4 pins on the M5Atom (and 2 other pins too) - I would need a female at one end, and a male at the M5 end.
You gave me a good path forward.
Hi, we have a nice 3d printed unit to house the M5Atom, and HDriver, Buzzer, and a Stepper Motor. This replaced an earlier custom board with the ESP-32 chip.
This is an automated Dog Feeder called PetTutor that we can mount on a wheelchair or basically anywhere else.
Anyway, are there Plug like cables that are better than the Breadboard Jumper Cables? The pins on the boards and even the M5 Atom are wider than a Grove cable. Is there a term for them?
This shows the Grove cable on the bottom. Does the top cable have a name/standard? The pins are wider. These are from the Stepper Motor and plug into the ULN2003 HDriver board (the one not labeled HDriver) (turns out the M5 HDriver couldn't power the stepper motor with enough torque. Instead we use this ULN2003 driver.)
What we want are plugs like this that can plug into the M5Atom and into other pins (basically like the HDriver from M5 - on left). So a male plug into the M5Atom and a female into the raw pins of the Driver board (Upper middle).
This shows a finished version with those jumper cables (and I need shorter ones). The lid with the motor goes in right on top of the blue case. (The stepper isn't plugged in yet). There is a small black buzzer (optional sound) under than blue angled piece.
We are looking for any ideas on making these connections more rock-solid like the Grove or other plug-in wires.
@Jennyrich789 Good stuff. I've been integrating a lot of those types of sensors, and I use the Tailbat for the battery. We are centering all our work around the M5Atom now, such a powerful computer.
My biggest challenge is getting the IR and RF to work. I finally got volume to my TV to work (which was IR), but then these new remotes use RF for the rest.
If anyone has a good approach to getting these to work, learning the commands, etc. That would really help me out. I have disabled users that could really use this driven from my M5Atom.
I too have the ATOM_SPK and the sample programs run but create no sound, even with the earphone jack.
https://docs.m5stack.com/en/atom/atom_spk
The PlayRawPCM
program runs but no sound.
Also the PlayMP3FromSD
is missing files, such as AudioFileSourceSD.h
.
I can get the beep program here to work
https://github.com/PaulskPt/M5Stack_M5Atom_EchoSPKR
But it seems this program makes a constant hum sounds always, and the beep when button pressed. I assume the battery will die faster too.
ps. What's up with tagging posts as being "OLD" - when it's a year ago, but the programs being tried are 4 years old. It sure seems to me that the "thread" of any issue, even decades old, should still be used to keep that context intact. Oh well..
I wanted to follow up on the power of OTA (Over the Air) update. With the USB wire plugged into the M5, and uploading a 'bin' via compiling, many times it gets a hiccup, and stops. Many times redoing works, but it's frustrating.
But with the OTA - In arduino I can sketch->Export to Compiled Binary.
Then I copy that 'bin' to the cloud storage via 'ssh'.
Then I have various ways of telling your M5 to grab that new OTA file. It takes a minute or so depending on the size.
So this OTA process can many times be easier than uploading via the USB cable. I even use the Serial monitor to take inputs from the user, such as perform an OTA from that new daily build file.
Also, I can update devices throughout my deployed M5 units through a similar process (sending an MQTT message to them).
@samlevy0515 I just got the $10 GPS Base 2 - and it works great. The M5Atom plugs into like all the others (QRCode, HDriver, etc). https://shop.m5stack.com/products/atomic-gps-base-v2-0-atgm336h
I've had the M5 with its display working for a few years. I'm onto other ways to share the information (over MQTT) and other apps (like iPhone apps, etc).
As for "cases" we are really into the 3d printer - and have some custom devices that house the M5 parts. We really like the small M5Atom. The amount of software that can be housed is impressive.
Look at some of our devices (eg. for Dog Feeding) mounted to a wheelchair, controller via BLE or MQTT.
-scott
@williamsmaith just let me know. I have over 700 clients using the system with a remote dog feeding application. I even have a client using eye-tracking to send messages to feed his dog (as the feeder is mounted to his wheel chair). - cheers.
I’ve built a great extensible architecture with M5 and basically any sensor. It was mentioned in my reply
https://community.m5stack.com/post/29410
It’s one thing to capture some data, it’s another to do the same in a scalable collective user base. That requires a distributed collection and messaging environment. Sensing and Controlling are two major branches of that challenge.
So I think this community challenge needs to think bigger than a few M5 devices. 😄
@williamsmaith ah thanks - for seeing the breadth of what’s possible. Messages are key and with ESP32 sharing BLE and WIFI it really is a game changer. Let me know if you want to try the system out.
Thanks
I like this question and I think another question should be on the features of the software that are most powerful.
For the sensors, after M5 with display, we are mainly using the M5Atom and then connecting the various plugin sensors (like QR scanner, Speaker, GPS, or others) - and the GROVE cable to stand along like sensors for LUX, Motion, Buttons (especially for disabled users). But either GROVE or directly into the M5Atom using the pins to control things like buzzers, and motors. For Motors, we need the 5v power.
As for software, I've built a really cool framework that incorporates the BLE, and the WIFI (with MQTT and web POST/GET) messaging. But for us, the ability to update already fielded systems requires the OTA capability. So any partition scheme without OTA isn't used.
I still code entirely in C and now C++. I feared C++ was too heavyweight for that small M5Atom - but it turns out it works nicely - and let me wrap those various sensors in an Object Oriented (plug compatible) feature that is adaptable at runtime via BLE/MQTT messages - basically tell it to use the GPS or QR OO Class, and also pins 28 and 32, etc. This is without modifying the installed code (or use OTA to add new sensor options). (I also use Xcode as the editor)
Note for the MQTT and other to work, there needs to be cloud processing. I have the ability to send any messages to all my devices. So the web needs the MQTT host, and if you want HTTP GET messages to work, there should be a node.js based controller (I use node-red.org). - Also for OTA, there needs to be an "http" host (not https).
If anyone is interested in more of our projects, which we are open sourcing, let me know. We are using 3d printed housing as well.
Check out at least:
https://github.com/konacurrents
https://github.com/konacurrents/SemanticMarkerAPI
and more..
Cheers,
scott
Re: M5Atom based power turns on briefly before user code runs
To power our motor (which goes through an H-Drive, but not the M5 version), we have to pass the 5v power from the M5Atom. (Bottom right 2 pins). The other two top on the right are the control pins (on/off).
This also shows a buzzer plugged into a different pin. Luckily that doesn't need the high power and will not BUZZ on startup.
The M5Atom provides power to the motor when it is rebooted or powered-up. This is BEFORE my code is even run.
Any ideas on how to stop this? We have a dog feeder and food is dispensed before we have our say. Also any reboot will do this!
A rough diagram is below.
@konacurrents Note, I have a similar startup issue with the Atom Socket and H-Driver.
Anyone know how to stop it starting before I get a change to stop it?
https://community.m5stack.com/topic/7445/m5atom-based-power-turns-on-briefly-before-user-code-runs
@Scotty42 I have used that barcode scanner to configure the QR scanner so will have to re-visit that approach. I have got the sound to go away but forgot how to do that. I have tried code to do that. Unfortunately some of these devices have a pre-state, like when powered up, which makes a sound before I can turn sound off. (Same with H-Driver and Atom Socket I just posted)
There is a mode to not accept those barcodes (so an end user cannot change some setting your code didn't want set).
Right now I use MQTT/BLE to set what it would scan - and then play that back from a button click. Basically store and re-play later - just like the QR code scanner achieves.
For my system, the QR code will invoke messages in my network - to turn on the lights, or feed the dog. I call this a Semantic Marker(R).
cheers,
thanks,
scott (also scotty)
I have two M5Atom
based controllers including:
They both run nicely being controlled over MQTT or BLE.
But any devices connected that need power are receiving a quick amount
of power when the M5Atom
is turned on. This occurs before my software runs - so before I can decide whether the power should be on or off.
So for the H-Driver
, the connected small motor gets a quick jolt of power before my software runs. For the Atom Socket
, the same quick power on occurs (turning on the connected device) before my software can determine the correct on/off mode.
Is there any way to stop this? It's not good (actually it's rather bad).
Thanks,
@Scotty42 I haven't been using the QR scanner as much especially as I cannot get the startup sound to go away (and it freaks my dogs). But the scanner works.
What issues are you having?
-scott
@felmue It looks like I need the binary version of getProtocolString
. It seems the following is needed for sending an IRData
(the mirror of what was learned from receiving.)
/**
* Interprets and sends a IRData structure.
* @param aIRSendData The values of protocol, address, command and repeat flag are taken for sending.
* @param aNumberOfRepeats Number of repeats to send after the initial data if data is no repeat.
* @return 1 if data sent, 0 if no data sent (i.e. for BANG_OLUFSEN, which is currently not supported here)
*/
size_t IRsend::write(IRData *aIRSendData, int_fast8_t aNumberOfRepeats)
And I need a way to get the IrReceiver
to provide the IRData
information. So It seems this is in the decodedIRData
from the IrReceiver.decode
call.
/**
* Main class for receiving IR signals
*/
class IRrecv {
public:
IRData decodedIRData; // Decoded IR data for the application
}
I assume I save these values with the associated functions (volume up, change channel, etc). I see that a lot of those functions are defined for various known operations, but for now I will learn from the IR receiver.
Thanks for the help.
@felmue Wow, I'll be. I can get this to send now. Pin 23 was the key.
I thought I tried that. But then I looked at the image and it showed 32 (but now I realized I read it backward:-)
actually worse: I misread that the numbers instead of right to left, I used top/bottom or bottom/top (the 33 threw my pattern off) - and I had seen the GPIO link you sent.
So I'm on my way. Thanks so much.
Is there a process on how to repeat these calls to the various remote messages?
eg. I'm testing and it's sendNEC vs sendSamsung. How would a universal remote know this just from scanning (learning)?
@konacurrents I have the IR Remote sensor, and I can now receive IR signals.
Cannot send IR
But I cannot send any IR signals (just repeating what was received). This is the volume on 3 or my remotes. I'm using the M5Atom button (which is Button B) to make do the IRSend command.
I found the IRremote
and IRSender
objects. I'm also using the Port B of my I2S using pins 33 and 32.
I'm trying to send what was printed from receiving the IR:
Send with: IrSender.sendSamsung(0x7, 0x7, <numberOfRepeats>);
By calling:
IrSender.sendSamsung(0x7, 0x7, 1);
Any ideas?
My sample program is below:
/******************************************************************************
Please connect to Port B,Use IR Unit to receive and test infrared receiving
and transmitting 请连接端口B,使用红外单元接收和测试红外接收和发射.
*/
#include <Arduino.h>
//#include <M5Core2.h>
#include <M5StickCPlus.h>
#include <IRremote.hpp>
#include <IRSend.hpp>
// I2S (middle port on Atom's port extender I2s driver)
int ir_recv_pin = 33; // set the input pin. 设置引脚
int ir_send_pin = 32;
#define DELAY_AFTER_SEND 2000
#define DELAY_AFTER_LOOP 500
//!see https://forum.arduino.cc/t/irremote-sending-samsung-code-but-not-working/1312154
#define IR_RECEIVE_PIN ir_recv_pin
#define IR_SEND_PIN ir_send_pin
void setup() {
Serial.begin(115200);
Serial.println();
M5.begin();
IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);
delay(DELAY_AFTER_LOOP);
IrSender.begin(IR_SEND_PIN);
Serial.print(F("Ready to receive IR signals of protocols: "));
printActiveIRProtocols(&Serial);
//Serial.println(F("at pin " STR(IR_RECEIVE_PIN));
}
void loop() {
//Serial.println("loop");
M5.update(); // Read the press state of the key. 读取按键 A, B, C 的状态
if (M5.BtnA.wasReleased())
{
// If the button A is pressed. 如果按键 A 被按下
Serial.println("A");
}
else if (M5.BtnB.wasReleased())
{
// If the button B is pressed. 如果按键
// B 被按下,
Serial.println("B");
//! seems to be the main button.. B
//! lets send the volume UP
//Protocol=Samsung Address=0x7 Command=0x7 Repeat gap=46750us Raw-Data=0xF8070707 32 bits LSB first
Serial.println("IrSender.sendSamsung(0x7, 0x7, 1)");
IrSender.sendSamsung(0x7, 0x7, 1);
IrReceiver.restartAfterSend(); // Is a NOP if sending does not require a timer.
delay(DELAY_AFTER_SEND);
}
else if (M5.BtnB.wasReleasefor(700))
{
// The button B is pressed for 700ms. 按键 B 按下
// 700ms,屏幕清空
Serial.println("b 700");
}
/*
Check if received data is available and if yes, try to decode it.
Decoded result is in the IrReceiver.decodedIRData structure.
E.g. command is in IrReceiver.decodedIRData.command
address is in command is in IrReceiver.decodedIRData.address
and up to 32 bit raw data in IrReceiver.decodedIRData.decodedRawData
*/
if (IrReceiver.decode()) {
/*
Print a summary of received data
*/
if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
// We have an unknown protocol here, print extended info
IrReceiver.printIRResultRawFormatted(&Serial, true);
IrReceiver.resume(); // Do it here, to preserve raw data for printing with printIRResultRawFormatted()
} else {
IrReceiver.resume(); // Early enable receiving of the next IR frame
IrReceiver.printIRResultShort(&Serial);
IrReceiver.printIRSendUsage(&Serial);
}
Serial.println();
}
delay(DELAY_AFTER_LOOP);
}
@konacurrents I also just found this IR library that I'll look at:
https://github.com/crankyoldgit/IRremoteESP8266
@konacurrents thanks, I've ordered that part and hope it solves my challenge. (I thought I had all the IR and RF controls, but that one slipped through.)
I assume the code will let me receive the code from buttons on a TV remote control, which I could then send from the M5 device later.
Thanks,